From 40177b5ef7a316f0b036ad7881f2e4948f19cb92 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Tue, 14 Jan 2020 14:32:43 -0800 Subject: [PATCH 01/36] wip --- .../api/codegen/config/FieldConfig.java | 37 ++++++++- .../api/codegen/config/GapicMethodConfig.java | 13 ++-- .../codegen/config/GapicProductConfig.java | 14 ++-- .../api/codegen/config/MethodConfig.java | 3 +- .../config/ResourceDescriptorConfig.java | 75 +++++++++---------- .../config/ResourceNameMessageConfig.java | 10 ++- .../config/ResourceNameMessageConfigs.java | 25 ++++--- 7 files changed, 107 insertions(+), 70 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index ac08409587..64d8a686a0 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -38,6 +38,8 @@ public abstract class FieldConfig { @Nullable public abstract ResourceNameConfig getResourceNameConfig(); + public abstract List getResourceNameConfigs(); + @Nullable public abstract ResourceNameConfig getMessageResourceNameConfig(); @@ -90,18 +92,22 @@ static FieldConfig createMessageFieldConfig( static FieldConfig createFieldConfig( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, - Map fieldNamePatterns, + ListMultimap fieldNamePatterns, Map resourceNameConfigs, FieldModel field, ResourceNameTreatment treatment, ResourceNameTreatment defaultResourceNameTreatment) { String messageFieldEntityName = null; String flattenedFieldEntityName = null; + List flattenedFieldEntityNames; if (messageConfigs != null && messageConfigs.fieldHasResourceName(field)) { messageFieldEntityName = messageConfigs.getFieldResourceName(field); } if (fieldNamePatterns != null) { - flattenedFieldEntityName = fieldNamePatterns.get(field.getNameAsParameter()); + flattenedFieldEntityNames = fieldNamePatterns.get(field.getNameAsParameter()); + if (flattenedFieldEntityNames != null && flattenedFieldEntityNames.size() >= 1) { + flattenedFieldEntityName = flattenedFieldEntityNames.get(0); + } } if (flattenedFieldEntityName == null) { flattenedFieldEntityName = messageFieldEntityName; @@ -164,6 +170,13 @@ static FieldConfig createFieldConfig( return createFieldConfig( field, treatment, flattenedFieldResourceNameConfig, messageFieldResourceNameConfig); + return newBuilder() + .setField(field) + .setResourceNameTreatment(resourceNameTreatment) + .setResourceNameConfig(flattenedFieldResourceNameConfig) + .setResourceNameConfigs() + .setMessageResourceNameConfig(messageFieldResourceNameConfig) + .build(); } private static ResourceNameConfig getResourceNameConfig( @@ -288,4 +301,24 @@ public static ImmutableMap toFieldConfigMap( Iterable fieldConfigs) { return Maps.uniqueIndex(fieldConfigs, f -> f.getField().getFullName()); } + + @AutoValue.Builder + public static class Builder { + + public abstract Builder setField(FieldModel val); + + public abstract Builder setResourceNameTreatment(ResourceNameTreatment val); + + public abstract Builder setResourceNameConfig(ResourceNameConfig val); + + public abstract Builder setResourceNameConfigs(ImmutableList val); + + public abstract Builder setMessageResourceNameConfig(ResourceNameConfig val); + + public abstract FieldConfig build(); + } + + public static Builder newBuilder() { + return new AutoValue_Builder().setResourceNameConfigs(ImmutableList.of()); + } } diff --git a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java index 197c4dd1d8..da14f7c8f9 100644 --- a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java @@ -40,6 +40,7 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableSet; import java.util.ArrayList; import java.util.List; @@ -264,8 +265,8 @@ static GapicMethodConfig createGapicMethodConfigFromGapicYaml( ProtoMethodModel methodModel = new ProtoMethodModel(method); List requiredFields = methodConfigProto.getRequiredFieldsList(); - ImmutableMap fieldNamePatterns = - ImmutableMap.copyOf(methodConfigProto.getFieldNamePatterns()); + ImmutableListMultimap fieldNamePatterns = + ImmutableListMultimap.copyOf(methodConfigProto.getFieldNamePatterns().entrySet()); ResourceNameTreatment defaultResourceNameTreatment = methodConfigProto.getResourceNameTreatment(); @@ -344,9 +345,9 @@ static ResourceNameTreatment defaultResourceNameTreatmentFromProto( } } - public static ImmutableMap getFieldNamePatterns( + public static ImmutableListMultimap getFieldNamePatterns( Method method, ResourceNameMessageConfigs messageConfigs) { - ImmutableMap.Builder resultCollector = ImmutableMap.builder(); + ImmutableListMultimap.Builder resultCollector = ImmutableListMultimap.builder(); // Only look two levels deep in the request object, so fields of fields of the request object. getFieldNamePatterns(messageConfigs, method.getInputMessage(), resultCollector, "", 2); return resultCollector.build(); @@ -370,7 +371,7 @@ public static ImmutableMap getFieldNamePatterns( private static void getFieldNamePatterns( ResourceNameMessageConfigs messageConfigs, MessageType messageType, - ImmutableMap.Builder resultCollector, + ImmutableListMultimap.Builder resultCollector, String fieldNamePrefix, int depth) { if (depth < 1) throw new IllegalStateException("depth must be positive"); @@ -424,7 +425,7 @@ public abstract static class Builder { public abstract Builder setBatching(@Nullable BatchingConfig val); - public abstract Builder setFieldNamePatterns(ImmutableMap val); + public abstract Builder setFieldNamePatterns(ImmutableMultimap val); public abstract Builder setSampleCodeInitFields(List val); diff --git a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java index 2e050d2029..50ea3267e0 100644 --- a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java @@ -269,7 +269,7 @@ public static GapicProductConfig create( } // Create a child-to-parent map to make resolving child_type easier. - Map childParentResourceMap = + Map> childParentResourceMap = ResourceDescriptorConfig.getChildParentResourceMap( descriptorConfigMap, patternResourceDescriptorMap); resourceNameConfigs = @@ -813,7 +813,7 @@ private static ImmutableMap createResourceNameConfig Set typesWithChildReferences, Map deprecatedPatternResourceMap, Map> patternResourceDescriptorMap, - Map childParentResourceMap, + Map> childParentResourceMap, String defaultPackage) { Map allCollectionConfigProtos = @@ -1108,7 +1108,7 @@ private static Map getResourceNameConfigsFromAnnotat Set typesWithChildReferences, Map deprecatedPatternResourceMap, Map> patternResourceDescriptorMap, - Map childParentResourceMap, + Map> childParentResourceMap, String defaultPackage, Map singleResourceNameConfigsFromGapicConfig) { HashMap annotationResourceNameConfigs = new HashMap<>(); @@ -1132,14 +1132,16 @@ private static Map getResourceNameConfigsFromAnnotat } if (typesWithChildReferences.contains(unifiedResourceType)) { - ResourceDescriptorConfig parentResource = childParentResourceMap.get(unifiedResourceType); - Map resources = + List parentResources = childParentResourceMap.get(unifiedResourceType); + for (ResourceDescriptorConfig parentResource : parentResources) { + Map resources = parentResource.buildResourceNameConfigs( diagCollector, singleResourceNameConfigsFromGapicConfig, deprecatedPatternResourceMap, language); - annotationResourceNameConfigs.putAll(resources); + annotationResourceNameConfigs.putAll(resources); + } } } return annotationResourceNameConfigs; diff --git a/src/main/java/com/google/api/codegen/config/MethodConfig.java b/src/main/java/com/google/api/codegen/config/MethodConfig.java index a424ba6382..019dca0ebe 100644 --- a/src/main/java/com/google/api/codegen/config/MethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/MethodConfig.java @@ -23,6 +23,7 @@ import com.google.api.tools.framework.model.SimpleLocation; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableListMultimap; import java.util.List; import javax.annotation.Nullable; import org.threeten.bp.Duration; @@ -184,7 +185,7 @@ static ImmutableList createFieldNameConfigs( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, ResourceNameTreatment defaultResourceNameTreatment, - ImmutableMap fieldNamePatterns, + ImmutableListMultimap fieldNamePatterns, ImmutableMap resourceNameConfigs, Iterable fields) { ImmutableList.Builder fieldConfigsBuilder = ImmutableList.builder(); diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index ba5dfa1f71..c7a5079693 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -166,22 +166,22 @@ Map buildResourceNameConfigs( } /** - * Returns a map from unified resource types to the parent resource descriptor config. + * Returns a map from unified resource types to parent resources. * - *

We consider resource Foo to be resource Bar's parent iff Foo and Bar have the same number of - * patterns, and for each pattern 'B' in Bar, there is a pattern 'F' in Foo , such that 'F' is the - * parent of 'B'. + *

We consider the list of resources to be another resource Bar's parents if + * the union of all patterns in the list have one-to-one parent-child mapping with + * Bar's patterns. * *

Package private for use in GapicProductConfig. */ - static Map getChildParentResourceMap( + static Map> getChildParentResourceMap( Map descriptorConfigMap, Map> patternResourceDescriptorMap) { ImmutableMap.Builder builder = ImmutableMap.builder(); for (Map.Entry entry : descriptorConfigMap.entrySet()) { - ResourceDescriptorConfig parentResource = + List parentResource = getParentResourceDescriptor(entry.getValue(), patternResourceDescriptorMap); - if (parentResource != null) { + if (!parentResource.isEmpty()) { builder.put(entry.getKey(), parentResource); } } @@ -189,48 +189,43 @@ static Map getChildParentResourceMap( } @Nullable - private static ResourceDescriptorConfig getParentResourceDescriptor( + private static List getParentResourceDescriptor( ResourceDescriptorConfig childResource, - Map> patternResourceDescriptorMap) { - Set parentResourceCandidates = + Map> patternResourceDescriptorMap) { + List resources = patternResourceDescriptorMap .values() .stream() .flatMap(Set::stream) - .collect(Collectors.toSet()); - - // Loop over patterns. For each pattern, retain all resource descriptors with a pattern that - // is the parent pattern of this pattern in parentResourceCandidates. - for (String parentPattern : childResource.getParentPatterns()) { - - // Avoid unnecessary lookups. - if (parentResourceCandidates.isEmpty()) { - return null; - } - - parentResourceCandidates.retainAll( - patternResourceDescriptorMap.getOrDefault(parentPattern, Collections.emptySet())); - } - - // We have made sure that each resource in parentResourceCandidates has all the required - // parent patterns of childResource. We now need to make sure they don't have extra patterns - // that are not parent of patterns of childResource. We check this by checking that - // a parent resource candidate has the same number of patterns as childResource. - parentResourceCandidates = - parentResourceCandidates - .stream() - .filter(c -> c.getPatterns().size() == childResource.getPatterns().size()) - .collect(Collectors.toSet()); - - return parentResourceCandidates.size() == 1 ? parentResourceCandidates.iterator().next() : null; - } + .collect(Collectors.toList()); - private List getParentPatterns() { - return getPatterns() + ImmutableList parentResources = ImmutableList.Builder<>(); + + Map matchedParentPatterns = childResource.getPatterns() .stream() .map(ResourceDescriptorConfig::getParentPattern) .distinct() - .collect(Collectors.toList()); + .collect(Collectors.toMap(p -> p, p -> false)); + int unmatchedPatternsCount = matchedParentPatterns.size(); + + for (ResourceDescriptorConfig resource : resources) { + for (String pattern : resource.getPatterns()) { + Boolean matched = matchedParentPatterns.get(pattern); + if (matched == null) { + continue; + } + if (matched == false) { + unmatchedPatternsCount -= 1; + } + matchedParentPatterns.put(pattern, true); + } + parentResources.add(resource); + } + + if (unmatchedPatternsCount == 0) { + return parentResources.build(); + } + return Collections.emptyList(); } @VisibleForTesting diff --git a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java index 8f66ceeb50..03ffcdf986 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java @@ -18,6 +18,7 @@ import com.google.api.codegen.util.Name; import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableListMultimap; /** Configuration of the resource name types for fields of a single message. */ @AutoValue @@ -28,14 +29,14 @@ public abstract class ResourceNameMessageConfig { // Maps the simple name of a field to the name of a resource entity (a resource entity // contains a resource URL). - abstract ImmutableMap fieldEntityMap(); + abstract ImmutableListMultimap fieldEntityMap(); static ResourceNameMessageConfig createResourceNameMessageConfig( ResourceNameMessageConfigProto messageResourceTypesProto, String defaultPackage) { String messageName = messageResourceTypesProto.getMessageName(); String fullyQualifiedMessageName = getFullyQualifiedMessageName(defaultPackage, messageName); - ImmutableMap fieldEntityMap = - ImmutableMap.copyOf(messageResourceTypesProto.getFieldEntityMap()); + ImmutableListMultimap fieldEntityMap = + ImmutableListMultimap.copyOf(messageResourceTypesProto.getFieldEntityMap().entrySet()); return new AutoValue_ResourceNameMessageConfig(fullyQualifiedMessageName, fieldEntityMap); } @@ -59,6 +60,7 @@ static Name entityNameToName(String original) { } String getEntityNameForField(String fieldSimpleName) { - return fieldEntityMap().get(fieldSimpleName); + List entityNames = fieldEntityMap().get(fieldSimpleName); + return entityNames.get(0); } } diff --git a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java index 7badd16d86..2ed7f8f01a 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java +++ b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java @@ -32,6 +32,7 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ListMultimap; +import com.google.common.collect.ImmutableListMultiMap; import java.util.*; /** Configuration of the resource name types for all message field. */ @@ -54,12 +55,12 @@ static ResourceNameMessageConfigs createFromAnnotations( Map resourceNameConfigs, ProtoParser parser, Map descriptorConfigMap, - Map childParentResourceMap) { + Map> childParentResourceMap) { ImmutableMap.Builder builder = ImmutableMap.builder(); for (ProtoFile protoFile : protoFiles) { for (MessageType message : protoFile.getMessages()) { - ImmutableMap.Builder fieldEntityMapBuilder = ImmutableMap.builder(); + ImmutableListMultimap.Builder fieldEntityMapBuilder = ImmutableListMultimap.builder(); // Handle resource definitions. ResourceDescriptor resourceDescriptor = parser.getResourceDescriptor(message); @@ -72,7 +73,7 @@ static ResourceNameMessageConfigs createFromAnnotations( loadFieldEntityPairFromResourceReferenceAnnotation( fieldEntityMapBuilder, parser, message, resourceNameConfigs, childParentResourceMap); - ImmutableMap fieldEntityMap = fieldEntityMapBuilder.build(); + ImmutableListMultimap fieldEntityMap = fieldEntityMapBuilder.build(); if (fieldEntityMap.size() > 0) { ResourceNameMessageConfig messageConfig = new AutoValue_ResourceNameMessageConfig(message.getFullName(), fieldEntityMap); @@ -89,7 +90,7 @@ static ResourceNameMessageConfigs createFromAnnotations( * to fieldEntityMap. */ private static void loadFieldEntityPairFromResourceAnnotation( - ImmutableMap.Builder fieldEntityMap, + ImmutableListMultimap.Builder fieldEntityMap, ResourceDescriptor resourceDescriptor, MessageType message) { String resourceFieldName = resourceDescriptor.getNameField(); @@ -110,11 +111,11 @@ private static void loadFieldEntityPairFromResourceAnnotation( * annotations and put them to fieldEntityMap. */ private static void loadFieldEntityPairFromResourceReferenceAnnotation( - ImmutableMap.Builder fieldEntityMap, + ImmutableListMultimap.Builder fieldEntityMap, ProtoParser parser, MessageType message, Map resourceNameConfigs, - Map childParentResourceMap) { + Map> childParentResourceMap) { for (Field field : message.getFields()) { ResourceReference reference = parser.getResourceReference(field); if (reference == null) { @@ -133,11 +134,13 @@ private static void loadFieldEntityPairFromResourceReferenceAnnotation( field); if (!childType.isEmpty()) { - ResourceNameConfig parentResource = - resourceNameConfigs.get(childParentResourceMap.get(childType).getDerivedEntityName()); - Preconditions.checkArgument( - parentResource != null, "Referencing non-existing parent resource: %s", childType); - fieldEntityMap.put(field.getSimpleName(), parentResource.getEntityId()); + for (ResourceDescriptorConfig parentResourceDescriptor : childParentResourceMap.get(childType)) { + String derivedEntityName = parentResourceDescriptor.getDerivedEntityName(); + ResourceNameConfig parentResource = resourceNameConfigs.get(derivedEntityName); + Preconditions.checkArgument( + parentResource != null, "Referencing non-existing parent resource: %s", childType); + fieldEntityMap.put(field.getSimpleName(), parentResource.getEntityId()); + } continue; } From 62be2678908bdd59ff0c321fffb4fdfa6577a272 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Fri, 17 Jan 2020 15:45:09 -0800 Subject: [PATCH 02/36] wip --- .../api/codegen/config/FieldConfig.java | 129 ++++++++++++++---- .../api/codegen/config/FlatteningConfig.java | 17 ++- .../api/codegen/config/GapicMethodConfig.java | 6 +- .../codegen/config/GapicProductConfig.java | 16 ++- .../api/codegen/config/MethodConfig.java | 2 +- .../config/ResourceDescriptorConfig.java | 21 +-- .../config/ResourceNameMessageConfig.java | 6 +- .../config/ResourceNameMessageConfigs.java | 41 +++--- .../java/JavaApiMethodTransformer.java | 10 ++ 9 files changed, 176 insertions(+), 72 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index 64d8a686a0..4d48edd55e 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -38,8 +38,6 @@ public abstract class FieldConfig { @Nullable public abstract ResourceNameConfig getResourceNameConfig(); - public abstract List getResourceNameConfigs(); - @Nullable public abstract ResourceNameConfig getMessageResourceNameConfig(); @@ -50,6 +48,8 @@ public ResourceNameType getResourceNameType() { return getResourceNameConfig().getResourceNameType(); } + public List flatResourceNameConfigs() {} + private static FieldConfig createFieldConfig( FieldModel field, ResourceNameTreatment resourceNameTreatment, @@ -78,7 +78,28 @@ static FieldConfig createMessageFieldConfig( Map resourceNameConfigs, FieldModel field, ResourceNameTreatment defaultResourceNameTreatment) { - return createFieldConfig( + List configs = + createMessageFieldConfigs( + messageConfigs, resourceNameConfigs, field, defaultResourceNameTreatment); + if (configs.size() == 1) { + return configs.get(0); + } + throw new IllegalArgumentException( + String.format( + "Field %s has multiple resource name configs: [%s], can't create a single FieldConfig object.", + configs + .stream() + .map(FieldConfig::getResourceNameConfig) + .map(ResourceNameConfig::getEntityName) + .collect(Collectors.joining(",")))); + } + + static List createMessageFieldConfigs( + ResourceNameMessageConfigs messageConfigs, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment defaultResourceNameTreatment) { + return createFieldConfigs( null, messageConfigs, null, @@ -88,31 +109,94 @@ static FieldConfig createMessageFieldConfig( defaultResourceNameTreatment); } - /** Package-private since this is not used outside the config package. */ - static FieldConfig createFieldConfig( + static List createFieldConfigs( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, - ListMultimap fieldNamePatterns, + ImmutableListMultimap fieldNamePatterns, Map resourceNameConfigs, FieldModel field, ResourceNameTreatment treatment, ResourceNameTreatment defaultResourceNameTreatment) { - String messageFieldEntityName = null; - String flattenedFieldEntityName = null; - List flattenedFieldEntityNames; + List messageFieldEntityNames = Collections.emptyList(); + List flattenedFieldEntityNames = Collections.emptyList(); if (messageConfigs != null && messageConfigs.fieldHasResourceName(field)) { - messageFieldEntityName = messageConfigs.getFieldResourceName(field); + messageFieldEntityNames = messageConfigs.getFieldResourceNames(field); } if (fieldNamePatterns != null) { flattenedFieldEntityNames = fieldNamePatterns.get(field.getNameAsParameter()); - if (flattenedFieldEntityNames != null && flattenedFieldEntityNames.size() >= 1) { - flattenedFieldEntityName = flattenedFieldEntityNames.get(0); - } } - if (flattenedFieldEntityName == null) { - flattenedFieldEntityName = messageFieldEntityName; + if (flattenedFieldEntityNames.isEmpty()) { + flattenedFieldEntityNames = messageFieldEntityNames; + } + + if (messageFieldEntityNames.size() > 1 || flattenedFieldEntityNames.size() > 1) { + return createFieldConfigsWithMultipleResourceNames( + diagCollector, + messageFieldEntityNames, + flattenedFieldEntityNames, + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment); } + String messageFieldEntityName = + messageFieldEntityNames.isEmpty() ? null : messageFieldEntityNames.get(0); + String flattenedFieldEntityName = + flattenedFieldEntityNames.isEmpty() ? null : flattenedFieldEntityNames.get(0); + return Collections.singletonList( + createFieldConfig( + diagCollector, + messageFieldEntityNames.get(0), + flattenedFieldEntityNames.get(0), + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment)); + } + + private static List createFieldConfigsWithMultipleResourceNames( + DiagCollector diagCollector, + List messageFieldEntityNames, + List flattenedFieldEntityNames, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment treatment, + ResourceNameTreatment defaultResourceNameTreatment) { + Preconditions.checkState( + new HashSet(messageFieldEntityNames) + .equals(new HashSet(flattenedFieldEntityName)), + "fields with multiple resource name configs must have exactly the same set of " + + "resource name configs as a message field and a flattened field, but got: " + + "messageFieldEntityNames: %s and flattenedFieldEntityNames: %s", + messageFieldEntityNames.stream().collect(Collectors.joining(",")), + flattenedFieldEntityNames.stream().collect(Collectors.joining(","))); + + ImmutableList.Builder fieldConfigs = ImmutableList.builder(); + for (String entityName : messageFieldEntityNames) { + fieldConfigs.add( + createFieldConfig( + diagCollector, + entityName, + entityName, + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment)); + } + return fieldConfig.build(); + } + + /** Package-private since this is not used outside the config package. */ + static FieldConfig createFieldConfig( + DiagCollector diagCollector, + @Nullable String messageFieldEntityName, + @Nullable String flattenedFieldEntityName, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment treatment, + ResourceNameTreatment defaultResourceNameTreatment) { + if (treatment == ResourceNameTreatment.UNSET_TREATMENT) { // No specific resource name treatment is specified, so we infer the correct treatment from // the method-level default and the specified entities. @@ -168,15 +252,12 @@ static FieldConfig createFieldConfig( validate(messageConfigs, field, treatment, flattenedFieldResourceNameConfig); - return createFieldConfig( - field, treatment, flattenedFieldResourceNameConfig, messageFieldResourceNameConfig); return newBuilder() - .setField(field) - .setResourceNameTreatment(resourceNameTreatment) - .setResourceNameConfig(flattenedFieldResourceNameConfig) - .setResourceNameConfigs() - .setMessageResourceNameConfig(messageFieldResourceNameConfig) - .build(); + .setField(field) + .setResourceNameTreatment(resourceNameTreatment) + .setResourceNameConfig(flattenedFieldResourceNameConfig) + .setMessageResourceNameConfig(messageFieldResourceNameConfig) + .build(); } private static ResourceNameConfig getResourceNameConfig( @@ -311,8 +392,6 @@ public static class Builder { public abstract Builder setResourceNameConfig(ResourceNameConfig val); - public abstract Builder setResourceNameConfigs(ImmutableList val); - public abstract Builder setMessageResourceNameConfig(ResourceNameConfig val); public abstract FieldConfig build(); diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 9834e1dbe6..b94156c16c 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -26,6 +26,7 @@ import com.google.auto.value.AutoValue; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import java.util.HashSet; @@ -211,7 +212,7 @@ private static FlatteningConfig createFlatteningFromConfigProto( FieldConfig.createFieldConfig( diagCollector, messageConfigs, - methodConfigProto.getFieldNamePatternsMap(), + ImmutableListMultimap.copyOf(methodConfigProto.getFieldNamePatternsMap().entrySet()), resourceNameConfigs, parameterField, flatteningGroup @@ -284,7 +285,7 @@ private static FlatteningConfig createFlatteningFromProtoFile( ? ResourceNameTreatment.STATIC_TYPES : ResourceNameTreatment.NONE; FieldConfig fieldConfig = - FieldConfig.createMessageFieldConfig( + FieldConfig.createMessageFieldConfigs( messageConfigs, resourceNameConfigs, parameterField, resourceNameTreatment); flattenedFieldConfigBuilder.put(parameter, fieldConfig); } @@ -306,6 +307,18 @@ public FlatteningConfig withResourceNamesInSamplesOnly() { return new AutoValue_FlatteningConfig(newFlattenedFieldConfigs); } + public FlatteningConfig withResourceNamesInSamplesOnlyForField(String fieldName) { + HashMap newFlatteningFieldConfigs = new HashMap<>(); + newFlatteningFieldConfigs.putAll(getFlattenedFieldConfigs); + newFlatteningFieldConfigs.put( + fieldName, newFlatteningFieldConfigs.get(fieldName).withResourceNameInSampleOnly()); + return new AutoValue_FlatteningConfig(ImmutableMap.copyOf(newFlatteningFieldConfigs)); + } + + public List flatResourceNameConfigs() { + ImmutableList configs = ImmutableList.builder(); + } + public static boolean hasAnyRepeatedResourceNameParameter(FlatteningConfig flatteningGroup) { // Used in Java to prevent generating a flattened method with List as a parameter // because that has the same type erasure as the version of the flattened method with diff --git a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java index da14f7c8f9..556393a8ef 100644 --- a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java @@ -39,8 +39,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.util.ArrayList; import java.util.List; @@ -388,9 +388,9 @@ private static void getFieldNamePatterns( } if (messageConfigs.fieldHasResourceName(messageType.getFullName(), field.getSimpleName())) { - resultCollector.put( + resultCollector.putAll( fieldNameKey, - messageConfigs.getFieldResourceName(messageType.getFullName(), field.getSimpleName())); + messageConfigs.getFieldResourceNames(messageType.getFullName(), field.getSimpleName())); } } } diff --git a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java index 50ea3267e0..d65b84034c 100644 --- a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java @@ -1081,6 +1081,9 @@ private static ImmutableMap createResponseFieldConfigMap( } Map map = new HashMap<>(); for (FieldModel field : messageConfig.getFieldsWithResourceNamesByMessage().values()) { + List fieldConfigs = + FieldConfig.createMessageFieldConfig( + messageConfig, resourceNameConfigs, field, ResourceNameTreatment.STATIC_TYPES); map.put( field.getFullName(), FieldConfig.createMessageFieldConfig( @@ -1132,14 +1135,15 @@ private static Map getResourceNameConfigsFromAnnotat } if (typesWithChildReferences.contains(unifiedResourceType)) { - List parentResources = childParentResourceMap.get(unifiedResourceType); + List parentResources = + childParentResourceMap.get(unifiedResourceType); for (ResourceDescriptorConfig parentResource : parentResources) { Map resources = - parentResource.buildResourceNameConfigs( - diagCollector, - singleResourceNameConfigsFromGapicConfig, - deprecatedPatternResourceMap, - language); + parentResource.buildResourceNameConfigs( + diagCollector, + singleResourceNameConfigsFromGapicConfig, + deprecatedPatternResourceMap, + language); annotationResourceNameConfigs.putAll(resources); } } diff --git a/src/main/java/com/google/api/codegen/config/MethodConfig.java b/src/main/java/com/google/api/codegen/config/MethodConfig.java index 019dca0ebe..9e5d08e8fc 100644 --- a/src/main/java/com/google/api/codegen/config/MethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/MethodConfig.java @@ -22,8 +22,8 @@ import com.google.api.tools.framework.model.DiagCollector; import com.google.api.tools.framework.model.SimpleLocation; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; import java.util.List; import javax.annotation.Nullable; import org.threeten.bp.Duration; diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index c7a5079693..da2dfc5296 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -168,9 +168,8 @@ Map buildResourceNameConfigs( /** * Returns a map from unified resource types to parent resources. * - *

We consider the list of resources to be another resource Bar's parents if - * the union of all patterns in the list have one-to-one parent-child mapping with - * Bar's patterns. + *

We consider the list of resources to be another resource Bar's parents if the union of all + * patterns in the list have one-to-one parent-child mapping with Bar's patterns. * *

Package private for use in GapicProductConfig. */ @@ -199,13 +198,15 @@ private static List getParentResourceDescriptor( .flatMap(Set::stream) .collect(Collectors.toList()); - ImmutableList parentResources = ImmutableList.Builder<>(); - - Map matchedParentPatterns = childResource.getPatterns() - .stream() - .map(ResourceDescriptorConfig::getParentPattern) - .distinct() - .collect(Collectors.toMap(p -> p, p -> false)); + ImmutableList.Builder parentResources = ImmutableList.builder(); + + Map matchedParentPatterns = + childResource + .getPatterns() + .stream() + .map(ResourceDescriptorConfig::getParentPattern) + .distinct() + .collect(Collectors.toMap(p -> p, p -> false)); int unmatchedPatternsCount = matchedParentPatterns.size(); for (ResourceDescriptorConfig resource : resources) { diff --git a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java index 03ffcdf986..387af014c7 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java @@ -17,7 +17,6 @@ import com.google.api.codegen.ResourceNameMessageConfigProto; import com.google.api.codegen.util.Name; import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableListMultimap; /** Configuration of the resource name types for fields of a single message. */ @@ -59,8 +58,7 @@ static Name entityNameToName(String original) { } } - String getEntityNameForField(String fieldSimpleName) { - List entityNames = fieldEntityMap().get(fieldSimpleName); - return entityNames.get(0); + List getEntityNamesForField(String fieldSimpleName) { + return fieldEntityMap().get(fieldSimpleName); } } diff --git a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java index 2ed7f8f01a..4cbffbba68 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java +++ b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java @@ -32,7 +32,6 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ListMultimap; -import com.google.common.collect.ImmutableListMultiMap; import java.util.*; /** Configuration of the resource name types for all message field. */ @@ -60,7 +59,8 @@ static ResourceNameMessageConfigs createFromAnnotations( for (ProtoFile protoFile : protoFiles) { for (MessageType message : protoFile.getMessages()) { - ImmutableListMultimap.Builder fieldEntityMapBuilder = ImmutableListMultimap.builder(); + ImmutableListMultimap.Builder fieldEntityMapBuilder = + ImmutableListMultimap.builder(); // Handle resource definitions. ResourceDescriptor resourceDescriptor = parser.getResourceDescriptor(message); @@ -134,7 +134,8 @@ private static void loadFieldEntityPairFromResourceReferenceAnnotation( field); if (!childType.isEmpty()) { - for (ResourceDescriptorConfig parentResourceDescriptor : childParentResourceMap.get(childType)) { + for (ResourceDescriptorConfig parentResourceDescriptor : + childParentResourceMap.get(childType)) { String derivedEntityName = parentResourceDescriptor.getDerivedEntityName(); ResourceNameConfig parentResource = resourceNameConfigs.get(derivedEntityName); Preconditions.checkArgument( @@ -187,7 +188,7 @@ private static ListMultimap createFieldsByMessage( continue; } for (Field field : msg.getFields()) { - if (messageConfig.getEntityNameForField(field.getSimpleName()) != null) { + if (!messageConfig.getEntityNamesForField(field.getSimpleName()).isEmpty()) { fieldsByMessage.put(msg.getFullName(), new ProtoField(field)); } } @@ -225,7 +226,7 @@ static ResourceNameMessageConfigs createMessageResourceTypesConfig( continue; } for (Schema property : method.parameters().values()) { - if (messageConfig.getEntityNameForField(property.getIdentifier()) != null) { + if (!messageConfig.getEntityNamesForField(property.getIdentifier()).isEmpty()) { fieldsByMessage.put(fullName, DiscoveryField.create(property, model)); } } @@ -242,31 +243,29 @@ boolean fieldHasResourceName(FieldModel field) { } public boolean fieldHasResourceName(String messageFullName, String fieldSimpleName) { - return getResourceNameOrNullForField(messageFullName, fieldSimpleName) != null; + return !getResourceNamesForField(messageFullName, fieldSimpleName).isEmpty(); } - String getFieldResourceName(FieldModel field) { - return getFieldResourceName(field.getParentFullName(), field.getSimpleName()); + String getFieldResourceNames(FieldModel field) { + return getFieldResourceNames(field.getParentFullName(), field.getSimpleName()); } - public String getFieldResourceName(String messageSimpleName, String fieldSimpleName) { - if (!fieldHasResourceName(messageSimpleName, fieldSimpleName)) { - throw new IllegalArgumentException( - "Field " - + fieldSimpleName - + " of message " - + messageSimpleName - + " does not have a resource name."); - } - return getResourceNameOrNullForField(messageSimpleName, fieldSimpleName); + public List getFieldResourceNames(String messageSimpleName, String fieldSimpleName) { + List resourceNames = getResourceNamesForField(messageSimpleName, fieldSimpleName); + Preconditions.checkArgument( + !resourceNames.isEmpty(), + "Field %s of message %s does not have a resource name.", + fieldSimpleName, + messageSimpleName); + return resourceNames; } - private String getResourceNameOrNullForField(String messageSimpleName, String fieldSimpleName) { + private List getResourceNamesForField(String messageSimpleName, String fieldSimpleName) { ResourceNameMessageConfig messageResourceTypeConfig = getResourceTypeConfigMap().get(messageSimpleName); if (messageResourceTypeConfig == null) { - return null; + return Collections.emptyList(); } - return messageResourceTypeConfig.getEntityNameForField(fieldSimpleName); + return messageResourceTypeConfig.getEntityNamesForField(fieldSimpleName); } } diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java index 8075078cc8..74f87d42f8 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java @@ -116,9 +116,19 @@ private List generateUnaryMethods( for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { MethodContext flattenedMethodContext = interfaceContext.asFlattenedMethodContext(methodContext, flatteningGroup); + + if (flatteningGroup.hasMultipleFieldsWithMultipleResourceNames()) { + // error + } + + if (flatteningGroup.hasOneSingularFieldWithMultipleResourceNames()) { + // flats out + } + if (FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { flattenedMethodContext = flattenedMethodContext.withResourceNamesInSamplesOnly(); } + apiMethods.add( generateFlattenedMethod( flattenedMethodContext.withCallingForms( From 657650f4b74ea74fd250d0ef0104a9866c3309e5 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Fri, 17 Jan 2020 17:29:45 -0800 Subject: [PATCH 03/36] wip --- .../api/codegen/config/FlatteningConfig.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index b94156c16c..2696217324 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -99,7 +99,7 @@ static ImmutableList createFlatteningConfigs( ProtoMethodModel methodModel, ProtoParser protoParser) { - ImmutableMap.Builder flatteningConfigs = ImmutableMap.builder(); + ImmutableListMultimap.Builder flatteningConfigs = ImmutableListMultimap.builder(); insertFlatteningsFromGapicConfig( diagCollector, @@ -132,21 +132,23 @@ private static void insertFlatteningConfigsFromProtoFile( ImmutableMap resourceNameConfigs, ProtoMethodModel methodModel, ProtoParser protoParser, - ImmutableMap.Builder flatteningConfigs) { + ImmutableListMultimap.Builder flatteningConfigs) { // Get flattenings from protofile annotations, let these override flattenings from GAPIC config. List> methodSignatures = protoParser.getMethodSignatures(methodModel.getProtoMethod()); for (List signature : methodSignatures) { - FlatteningConfig groupConfig = - FlatteningConfig.createFlatteningFromProtoFile( + List groupConfigs = + FlatteningConfig.createFlatteningsFromProtoFile( diagCollector, messageConfigs, resourceNameConfigs, signature, methodModel, protoParser); - if (groupConfig != null) { - flatteningConfigs.put(flatteningConfigToString(groupConfig), groupConfig); + if (groupConfigs != null) { + for (FlatteningConfig groupConfig : groupConfigs) { + flatteningConfigs.put(flatteningConfigToString(groupConfig), groupConfig); + } } } } @@ -237,15 +239,13 @@ private static FlatteningConfig createFlatteningFromConfigProto( * provided method. */ @Nullable - private static FlatteningConfig createFlatteningFromProtoFile( + private static List createFlatteningsFromProtoFile( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, ImmutableMap resourceNameConfigs, List flattenedParams, ProtoMethodModel method, ProtoParser protoParser) { - - // TODO(andrealin): combine this method with createFlatteningFromConfigProto. ImmutableMap.Builder flattenedFieldConfigBuilder = ImmutableMap.builder(); Set oneofNames = new HashSet<>(); @@ -284,7 +284,7 @@ private static FlatteningConfig createFlatteningFromProtoFile( protoParser.hasResourceReference(parameterField.getProtoField()) ? ResourceNameTreatment.STATIC_TYPES : ResourceNameTreatment.NONE; - FieldConfig fieldConfig = + List fieldConfigs = FieldConfig.createMessageFieldConfigs( messageConfigs, resourceNameConfigs, parameterField, resourceNameTreatment); flattenedFieldConfigBuilder.put(parameter, fieldConfig); @@ -292,6 +292,10 @@ private static FlatteningConfig createFlatteningFromProtoFile( return new AutoValue_FlatteningConfig(flattenedFieldConfigBuilder.build()); } + private static collectFieldConfigs( + List> flatteningConfigs, + String flattenedParam) + public Iterable getFlattenedFields() { return FieldConfig.toFieldTypeIterable(getFlattenedFieldConfigs().values()); } From ff362c1e7329525bc754ef9340a497389f7b4464 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Wed, 22 Jan 2020 17:26:15 -0800 Subject: [PATCH 04/36] wip --- .../config/DiscoGapicMethodConfig.java | 5 +- .../config/DiscoGapicMethodContext.java | 13 + .../api/codegen/config/FieldConfig.java | 69 +- .../api/codegen/config/FlatteningConfig.java | 194 +- .../api/codegen/config/GapicMethodConfig.java | 5 +- .../codegen/config/GapicMethodContext.java | 31 + .../codegen/config/GapicProductConfig.java | 20 +- .../api/codegen/config/MethodConfig.java | 19 +- .../api/codegen/config/MethodContext.java | 8 + .../config/ResourceDescriptorConfig.java | 7 +- .../config/ResourceNameMessageConfig.java | 1 + .../config/ResourceNameMessageConfigs.java | 8 +- .../transformer/InitCodeTransformer.java | 2 +- .../StaticLangApiMethodTransformer.java | 3 +- .../transformer/TestCaseTransformer.java | 5 +- .../java/JavaApiMethodTransformer.java | 28 +- .../ResourceNameMessageConfigsTest.java | 19 +- .../codegen/gapic/GapicCodeGeneratorTest.java | 36 +- .../testdata/java_library.baseline | 20459 ++++++++++------ .../api/codegen/testsrc/common/library.proto | 51 +- 20 files changed, 13287 insertions(+), 7696 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/DiscoGapicMethodConfig.java b/src/main/java/com/google/api/codegen/config/DiscoGapicMethodConfig.java index 1101dd5638..98f68de0cb 100644 --- a/src/main/java/com/google/api/codegen/config/DiscoGapicMethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/DiscoGapicMethodConfig.java @@ -33,6 +33,7 @@ import com.google.api.tools.framework.model.SimpleLocation; import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; @@ -141,8 +142,8 @@ static DiscoGapicMethodConfig createDiscoGapicMethodConfig( error = true; } - ImmutableMap fieldNamePatterns = - ImmutableMap.copyOf(methodConfigProto.getFieldNamePatterns()); + ImmutableListMultimap fieldNamePatterns = + ImmutableListMultimap.copyOf(methodConfigProto.getFieldNamePatterns().entrySet()); ResourceNameTreatment defaultResourceNameTreatment = methodConfigProto.getResourceNameTreatment(); diff --git a/src/main/java/com/google/api/codegen/config/DiscoGapicMethodContext.java b/src/main/java/com/google/api/codegen/config/DiscoGapicMethodContext.java index 05acd23be7..ef36454faf 100644 --- a/src/main/java/com/google/api/codegen/config/DiscoGapicMethodContext.java +++ b/src/main/java/com/google/api/codegen/config/DiscoGapicMethodContext.java @@ -19,8 +19,11 @@ import com.google.api.codegen.transformer.SurfaceNamer; import com.google.api.codegen.viewmodel.CallingForm; import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableMap; +import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Map; /** The context for transforming a method to a view model object. */ @AutoValue @@ -147,4 +150,14 @@ public List getCallingForms() { public MethodContext withCallingForms(List callingForms) { return this; } + + @Override + public ImmutableMap getFieldResourceEntityMap() { + ImmutableMap.Builder fieldResourceEntityMap = ImmutableMap.builder(); + for (Map.Entry> entry : + getMethodConfig().getFieldNamePatterns().asMap().entrySet()) { + fieldResourceEntityMap.put(entry.getKey(), ((List) entry.getValue()).get(0)); + } + return fieldResourceEntityMap.build(); + } } diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index 4d48edd55e..76fc6cf0ee 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -20,9 +20,15 @@ import com.google.api.tools.framework.model.Field; import com.google.api.tools.framework.model.SimpleLocation; import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.stream.Collectors; import javax.annotation.Nullable; @@ -48,8 +54,6 @@ public ResourceNameType getResourceNameType() { return getResourceNameConfig().getResourceNameType(); } - public List flatResourceNameConfigs() {} - private static FieldConfig createFieldConfig( FieldModel field, ResourceNameTreatment resourceNameTreatment, @@ -64,8 +68,12 @@ private static FieldConfig createFieldConfig( throw new IllegalArgumentException( "FieldConfig may not contain a ResourceNameConfig of type " + ResourceNameType.FIXED); } - return new AutoValue_FieldConfig( - field, resourceNameTreatment, resourceNameConfig, messageResourceNameConfig); + return FieldConfig.newBuilder() + .setField(field) + .setResourceNameTreatment(resourceNameTreatment) + .setResourceNameConfig(resourceNameConfig) + .setMessageResourceNameConfig(messageResourceNameConfig) + .build(); } /** Creates a FieldConfig for the given Field with ResourceNameTreatment set to None. */ @@ -87,10 +95,11 @@ static FieldConfig createMessageFieldConfig( throw new IllegalArgumentException( String.format( "Field %s has multiple resource name configs: [%s], can't create a single FieldConfig object.", + field.getFullName(), configs .stream() .map(FieldConfig::getResourceNameConfig) - .map(ResourceNameConfig::getEntityName) + .map(ResourceNameConfig::getEntityId) .collect(Collectors.joining(",")))); } @@ -134,6 +143,7 @@ static List createFieldConfigs( diagCollector, messageFieldEntityNames, flattenedFieldEntityNames, + messageConfigs, resourceNameConfigs, field, treatment, @@ -147,8 +157,9 @@ static List createFieldConfigs( return Collections.singletonList( createFieldConfig( diagCollector, - messageFieldEntityNames.get(0), - flattenedFieldEntityNames.get(0), + messageFieldEntityName, + flattenedFieldEntityName, + messageConfigs, resourceNameConfigs, field, treatment, @@ -159,19 +170,34 @@ private static List createFieldConfigsWithMultipleResourceNames( DiagCollector diagCollector, List messageFieldEntityNames, List flattenedFieldEntityNames, + ResourceNameMessageConfigs messageConfigs, Map resourceNameConfigs, FieldModel field, ResourceNameTreatment treatment, ResourceNameTreatment defaultResourceNameTreatment) { Preconditions.checkState( new HashSet(messageFieldEntityNames) - .equals(new HashSet(flattenedFieldEntityName)), + .equals(new HashSet(flattenedFieldEntityNames)), "fields with multiple resource name configs must have exactly the same set of " + "resource name configs as a message field and a flattened field, but got: " + "messageFieldEntityNames: %s and flattenedFieldEntityNames: %s", messageFieldEntityNames.stream().collect(Collectors.joining(",")), flattenedFieldEntityNames.stream().collect(Collectors.joining(","))); + if (field.isRepeated()) { + FieldConfig fieldConfig = + createFieldConfig( + diagCollector, + messageFieldEntityNames.get(0), + messageFieldEntityNames.get(0), + messageConfigs, + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment); + fieldConfig.useResourceNameTypeInSampleOnly(); + return Collections.singletonList(fieldConfig); + } ImmutableList.Builder fieldConfigs = ImmutableList.builder(); for (String entityName : messageFieldEntityNames) { fieldConfigs.add( @@ -179,12 +205,13 @@ private static List createFieldConfigsWithMultipleResourceNames( diagCollector, entityName, entityName, + messageConfigs, resourceNameConfigs, field, treatment, defaultResourceNameTreatment)); } - return fieldConfig.build(); + return fieldConfigs.build(); } /** Package-private since this is not used outside the config package. */ @@ -192,6 +219,7 @@ static FieldConfig createFieldConfig( DiagCollector diagCollector, @Nullable String messageFieldEntityName, @Nullable String flattenedFieldEntityName, + ResourceNameMessageConfigs messageConfigs, Map resourceNameConfigs, FieldModel field, ResourceNameTreatment treatment, @@ -254,7 +282,7 @@ static FieldConfig createFieldConfig( return newBuilder() .setField(field) - .setResourceNameTreatment(resourceNameTreatment) + .setResourceNameTreatment(treatment) .setResourceNameConfig(flattenedFieldResourceNameConfig) .setMessageResourceNameConfig(messageFieldResourceNameConfig) .build(); @@ -384,7 +412,7 @@ public static ImmutableMap toFieldConfigMap( } @AutoValue.Builder - public static class Builder { + public abstract static class Builder { public abstract Builder setField(FieldModel val); @@ -398,6 +426,23 @@ public static class Builder { } public static Builder newBuilder() { - return new AutoValue_Builder().setResourceNameConfigs(ImmutableList.of()); + return new AutoValue_FieldConfig.Builder(); + } + + @Override + public String toString() { + String resourceNameEntityId = + getResourceNameConfig() == null ? "null" : getResourceNameConfig().getEntityId(); + String msgResourceNameEntityId = + getMessageResourceNameConfig() == null + ? "null" + : getMessageResourceNameConfig().getEntityId(); + return getField().getSimpleName() + + ":" + + resourceNameEntityId + + ";" + + msgResourceNameEntityId + + ";" + + getResourceNameTreatment(); } } diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 2696217324..dc6b52c884 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -29,6 +29,8 @@ import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -52,7 +54,7 @@ private static void insertFlatteningsFromGapicConfig( ImmutableMap resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel methodModel, - ImmutableMap.Builder flatteningConfigs) { + ImmutableListMultimap.Builder flatteningConfigs) { for (FlatteningGroupProto flatteningGroup : methodConfigProto.getFlattening().getGroupsList()) { FlatteningConfig groupConfig = @@ -65,6 +67,11 @@ private static void insertFlatteningsFromGapicConfig( methodModel); if (groupConfig != null) { flatteningConfigs.put(flatteningConfigToString(groupConfig), groupConfig); + if (hasAnyResourceNameParameter(groupConfig)) { + flatteningConfigs.put( + flatteningConfigToString(groupConfig) + "2", + groupConfig.withResourceNamesInSamplesOnly()); + } } } } @@ -75,7 +82,8 @@ static ImmutableList createFlatteningConfigs( ImmutableMap resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel methodModel) { - ImmutableMap.Builder flatteningConfigs = ImmutableMap.builder(); + ImmutableListMultimap.Builder flatteningConfigs = + ImmutableListMultimap.builder(); insertFlatteningsFromGapicConfig( diagCollector, messageConfigs, @@ -99,7 +107,8 @@ static ImmutableList createFlatteningConfigs( ProtoMethodModel methodModel, ProtoParser protoParser) { - ImmutableListMultimap.Builder flatteningConfigs = ImmutableListMultimap.builder(); + ImmutableListMultimap.Builder flatteningConfigs = + ImmutableListMultimap.builder(); insertFlatteningsFromGapicConfig( diagCollector, @@ -210,8 +219,8 @@ private static FlatteningConfig createFlatteningFromConfigProto( defaultResourceNameTreatment = ResourceNameTreatment.NONE; } - FieldConfig fieldConfig = - FieldConfig.createFieldConfig( + List fieldConfigs = + FieldConfig.createFieldConfigs( diagCollector, messageConfigs, ImmutableListMultimap.copyOf(methodConfigProto.getFieldNamePatternsMap().entrySet()), @@ -221,10 +230,10 @@ private static FlatteningConfig createFlatteningFromConfigProto( .getParameterResourceNameTreatmentMap() .getOrDefault(parameter, ResourceNameTreatment.UNSET_TREATMENT), defaultResourceNameTreatment); - if (fieldConfig == null) { + if (fieldConfigs == null || fieldConfigs.isEmpty()) { missing = true; } else { - flattenedFieldConfigBuilder.put(parameter, fieldConfig); + flattenedFieldConfigBuilder.put(parameter, fieldConfigs.get(0)); } } if (missing) { @@ -235,8 +244,8 @@ private static FlatteningConfig createFlatteningFromConfigProto( } /** - * Creates an instance of FlatteningConfig based on a FlatteningGroupProto, linking it up with the - * provided method. + * Creates instances of FlatteningConfig based on the method_signature and resource name related + * proto annotations, linking it up with the provided method. */ @Nullable private static List createFlatteningsFromProtoFile( @@ -246,81 +255,135 @@ private static List createFlatteningsFromProtoFile( List flattenedParams, ProtoMethodModel method, ProtoParser protoParser) { - ImmutableMap.Builder flattenedFieldConfigBuilder = ImmutableMap.builder(); Set oneofNames = new HashSet<>(); + List> flatteningConfigs = new ArrayList<>(); for (String parameter : flattenedParams) { + List fieldConfigs = + createFieldConfigsForParameter( + diagCollector, + parameter, + messageConfigs, + resourceNameConfigs, + oneofNames, + method, + protoParser.hasResourceReference(method.getInputField(parameter).getProtoField()) + ? ResourceNameTreatment.STATIC_TYPES + : ResourceNameTreatment.NONE); + collectFieldConfigs(flatteningConfigs, fieldConfigs, parameter); + } - ProtoField parameterField = method.getInputField(parameter); - if (parameterField == null) { + // We also generate an overload that all resource names are treated as strings + if (hasAnyResourceNameParameter(flatteningConfigs)) { + flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0))); + } + + return flatteningConfigs + .stream() + .map(ImmutableMap::copyOf) + .map(map -> new AutoValue_FlatteningConfig(map)) + .collect(ImmutableList.toImmutableList()); + } + + private static void collectFieldConfigs( + List> flatteningConfigs, + List fieldConfigs, + String parameter) { + int flatteningConfigsCount = flatteningConfigs.size(); + if (flatteningConfigsCount == 0) { + for (int j = 0; j < fieldConfigs.size(); j++) { + HashMap newFlattening = new HashMap<>(); + newFlattening.put(parameter, fieldConfigs.get(j)); + flatteningConfigs.add(newFlattening); + System.out.println(j); + } + } else { + for (int i = 0; i < flatteningConfigsCount; i++) { + for (int j = 0; j < fieldConfigs.size() - 1; j++) { + HashMap newFlattening = new HashMap<>(flatteningConfigs.get(i)); + newFlattening.put(parameter, fieldConfigs.get(j)); + flatteningConfigs.add(newFlattening); + System.out.println(i); + System.out.println(j); + } + flatteningConfigs.get(i).put(parameter, fieldConfigs.get(fieldConfigs.size() - 1)); + } + } + } + + private static List createFieldConfigsForParameter( + DiagCollector diagCollector, + String parameter, + ResourceNameMessageConfigs messageConfigs, + ImmutableMap resourceNameConfigs, + Set oneofNames, + ProtoMethodModel method, + ResourceNameTreatment treatment) { + + ProtoField parameterField = method.getInputField(parameter); + if (parameterField == null) { + diagCollector.addDiag( + Diag.error( + SimpleLocation.TOPLEVEL, + "Field missing for flattening: method = %s, message type = %s, field = %s", + method.getFullName(), + method.getInputFullName(), + parameter)); + return null; + } + + Oneof oneof = parameterField.getOneof(); + if (oneof != null) { + String oneofName = oneof.getName(); + if (oneofNames.contains(oneofName)) { diagCollector.addDiag( Diag.error( SimpleLocation.TOPLEVEL, - "Field missing for flattening: method = %s, message type = %s, field = %s", + "Value from oneof already specifed for flattening:%n" + + "method = %s, message type = %s, oneof = %s", method.getFullName(), method.getInputFullName(), - parameter)); + oneofName)); return null; } + oneofNames.add(oneofName); + } - Oneof oneof = parameterField.getOneof(); - if (oneof != null) { - String oneofName = oneof.getName(); - if (oneofNames.contains(oneofName)) { - diagCollector.addDiag( - Diag.error( - SimpleLocation.TOPLEVEL, - "Value from oneof already specifed for flattening:%n" - + "method = %s, message type = %s, oneof = %s", - method.getFullName(), - method.getInputFullName(), - oneofName)); - return null; - } - oneofNames.add(oneofName); - } - - ResourceNameTreatment resourceNameTreatment = - protoParser.hasResourceReference(parameterField.getProtoField()) - ? ResourceNameTreatment.STATIC_TYPES - : ResourceNameTreatment.NONE; - List fieldConfigs = - FieldConfig.createMessageFieldConfigs( - messageConfigs, resourceNameConfigs, parameterField, resourceNameTreatment); - flattenedFieldConfigBuilder.put(parameter, fieldConfig); + List fieldConfigs = + FieldConfig.createMessageFieldConfigs( + messageConfigs, resourceNameConfigs, parameterField, treatment); + + if (fieldConfigs.isEmpty()) { + diagCollector.addDiag( + Diag.error( + SimpleLocation.TOPLEVEL, + "internal: failed to create any field config for field: %s of method: %s", + parameter, + method.getFullName())); } - return new AutoValue_FlatteningConfig(flattenedFieldConfigBuilder.build()); + return fieldConfigs; } - private static collectFieldConfigs( - List> flatteningConfigs, - String flattenedParam) - public Iterable getFlattenedFields() { return FieldConfig.toFieldTypeIterable(getFlattenedFieldConfigs().values()); } public FlatteningConfig withResourceNamesInSamplesOnly() { ImmutableMap newFlattenedFieldConfigs = - getFlattenedFieldConfigs() + withResourceNamesInSamplesOnly(getFlattenedFieldConfigs()); + return new AutoValue_FlatteningConfig(newFlattenedFieldConfigs); + } + + private static ImmutableMap withResourceNamesInSamplesOnly( + Map flatteningGroup) { + ImmutableMap newFlattenedFieldConfigs = + flatteningGroup .entrySet() .stream() .collect( ImmutableMap.toImmutableMap( Map.Entry::getKey, e -> e.getValue().withResourceNameInSampleOnly())); - return new AutoValue_FlatteningConfig(newFlattenedFieldConfigs); - } - - public FlatteningConfig withResourceNamesInSamplesOnlyForField(String fieldName) { - HashMap newFlatteningFieldConfigs = new HashMap<>(); - newFlatteningFieldConfigs.putAll(getFlattenedFieldConfigs); - newFlatteningFieldConfigs.put( - fieldName, newFlatteningFieldConfigs.get(fieldName).withResourceNameInSampleOnly()); - return new AutoValue_FlatteningConfig(ImmutableMap.copyOf(newFlatteningFieldConfigs)); - } - - public List flatResourceNameConfigs() { - ImmutableList configs = ImmutableList.builder(); + return newFlattenedFieldConfigs; } public static boolean hasAnyRepeatedResourceNameParameter(FlatteningConfig flatteningGroup) { @@ -349,10 +412,15 @@ private static String flatteningConfigToString(FlatteningConfig flatteningConfig /** Return if the flattening config contains a parameter that is a resource name. */ public static boolean hasAnyResourceNameParameter(FlatteningConfig flatteningGroup) { - return flatteningGroup - .getFlattenedFieldConfigs() - .values() - .stream() - .anyMatch(FieldConfig::useResourceNameType); + return hasAnyResourceNameParameter(flatteningGroup.getFlattenedFieldConfigs()); + } + + private static boolean hasAnyResourceNameParameter( + List> flatteningGroups) { + return flatteningGroups.stream().anyMatch(FlatteningConfig::hasAnyResourceNameParameter); + } + + private static boolean hasAnyResourceNameParameter(Map flatteningGroup) { + return flatteningGroup.values().stream().anyMatch(FieldConfig::useResourceNameType); } } diff --git a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java index 556393a8ef..507ed8f048 100644 --- a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java @@ -192,7 +192,8 @@ static GapicMethodConfig createGapicMethodConfigFromProto( int previousErrors = diagCollector.getErrorCount(); ProtoMethodModel methodModel = new ProtoMethodModel(method); - ImmutableMap fieldNamePatterns = getFieldNamePatterns(method, messageConfigs); + ImmutableListMultimap fieldNamePatterns = + getFieldNamePatterns(method, messageConfigs); List requiredFields = protoParser.getRequiredFields(method); ResourceNameTreatment defaultResourceNameTreatment = ResourceNameTreatment.UNSET_TREATMENT; @@ -425,7 +426,7 @@ public abstract static class Builder { public abstract Builder setBatching(@Nullable BatchingConfig val); - public abstract Builder setFieldNamePatterns(ImmutableMultimap val); + public abstract Builder setFieldNamePatterns(ImmutableListMultimap val); public abstract Builder setSampleCodeInitFields(List val); diff --git a/src/main/java/com/google/api/codegen/config/GapicMethodContext.java b/src/main/java/com/google/api/codegen/config/GapicMethodContext.java index 6649d682d8..714b8f35d2 100644 --- a/src/main/java/com/google/api/codegen/config/GapicMethodContext.java +++ b/src/main/java/com/google/api/codegen/config/GapicMethodContext.java @@ -21,8 +21,11 @@ import com.google.api.tools.framework.model.Interface; import com.google.api.tools.framework.model.Method; import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableMap; +import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Map; /** The context for transforming a method to a view model object. */ @AutoValue @@ -159,4 +162,32 @@ public MethodContext withCallingForms(List callingForms) { new ProtoInterfaceModel(getInterfaceModel().getInterface()), callingForms); } + + public ImmutableMap getFieldResourceEntityMap() { + ImmutableMap.Builder fieldResourceEntityMap = ImmutableMap.builder(); + if (isFlattenedMethodContext()) { + for (Map.Entry entry : + getFlatteningConfig().getFlattenedFieldConfigs().entrySet()) { + FieldConfig fieldConfig = entry.getValue(); + ResourceNameConfig resourceConfig = fieldConfig.getResourceNameConfig(); + if (resourceConfig != null) { + fieldResourceEntityMap.put(entry.getKey(), resourceConfig.getEntityId()); + } + } + return fieldResourceEntityMap.build(); + } + + // For non-flattening methods, resource name configs are only used to generate + // samples, so we can always use the first resource name config for this purpose. + // + // Because YAML does not support many-to-many mapping, for GAPICs generated solely + // from GAPIC YAML, fieldNamePatterns is in fact a normal map instead of a multimap, + // therefore taking only the first element from fieldNamePatterns causes no changes + // to those libraries. + for (Map.Entry> entry : + getMethodConfig().getFieldNamePatterns().asMap().entrySet()) { + fieldResourceEntityMap.put(entry.getKey(), ((List) entry.getValue()).get(0)); + } + return fieldResourceEntityMap.build(); + } } diff --git a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java index d65b84034c..41c941fd24 100644 --- a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java @@ -256,12 +256,12 @@ public static GapicProductConfig create( DeprecatedCollectionConfigProto::getNamePattern, c -> c)); // Create a pattern-to-resource map to make looking up parent resources easier. - Map> patternResourceDescriptorMap = new HashMap<>(); + Map> patternResourceDescriptorMap = new HashMap<>(); for (ResourceDescriptorConfig resourceDescriptor : descriptorConfigMap.values()) { for (String pattern : resourceDescriptor.getPatterns()) { - Set resources = patternResourceDescriptorMap.get(pattern); + List resources = patternResourceDescriptorMap.get(pattern); if (resources == null) { - resources = new HashSet<>(); + resources = new ArrayList<>(); patternResourceDescriptorMap.put(pattern, resources); } resources.add(resourceDescriptor); @@ -812,7 +812,7 @@ private static ImmutableMap createResourceNameConfig Set typesWithTypeReferences, Set typesWithChildReferences, Map deprecatedPatternResourceMap, - Map> patternResourceDescriptorMap, + Map> patternResourceDescriptorMap, Map> childParentResourceMap, String defaultPackage) { @@ -1081,13 +1081,11 @@ private static ImmutableMap createResponseFieldConfigMap( } Map map = new HashMap<>(); for (FieldModel field : messageConfig.getFieldsWithResourceNamesByMessage().values()) { - List fieldConfigs = - FieldConfig.createMessageFieldConfig( - messageConfig, resourceNameConfigs, field, ResourceNameTreatment.STATIC_TYPES); map.put( field.getFullName(), - FieldConfig.createMessageFieldConfig( - messageConfig, resourceNameConfigs, field, ResourceNameTreatment.STATIC_TYPES)); + FieldConfig.createMessageFieldConfigs( + messageConfig, resourceNameConfigs, field, ResourceNameTreatment.STATIC_TYPES) + .get(0)); } builder.putAll(map); return builder.build(); @@ -1110,7 +1108,7 @@ private static Map getResourceNameConfigsFromAnnotat Set typesWithTypeReferences, Set typesWithChildReferences, Map deprecatedPatternResourceMap, - Map> patternResourceDescriptorMap, + Map> patternResourceDescriptorMap, Map> childParentResourceMap, String defaultPackage, Map singleResourceNameConfigsFromGapicConfig) { @@ -1136,7 +1134,7 @@ private static Map getResourceNameConfigsFromAnnotat if (typesWithChildReferences.contains(unifiedResourceType)) { List parentResources = - childParentResourceMap.get(unifiedResourceType); + childParentResourceMap.getOrDefault(unifiedResourceType, Collections.emptyList()); for (ResourceDescriptorConfig parentResource : parentResources) { Map resources = parentResource.buildResourceNameConfigs( diff --git a/src/main/java/com/google/api/codegen/config/MethodConfig.java b/src/main/java/com/google/api/codegen/config/MethodConfig.java index 9e5d08e8fc..957da63078 100644 --- a/src/main/java/com/google/api/codegen/config/MethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/MethodConfig.java @@ -60,7 +60,7 @@ public abstract class MethodConfig { @Nullable public abstract BatchingConfig getBatching(); - public abstract ImmutableMap getFieldNamePatterns(); + public abstract ImmutableListMultimap getFieldNamePatterns(); public abstract List getSampleCodeInitFields(); @@ -191,14 +191,15 @@ static ImmutableList createFieldNameConfigs( ImmutableList.Builder fieldConfigsBuilder = ImmutableList.builder(); for (FieldModel field : fields) { fieldConfigsBuilder.add( - FieldConfig.createFieldConfig( - diagCollector, - messageConfigs, - fieldNamePatterns, - resourceNameConfigs, - field, - ResourceNameTreatment.UNSET_TREATMENT, - defaultResourceNameTreatment)); + FieldConfig.createFieldConfigs( + diagCollector, + messageConfigs, + fieldNamePatterns, + resourceNameConfigs, + field, + ResourceNameTreatment.UNSET_TREATMENT, + defaultResourceNameTreatment) + .get(0)); } return fieldConfigsBuilder.build(); } diff --git a/src/main/java/com/google/api/codegen/config/MethodContext.java b/src/main/java/com/google/api/codegen/config/MethodContext.java index ee9196add4..399bf0964e 100644 --- a/src/main/java/com/google/api/codegen/config/MethodContext.java +++ b/src/main/java/com/google/api/codegen/config/MethodContext.java @@ -18,6 +18,7 @@ import com.google.api.codegen.transformer.ImportTypeTable; import com.google.api.codegen.transformer.SurfaceNamer; import com.google.api.codegen.viewmodel.CallingForm; +import com.google.common.collect.ImmutableMap; import java.util.List; import javax.annotation.Nullable; @@ -70,4 +71,11 @@ public interface MethodContext { * MethodContext. */ MethodContext withCallingForms(List callingForms); + + /** + * Returns a map from field names to unqualified resource entity names. If this is a flattening + * method context, respect resource name configs set to flattening fields rather than message + * fields. + */ + ImmutableMap getFieldResourceEntityMap(); } diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index da2dfc5296..fe9d22588d 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -28,7 +28,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.stream.Collectors; import javax.annotation.Nullable; @@ -175,8 +174,8 @@ Map buildResourceNameConfigs( */ static Map> getChildParentResourceMap( Map descriptorConfigMap, - Map> patternResourceDescriptorMap) { - ImmutableMap.Builder builder = ImmutableMap.builder(); + Map> patternResourceDescriptorMap) { + ImmutableMap.Builder> builder = ImmutableMap.builder(); for (Map.Entry entry : descriptorConfigMap.entrySet()) { List parentResource = getParentResourceDescriptor(entry.getValue(), patternResourceDescriptorMap); @@ -195,7 +194,7 @@ private static List getParentResourceDescriptor( patternResourceDescriptorMap .values() .stream() - .flatMap(Set::stream) + .flatMap(List::stream) .collect(Collectors.toList()); ImmutableList.Builder parentResources = ImmutableList.builder(); diff --git a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java index 387af014c7..e3f4b87f43 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfig.java @@ -18,6 +18,7 @@ import com.google.api.codegen.util.Name; import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableListMultimap; +import java.util.List; /** Configuration of the resource name types for fields of a single message. */ @AutoValue diff --git a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java index 4cbffbba68..123ecde2e4 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java +++ b/src/main/java/com/google/api/codegen/config/ResourceNameMessageConfigs.java @@ -30,6 +30,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ListMultimap; import java.util.*; @@ -134,8 +135,9 @@ private static void loadFieldEntityPairFromResourceReferenceAnnotation( field); if (!childType.isEmpty()) { - for (ResourceDescriptorConfig parentResourceDescriptor : - childParentResourceMap.get(childType)) { + List parents = + childParentResourceMap.getOrDefault(childType, Collections.emptyList()); + for (ResourceDescriptorConfig parentResourceDescriptor : parents) { String derivedEntityName = parentResourceDescriptor.getDerivedEntityName(); ResourceNameConfig parentResource = resourceNameConfigs.get(derivedEntityName); Preconditions.checkArgument( @@ -246,7 +248,7 @@ public boolean fieldHasResourceName(String messageFullName, String fieldSimpleNa return !getResourceNamesForField(messageFullName, fieldSimpleName).isEmpty(); } - String getFieldResourceNames(FieldModel field) { + List getFieldResourceNames(FieldModel field) { return getFieldResourceNames(field.getParentFullName(), field.getSimpleName()); } diff --git a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java index d41f9a3226..c9114e5f23 100644 --- a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java @@ -233,7 +233,7 @@ List generateRequestAssertViews( */ public static ImmutableMap createCollectionMap(MethodContext context) { ImmutableMap.Builder mapBuilder = ImmutableMap.builder(); - Map fieldNamePatterns = context.getMethodConfig().getFieldNamePatterns(); + Map fieldNamePatterns = context.getFieldResourceEntityMap(); for (Map.Entry fieldNamePattern : fieldNamePatterns.entrySet()) { SingleResourceNameConfig resourceNameConfig = context.getSingleResourceNameConfig(fieldNamePattern.getValue()); diff --git a/src/main/java/com/google/api/codegen/transformer/StaticLangApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/StaticLangApiMethodTransformer.java index 4dd56ceff8..18e6957b6c 100644 --- a/src/main/java/com/google/api/codegen/transformer/StaticLangApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/StaticLangApiMethodTransformer.java @@ -997,8 +997,7 @@ private List generatePathTemplateChecks( continue; } FieldModel field = fieldConfig.getField(); - ImmutableMap fieldNamePatterns = - context.getMethodConfig().getFieldNamePatterns(); + ImmutableMap fieldNamePatterns = context.getFieldResourceEntityMap(); String entityName = fieldNamePatterns.get(field.getSimpleName()); if (entityName != null) { SingleResourceNameConfig resourceNameConfig = diff --git a/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java b/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java index 3b97dc94bf..c376565cef 100644 --- a/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java @@ -495,6 +495,9 @@ public FlatteningConfig getSmokeTestFlatteningGroup(MethodConfig methodConfig) { .stream() .findFirst() .orElseThrow( - () -> new IllegalArgumentException("No available flattening for smoke test to use.")); + () -> + new IllegalArgumentException( + "No available flattening for smoke test to use: " + + methodConfig.getMethodModel().getFullName())); } } diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java index 74f87d42f8..8745b3ad85 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java @@ -117,32 +117,20 @@ private List generateUnaryMethods( MethodContext flattenedMethodContext = interfaceContext.asFlattenedMethodContext(methodContext, flatteningGroup); - if (flatteningGroup.hasMultipleFieldsWithMultipleResourceNames()) { - // error - } - - if (flatteningGroup.hasOneSingularFieldWithMultipleResourceNames()) { - // flats out - } - - if (FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { - flattenedMethodContext = flattenedMethodContext.withResourceNamesInSamplesOnly(); - } - apiMethods.add( generateFlattenedMethod( flattenedMethodContext.withCallingForms( Collections.singletonList(CallingForm.Flattened)), sampleContext)); - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - apiMethods.add( - generateFlattenedMethod( - flattenedMethodContext - .withResourceNamesInSamplesOnly() - .withCallingForms(Collections.singletonList(CallingForm.Flattened)), - sampleContext)); - } + // if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { + // apiMethods.add( + // generateFlattenedMethod( + // flattenedMethodContext + // .withResourceNamesInSamplesOnly() + // .withCallingForms(Collections.singletonList(CallingForm.Flattened)), + // sampleContext)); + // } } } apiMethods.add( diff --git a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java index f2edb75c5f..715375da1b 100644 --- a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java +++ b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java @@ -52,7 +52,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Set; import java.util.stream.Collectors; import org.junit.BeforeClass; import org.junit.Test; @@ -129,14 +128,14 @@ public class ResourceNameMessageConfigsTest { "library.googleapis.com/ArchivedBook", ARCHIVED_BOOK_RESOURCE_DESCRIPTOR_CONFIG); - private static final Map> patternResourceDescriptorMap = + private static final Map> patternResourceDescriptorMap = ImmutableMap.of( PROTO_SHELF_PATH, - ImmutableSet.of(SHELF_RESOURCE_DESCRIPTOR_CONFIG), + ImmutableList.of(SHELF_RESOURCE_DESCRIPTOR_CONFIG), PROTO_BOOK_PATH, - ImmutableSet.of(BOOK_RESOURCE_DESCRIPTOR_CONFIG), + ImmutableList.of(BOOK_RESOURCE_DESCRIPTOR_CONFIG), PROTO_ARCHIVED_BOOK_PATH, - ImmutableSet.of(ARCHIVED_BOOK_RESOURCE_DESCRIPTOR_CONFIG)); + ImmutableList.of(ARCHIVED_BOOK_RESOURCE_DESCRIPTOR_CONFIG)); @BeforeClass public static void startUp() { @@ -259,6 +258,7 @@ public void testCreateResourceNamesWithProtoFilesOnly() { Collections.emptyMap()); assertThat(messageConfigs.getResourceTypeConfigMap().size()).isEqualTo(2); + System.out.println(messageConfigs.getResourceTypeConfigMap()); ResourceNameMessageConfig bookMessageConfig = messageConfigs.getResourceTypeConfigMap().get("library.Book"); assertThat(bookMessageConfig.fieldEntityMap().get("name")).isEqualTo("Book"); @@ -302,17 +302,19 @@ public void testCreateResourceNamesWithConfigOnly() { ResourceNameMessageConfig bookResource = messageConfigs.getResourceTypeConfigMap().get("library.Book"); - assertThat(bookResource.getEntityNameForField("name")).isEqualTo("book"); + assertThat(bookResource.getEntityNamesForField("name").get(0)).isEqualTo("book"); ResourceNameMessageConfig getShelfRequestObject = messageConfigs.getResourceTypeConfigMap().get("library.BookFromAnywhere"); - assertThat(getShelfRequestObject.getEntityNameForField("name")).isEqualTo("book_oneof"); + assertThat(getShelfRequestObject.getEntityNamesForField("name").get(0)).isEqualTo("book_oneof"); ResourceNameMessageConfig shelfResource = messageConfigs.getResourceTypeConfigMap().get("library.Shelf"); - assertThat(shelfResource.getEntityNameForField("name")).isEqualTo("shelf"); + assertThat(shelfResource.getEntityNamesForField("name").get(0)).isEqualTo("shelf"); } + public void testCreateResourceNameMessageConfigForFieldWithMultipleResourceNames() {} + @Test public void testCreateResourceNameConfigs() { DiagCollector diagCollector = new BoundedDiagCollector(); @@ -454,6 +456,7 @@ public void testCreateFlattenings() { .collect(Collectors.toList()); assertThat(flatteningConfigs).isNotNull(); + System.out.println(flatteningConfigs); assertThat(flatteningConfigs.size()).isEqualTo(3); // Check the flattening from the Gapic config. diff --git a/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java b/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java index 7692dc4a81..b6b2cfd63a 100644 --- a/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java +++ b/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java @@ -224,25 +224,25 @@ public static List testedConfigs() { null, sampleConfigFileNames(), "nodejs_samplegen_config_migration_library.baseline", - new String[] {"another_service"}), - GapicTestBase2.createTestConfig( - TargetLanguage.CSHARP, - new String[] {"library_gapic.yaml"}, - "library_pkg2.yaml", - "library", - null, - "another_service"), - GapicTestBase2.createTestConfig( - TargetLanguage.CSHARP, - new String[] {"samplegen_config_migration_library_gapic.yaml"}, - "library_pkg2.yaml", - "library", - null, - null, - null, - sampleConfigFileNames(), - "csharp_samplegen_config_migration_library.baseline", new String[] {"another_service"})); + // GapicTestBase2.createTestConfig( + // TargetLanguage.CSHARP, + // new String[] {"library_gapic.yaml"}, + // "library_pkg2.yaml", + // "library", + // null, + // "another_service"), + // GapicTestBase2.createTestConfig( + // TargetLanguage.CSHARP, + // new String[] {"samplegen_config_migration_library_gapic.yaml"}, + // "library_pkg2.yaml", + // "library", + // null, + // null, + // null, + // sampleConfigFileNames(), + // "csharp_samplegen_config_migration_library.baseline", + // new String[] {"another_service"})); } @Test diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 20d0adb43f..2b2e87c434 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -209,10 +209,10 @@ public class Babbage { package com.google.example.examples.library.v1; import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWithResponseHandling { // [START sample] @@ -220,10 +220,10 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.ApiStreamObserver; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ /** Test response handling for methods that return empty */ @@ -250,7 +250,7 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith ApiStreamObserver requestObserver = libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -290,10 +290,10 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith package com.google.example.examples.library.v1; import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWithoutResponseHandling { // [START sample] @@ -301,10 +301,10 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.ApiStreamObserver; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ /** Test default response handling is turned off for methods that return empty */ @@ -328,7 +328,7 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith ApiStreamObserver requestObserver = libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -715,7 +715,7 @@ import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; +import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -729,7 +729,7 @@ public class FindRelatedBooksCallableCallableListOdyssey { * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; + * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -738,12 +738,12 @@ public class FindRelatedBooksCallableCallableListOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName namesElement = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - List names = Arrays.asList(namesElement); + String namesElement = "Odyssey"; + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(BookName.toStringList(names)) + .addAllNames(PublisherName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); while (true) { @@ -820,7 +820,7 @@ public class FindRelatedBooksFlattenedPagedOdyssey { List names = Arrays.asList(namesElement); String shelvesElement = "Classics"; List shelves = Arrays.asList(shelvesElement); - ApiFuture future = libraryClient.findRelatedBooks().futureCall(formattedNames, formattedShelves); + ApiFuture future = libraryClient.findRelatedBooks().futureCall(names, formattedShelves); // Do something @@ -867,7 +867,7 @@ import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; +import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -882,7 +882,7 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; + * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -891,12 +891,12 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName namesElement = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - List names = Arrays.asList(namesElement); + String namesElement = "Odyssey"; + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(BookName.toStringList(names)) + .addAllNames(PublisherName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); ApiFuture future = libraryClient.findRelatedBooksPagedCallable().futureCall(request); @@ -944,7 +944,7 @@ package com.google.example.examples.library.v1; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; +import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -957,7 +957,7 @@ public class FindRelatedBooksRequestPagedOdyssey { * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; + * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -966,12 +966,12 @@ public class FindRelatedBooksRequestPagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName namesElement = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - List names = Arrays.asList(namesElement); + String namesElement = "Odyssey"; + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(BookName.toStringList(names)) + .addAllNames(PublisherName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); for (BookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) { @@ -1018,10 +1018,10 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -1032,10 +1032,10 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -1049,7 +1049,7 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); OperationFuture future = libraryClient.getBigBookAsync(name.toString()); System.out.println("Waiting for operation to complete..."); @@ -1124,10 +1124,10 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class GetBigBookAsyncLongRunningFlattenedAsyncWap2 { // [START hopper] @@ -1136,10 +1136,10 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap2 { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBigBook() { @@ -1158,7 +1158,7 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); OperationFuture future = libraryClient.getBigBookAsync(name.toString()); System.out.println("Waiting for operation to complete..."); @@ -1222,11 +1222,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -1237,11 +1237,11 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -1255,7 +1255,7 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1333,11 +1333,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class GetBigBookAsyncLongRunningRequestAsyncWap2 { // [START hopper] @@ -1346,11 +1346,11 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap2 { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBigBook() { @@ -1369,7 +1369,7 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1435,10 +1435,10 @@ import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.core.ApiFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; import com.google.protobuf.ListValue; import java.util.Map; @@ -1449,10 +1449,10 @@ public class GetBigBookCallableCallableWap { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; * import com.google.protobuf.ListValue; * import java.util.Map; @@ -1467,7 +1467,7 @@ public class GetBigBookCallableCallableWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1545,10 +1545,10 @@ import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.core.ApiFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; public class GetBigBookCallableCallableWap2 { @@ -1557,10 +1557,10 @@ public class GetBigBookCallableCallableWap2 { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; */ @@ -1580,7 +1580,7 @@ public class GetBigBookCallableCallableWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1648,11 +1648,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -1663,11 +1663,11 @@ public class GetBigBookOperationCallableLongRunningCallableWap { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -1681,7 +1681,7 @@ public class GetBigBookOperationCallableLongRunningCallableWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1760,11 +1760,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class GetBigBookOperationCallableLongRunningCallableWap2 { // [START hopper] @@ -1773,11 +1773,11 @@ public class GetBigBookOperationCallableLongRunningCallableWap2 { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBigBook() { @@ -1796,7 +1796,7 @@ public class GetBigBookOperationCallableLongRunningCallableWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1859,10 +1859,10 @@ public class GetBigBookOperationCallableLongRunningCallableWap2 { package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithResponseHandling { @@ -1871,17 +1871,17 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithRes * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); OperationFuture future = libraryClient.getBigNothingAsync(name.toString()); System.out.println("Waiting for operation to complete..."); @@ -1923,10 +1923,10 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithRes package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithoutResponseHandling { @@ -1935,17 +1935,17 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithout * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); OperationFuture future = libraryClient.getBigNothingAsync(name.toString()); System.out.println("Waiting for operation to complete..."); @@ -1985,11 +1985,11 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithout package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithResponseHandling { @@ -1998,18 +1998,18 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithRespo * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2054,11 +2054,11 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithRespo package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithoutResponseHandling { @@ -2067,18 +2067,18 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithoutRe * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2121,10 +2121,10 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithoutRe package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; public class GetBigNothingCallableCallableEmptyResponseTypeWithResponseHandling { @@ -2133,17 +2133,17 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithResponseHandling * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2189,10 +2189,10 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithResponseHandling package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; public class GetBigNothingCallableCallableEmptyResponseTypeWithoutResponseHandling { @@ -2201,17 +2201,17 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithoutResponseHandli * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2255,11 +2255,11 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithoutResponseHandli package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeWithResponseHandling { @@ -2268,18 +2268,18 @@ public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeW * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2325,11 +2325,11 @@ public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeW package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeWithoutResponseHandling { @@ -2338,18 +2338,18 @@ public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeW * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2396,10 +2396,10 @@ package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class GetBookCallableCallableTestOnSuccessMap { // [START sample] @@ -2408,15 +2408,15 @@ public class GetBookCallableCallableTestOnSuccessMap { * * import com.google.api.core.ApiFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBook() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2466,9 +2466,9 @@ public class GetBookCallableCallableTestOnSuccessMap { package com.google.example.examples.library.v1; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class GetBookFlattenedTestOnSuccessMap { // [START sample] @@ -2476,14 +2476,14 @@ public class GetBookFlattenedTestOnSuccessMap { * Please include the following imports to run this sample. * * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBook() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); Book response = libraryClient.getBook(name.toString()); String intKeyVal = response.getMapStringValueMap().get(123); String booleanKeyVal = response.getMapBoolKeyMap().get(true); @@ -2526,10 +2526,10 @@ public class GetBookFlattenedTestOnSuccessMap { package com.google.example.examples.library.v1; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class GetBookRequestTestOnSuccessMap { // [START sample] @@ -2537,15 +2537,15 @@ public class GetBookRequestTestOnSuccessMap { * Please include the following imports to run this sample. * * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBook() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2590,11 +2590,11 @@ public class GetBookRequestTestOnSuccessMap { package com.google.example.examples.library.v1; import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.Comment; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class MonologAboutBookCallableCallableStreamingClientProg { // [START sample] @@ -2602,11 +2602,11 @@ public class MonologAboutBookCallableCallableStreamingClientProg { * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.ApiStreamObserver; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.Comment; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ /** Testing calling forms */ @@ -2632,7 +2632,7 @@ public class MonologAboutBookCallableCallableStreamingClientProg { ApiStreamObserver requestObserver = libraryClient.monologAboutBookCallable().clientStreamingCall(responseObserver); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2894,7 +2894,6 @@ import org.apache.commons.cli.Options; import com.google.example.library.v1.Book; import com.google.example.library.v1.LibraryClient; import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; import java.util.ArrayList; @@ -2908,7 +2907,6 @@ public class PublishSeriesFlattenedPiVersion { * import com.google.example.library.v1.Book; * import com.google.example.library.v1.LibraryClient; * import com.google.example.library.v1.PublishSeriesResponse; - * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.SeriesUuid; * import com.google.example.library.v1.Shelf; * import java.util.ArrayList; @@ -2930,16 +2928,16 @@ public class PublishSeriesFlattenedPiVersion { */ public static void samplePublishSeries(String shelfName, int edition) { try (LibraryClient libraryClient = LibraryClient.create()) { - Shelf shelf = Shelf.newBuilder() - .setName(shelfName) - .build(); List books = new ArrayList<>(); + String publisher = ""; String seriesString = "xyz3141592654"; SeriesUuid seriesUuid = SeriesUuid.newBuilder() .setSeriesString(seriesString) .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher.toString()); + Shelf shelf = Shelf.newBuilder() + .setName(shelfName) + .build(); + PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher.toString(), seriesUuid, shelf); // % % % output handling % % % % // fourScoreAndSevenYears ago // @@ -3016,7 +3014,6 @@ package com.google.example.examples.library.v1; import com.google.example.library.v1.Book; import com.google.example.library.v1.LibraryClient; import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; import java.util.ArrayList; @@ -3030,7 +3027,6 @@ public class PublishSeriesFlattenedSecondEdition { * import com.google.example.library.v1.Book; * import com.google.example.library.v1.LibraryClient; * import com.google.example.library.v1.PublishSeriesResponse; - * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.SeriesUuid; * import com.google.example.library.v1.Shelf; * import java.util.ArrayList; @@ -3040,12 +3036,12 @@ public class PublishSeriesFlattenedSecondEdition { /** Testing calling forms */ public static void samplePublishSeries() { try (LibraryClient libraryClient = LibraryClient.create()) { - Shelf shelf = Shelf.newBuilder().build(); List books = new ArrayList<>(); int edition = 2; + String publisher = ""; SeriesUuid seriesUuid = SeriesUuid.newBuilder().build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher.toString()); + Shelf shelf = Shelf.newBuilder().build(); + PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher.toString(), seriesUuid, shelf); System.out.println(response); } catch (Exception exception) { System.err.println("Failed to create the client due to: " + exception); @@ -3660,9 +3656,9 @@ import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; @@ -3693,9 +3689,9 @@ public class TestFloatAndInt64 { /* * Please include the following imports to run this sample. * + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; * import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; * import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; @@ -3738,8 +3734,8 @@ public class TestFloatAndInt64 { String requiredSingularString = ""; ByteString requiredSingularBytes = ByteString.copyFromUtf8(""); TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String requiredSingularResourceNameCommon = ""; int requiredSingularFixed32 = 0; long requiredSingularFixed64 = 0L; @@ -3913,10 +3909,10 @@ public class TestFloatAndInt64 { package com.google.example.examples.library.v1; import com.google.example.library.v1.BookFromAnywhere; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class TestResourceNameOneof { // [START test_resource_name_oneof] @@ -3924,15 +3920,15 @@ public class TestResourceNameOneof { * Please include the following imports to run this sample. * * import com.google.example.library.v1.BookFromAnywhere; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBookFromAbsolutelyAnywhere() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder() .setName(name.toString()) .build(); @@ -3972,10 +3968,10 @@ public class TestResourceNameOneof { package com.google.example.examples.library.v1; import com.google.example.library.v1.BookFromAnywhere; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; public class TestResourceNameOneof2 { // [START test_resource_name_oneof_2] @@ -3983,15 +3979,15 @@ public class TestResourceNameOneof2 { * Please include the following imports to run this sample. * * import com.google.example.library.v1.BookFromAnywhere; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBookFromAbsolutelyAnywhere() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder() .setName(name.toString()) .build(); @@ -4106,11 +4102,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -4121,11 +4117,11 @@ public class ThisTagShouldBeTheNameOfTheFile { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -4139,7 +4135,7 @@ public class ThisTagShouldBeTheNameOfTheFile { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -4216,11 +4212,11 @@ import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.rpc.BidiStream; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.Comment; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ByteString; import java.nio.file.Files; import java.nio.file.Path; @@ -4232,11 +4228,11 @@ public class TuringProgCallableStreamingBidi { * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.BidiStream; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.Comment; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ByteString; * import java.nio.file.Files; * import java.nio.file.Path; @@ -4256,7 +4252,7 @@ public class TuringProgCallableStreamingBidi { BidiStream bidiStream = libraryClient.discussBookCallable().call(); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); Path path = Paths.get("comment_file"); byte[] data = Files.readAllBytes(path); ByteString comment = ByteString.copyFrom(data); @@ -4361,7 +4357,6 @@ import com.google.protobuf.BytesValue; import com.google.protobuf.DoubleValue; import com.google.protobuf.Duration; import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; import com.google.protobuf.FloatValue; import com.google.protobuf.Int32Value; import com.google.protobuf.Int64Value; @@ -4470,9 +4465,15 @@ public class LibraryClient implements BackgroundResource { private final LibraryServiceStub stub; private final OperationsClient operationsClient; + private static final PathTemplate ARCHIVE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("archives/{archive}"); + private static final PathTemplate ARCHIVED_BOOK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("archives/{archive}/books/{book}"); + private static final PathTemplate BILLING_ACCOUNT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}"); + private static final PathTemplate SHELF_BOOK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("bookShelves/{book_shelf}/books/{book}"); @@ -4485,18 +4486,30 @@ public class LibraryClient implements BackgroundResource { private static final PathTemplate LOCATION_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private static final PathTemplate ORGANIZATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); + private static final PathTemplate PROJECT_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}"); private static final PathTemplate PROJECT_BOOK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/books/{book}"); - private static final PathTemplate PUBLISHER_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/publishers/{publisher}"); - private static final PathTemplate SHELF_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("shelves/{shelf_id}"); + /** + * Formats a string containing the fully-qualified path to represent + * a archive resource. + * + * @deprecated Use the {@link ArchiveName} class instead. + */ + @Deprecated + public static final String formatArchiveName(String archive) { + return ARCHIVE_PATH_TEMPLATE.instantiate( + "archive", archive); + } + /** * Formats a string containing the fully-qualified path to represent * a archived_book resource. @@ -4510,6 +4523,18 @@ public class LibraryClient implements BackgroundResource { "book", book); } + /** + * Formats a string containing the fully-qualified path to represent + * a billing_account resource. + * + * @deprecated Use the {@link BillingAccountName} class instead. + */ + @Deprecated + public static final String formatBillingAccountName(String billingAccount) { + return BILLING_ACCOUNT_PATH_TEMPLATE.instantiate( + "billing_account", billingAccount); + } + /** * Formats a string containing the fully-qualified path to represent * a shelf_book resource. @@ -4561,6 +4586,18 @@ public class LibraryClient implements BackgroundResource { "location", location); } + /** + * Formats a string containing the fully-qualified path to represent + * a organization resource. + * + * @deprecated Use the {@link OrganizationName} class instead. + */ + @Deprecated + public static final String formatOrganizationName(String organization) { + return ORGANIZATION_PATH_TEMPLATE.instantiate( + "organization", organization); + } + /** * Formats a string containing the fully-qualified path to represent * a project resource. @@ -4588,28 +4625,25 @@ public class LibraryClient implements BackgroundResource { /** * Formats a string containing the fully-qualified path to represent - * a publisher resource. + * a shelf resource. * - * @deprecated Use the {@link PublisherName} class instead. + * @deprecated Use the {@link ShelfName} class instead. */ @Deprecated - public static final String formatPublisherName(String project, String location, String publisher) { - return PUBLISHER_PATH_TEMPLATE.instantiate( - "project", project, - "location", location, - "publisher", publisher); + public static final String formatShelfName(String shelfId) { + return SHELF_PATH_TEMPLATE.instantiate( + "shelf_id", shelfId); } /** - * Formats a string containing the fully-qualified path to represent - * a shelf resource. + * Parses the archive from the given fully-qualified path which + * represents a archive resource. * - * @deprecated Use the {@link ShelfName} class instead. + * @deprecated Use the {@link ArchiveName} class instead. */ @Deprecated - public static final String formatShelfName(String shelfId) { - return SHELF_PATH_TEMPLATE.instantiate( - "shelf_id", shelfId); + public static final String parseArchiveFromArchiveName(String archiveName) { + return ARCHIVE_PATH_TEMPLATE.parse(archiveName).get("archive"); } /** @@ -4634,6 +4668,17 @@ public class LibraryClient implements BackgroundResource { return ARCHIVED_BOOK_PATH_TEMPLATE.parse(archivedBookName).get("book"); } + /** + * Parses the billing_account from the given fully-qualified path which + * represents a billing_account resource. + * + * @deprecated Use the {@link BillingAccountName} class instead. + */ + @Deprecated + public static final String parseBillingAccountFromBillingAccountName(String billingAccountName) { + return BILLING_ACCOUNT_PATH_TEMPLATE.parse(billingAccountName).get("billing_account"); + } + /** * Parses the book_shelf from the given fully-qualified path which * represents a shelf_book resource. @@ -4711,6 +4756,17 @@ public class LibraryClient implements BackgroundResource { return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); } + /** + * Parses the organization from the given fully-qualified path which + * represents a organization resource. + * + * @deprecated Use the {@link OrganizationName} class instead. + */ + @Deprecated + public static final String parseOrganizationFromOrganizationName(String organizationName) { + return ORGANIZATION_PATH_TEMPLATE.parse(organizationName).get("organization"); + } + /** * Parses the project from the given fully-qualified path which * represents a project resource. @@ -4744,39 +4800,6 @@ public class LibraryClient implements BackgroundResource { return PROJECT_BOOK_PATH_TEMPLATE.parse(projectBookName).get("book"); } - /** - * Parses the project from the given fully-qualified path which - * represents a publisher resource. - * - * @deprecated Use the {@link PublisherName} class instead. - */ - @Deprecated - public static final String parseProjectFromPublisherName(String publisherName) { - return PUBLISHER_PATH_TEMPLATE.parse(publisherName).get("project"); - } - - /** - * Parses the location from the given fully-qualified path which - * represents a publisher resource. - * - * @deprecated Use the {@link PublisherName} class instead. - */ - @Deprecated - public static final String parseLocationFromPublisherName(String publisherName) { - return PUBLISHER_PATH_TEMPLATE.parse(publisherName).get("location"); - } - - /** - * Parses the publisher from the given fully-qualified path which - * represents a publisher resource. - * - * @deprecated Use the {@link PublisherName} class instead. - */ - @Deprecated - public static final String parsePublisherFromPublisherName(String publisherName) { - return PUBLISHER_PATH_TEMPLATE.parse(publisherName).get("publisher"); - } - /** * Parses the shelf_id from the given fully-qualified path which * represents a shelf resource. @@ -5024,23 +5047,23 @@ public class LibraryClient implements BackgroundResource { *


    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   SomeMessage message = SomeMessage.newBuilder().build();
    *   com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build();
-   *   Shelf response = libraryClient.getShelf(name, message, stringBuilder);
+   *   SomeMessage message = SomeMessage.newBuilder().build();
+   *   Shelf response = libraryClient.getShelf(name, stringBuilder, message);
    * }
    * 
* * @param name The name of the shelf to retrieve. - * @param message Field to verify that message-type query parameter gets flattened. * @param stringBuilder + * @param message Field to verify that message-type query parameter gets flattened. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Shelf getShelf(ShelfName name, SomeMessage message, com.google.example.library.v1.StringBuilder stringBuilder) { + public final Shelf getShelf(ShelfName name, com.google.example.library.v1.StringBuilder stringBuilder, SomeMessage message) { GetShelfRequest request = GetShelfRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setMessage(message) .setStringBuilder(stringBuilder) + .setMessage(message) .build(); return getShelf(request); } @@ -5053,23 +5076,23 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   SomeMessage message = SomeMessage.newBuilder().build();
    *   com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build();
-   *   Shelf response = libraryClient.getShelf(name.toString(), message, stringBuilder);
+   *   SomeMessage message = SomeMessage.newBuilder().build();
+   *   Shelf response = libraryClient.getShelf(name.toString(), stringBuilder, message);
    * }
    * 
* * @param name The name of the shelf to retrieve. - * @param message Field to verify that message-type query parameter gets flattened. * @param stringBuilder + * @param message Field to verify that message-type query parameter gets flattened. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Shelf getShelf(String name, SomeMessage message, com.google.example.library.v1.StringBuilder stringBuilder) { + public final Shelf getShelf(String name, com.google.example.library.v1.StringBuilder stringBuilder, SomeMessage message) { GetShelfRequest request = GetShelfRequest.newBuilder() .setName(name) - .setMessage(message) .setStringBuilder(stringBuilder) + .setMessage(message) .build(); return getShelf(request); } @@ -5121,27 +5144,6 @@ public class LibraryClient implements BackgroundResource { return stub.getShelfCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists shelves. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *
-   *   for (Shelf element : libraryClient.listShelves().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListShelvesPagedResponse listShelves() { - ListShelvesRequest request = - ListShelvesRequest.newBuilder().build(); - return listShelves(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists shelves. @@ -5309,21 +5311,21 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   Shelf response = libraryClient.mergeShelves(name, otherShelfName);
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   Shelf response = libraryClient.mergeShelves(otherShelfName, name);
    * }
    * 
* - * @param name The name of the shelf we're adding books to. * @param otherShelfName The name of the shelf we're removing books from and deleting. + * @param name The name of the shelf we're adding books to. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Shelf mergeShelves(ShelfName name, ShelfName otherShelfName) { + public final Shelf mergeShelves(ShelfName otherShelfName, ShelfName name) { MergeShelvesRequest request = MergeShelvesRequest.newBuilder() - .setName(name == null ? null : name.toString()) .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) + .setName(name == null ? null : name.toString()) .build(); return mergeShelves(request); } @@ -5337,21 +5339,21 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   Shelf response = libraryClient.mergeShelves(name.toString(), otherShelfName.toString());
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   Shelf response = libraryClient.mergeShelves(otherShelfName.toString(), name.toString());
    * }
    * 
* - * @param name The name of the shelf we're adding books to. * @param otherShelfName The name of the shelf we're removing books from and deleting. + * @param name The name of the shelf we're adding books to. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Shelf mergeShelves(String name, String otherShelfName) { + public final Shelf mergeShelves(String otherShelfName, String name) { MergeShelvesRequest request = MergeShelvesRequest.newBuilder() - .setName(name) .setOtherShelfName(otherShelfName) + .setName(name) .build(); return mergeShelves(request); } @@ -5414,21 +5416,21 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   Book book = Book.newBuilder().build();
-   *   Book response = libraryClient.createBook(name, book);
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   Book response = libraryClient.createBook(book, name);
    * }
    * 
* - * @param name The name of the shelf in which the book is created. * @param book The book to create. + * @param name The name of the shelf in which the book is created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book createBook(ShelfName name, Book book) { + public final Book createBook(Book book, ShelfName name) { CreateBookRequest request = CreateBookRequest.newBuilder() - .setName(name == null ? null : name.toString()) .setBook(book) + .setName(name == null ? null : name.toString()) .build(); return createBook(request); } @@ -5440,21 +5442,21 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   Book book = Book.newBuilder().build();
-   *   Book response = libraryClient.createBook(name.toString(), book);
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   Book response = libraryClient.createBook(book, name.toString());
    * }
    * 
* - * @param name The name of the shelf in which the book is created. * @param book The book to create. + * @param name The name of the shelf in which the book is created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book createBook(String name, Book book) { + public final Book createBook(Book book, String name) { CreateBookRequest request = CreateBookRequest.newBuilder() - .setName(name) .setBook(book) + .setName(name) .build(); return createBook(request); } @@ -5513,33 +5515,33 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   Shelf shelf = Shelf.newBuilder().build();
    *   List<Book> books = new ArrayList<>();
    *   int edition = 0;
+   *   String publisher = "";
    *   String seriesString = "foobar";
    *   SeriesUuid seriesUuid = SeriesUuid.newBuilder()
    *     .setSeriesString(seriesString)
    *     .build();
-   *   PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]");
-   *   PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher);
+   *   Shelf shelf = Shelf.newBuilder().build();
+   *   PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher, seriesUuid, shelf);
    * }
    * 
* - * @param shelf The shelf in which the series is created. * @param books The books to publish in the series. * @param edition The edition of the series - * @param seriesUuid Uniquely identifies the series to the publishing house. * @param publisher The publisher of the series. + * @param seriesUuid Uniquely identifies the series to the publishing house. + * @param shelf The shelf in which the series is created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final PublishSeriesResponse publishSeries(Shelf shelf, List books, int edition, SeriesUuid seriesUuid, PublisherName publisher) { + public final PublishSeriesResponse publishSeries(List books, int edition, PublisherName publisher, SeriesUuid seriesUuid, Shelf shelf) { PublishSeriesRequest request = PublishSeriesRequest.newBuilder() - .setShelf(shelf) .addAllBooks(books) .setEdition(edition) - .setSeriesUuid(seriesUuid) .setPublisher(publisher == null ? null : publisher.toString()) + .setSeriesUuid(seriesUuid) + .setShelf(shelf) .build(); return publishSeries(request); } @@ -5551,33 +5553,33 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   Shelf shelf = Shelf.newBuilder().build();
    *   List<Book> books = new ArrayList<>();
    *   int edition = 0;
+   *   String publisher = "";
    *   String seriesString = "foobar";
    *   SeriesUuid seriesUuid = SeriesUuid.newBuilder()
    *     .setSeriesString(seriesString)
    *     .build();
-   *   PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]");
-   *   PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher.toString());
+   *   Shelf shelf = Shelf.newBuilder().build();
+   *   PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher.toString(), seriesUuid, shelf);
    * }
    * 
* - * @param shelf The shelf in which the series is created. * @param books The books to publish in the series. * @param edition The edition of the series - * @param seriesUuid Uniquely identifies the series to the publishing house. * @param publisher The publisher of the series. + * @param seriesUuid Uniquely identifies the series to the publishing house. + * @param shelf The shelf in which the series is created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final PublishSeriesResponse publishSeries(Shelf shelf, List books, int edition, SeriesUuid seriesUuid, String publisher) { + public final PublishSeriesResponse publishSeries(List books, int edition, String publisher, SeriesUuid seriesUuid, Shelf shelf) { PublishSeriesRequest request = PublishSeriesRequest.newBuilder() - .setShelf(shelf) .addAllBooks(books) .setEdition(edition) - .setSeriesUuid(seriesUuid) .setPublisher(publisher) + .setSeriesUuid(seriesUuid) + .setShelf(shelf) .build(); return publishSeries(request); } @@ -5646,7 +5648,7 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
    *   Book response = libraryClient.getBook(name);
    * }
    * 
@@ -5669,7 +5671,7 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
    *   Book response = libraryClient.getBook(name.toString());
    * }
    * 
@@ -5692,7 +5694,7 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -5714,7 +5716,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -5735,23 +5737,23 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
-   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
+   *   String name = "";
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param name The name of the shelf whose books we'd like to list. * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(ShelfName name, String filter) { + public final ListBooksPagedResponse listBooks(String filter, PublisherName name) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setName(name == null ? null : name.toString()) .setFilter(filter) + .setName(name == null ? null : name.toString()) .build(); return listBooks(request); } @@ -5763,23 +5765,23 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
-   *   for (Book element : libraryClient.listBooks(name.toString(), filter).iterateAll()) {
+   *   String name = "";
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param name The name of the shelf whose books we'd like to list. * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String name, String filter) { + public final ListBooksPagedResponse listBooks(String filter, String name) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setName(name) .setFilter(filter) + .setName(name) .build(); return listBooks(request); } @@ -5791,24 +5793,25 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
-   *   ListBooksRequest request = ListBooksRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setFilter(filter)
-   *     .build();
-   *   for (Book element : libraryClient.listBooks(request).iterateAll()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(ListBooksRequest request) { - return listBooksPagedCallable() - .call(request); + public final ListBooksPagedResponse listBooks(String filter, ProjectName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -5818,22 +5821,25 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
-   *   ListBooksRequest request = ListBooksRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setFilter(filter)
-   *     .build();
-   *   ApiFuture<ListBooksPagedResponse> future = libraryClient.listBooksPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Book element : future.get().iterateAll()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listBooksPagedCallable() { - return stub.listBooksPagedCallable(); + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -5843,1281 +5849,1224 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
-   *   ListBooksRequest request = ListBooksRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setFilter(filter)
-   *     .build();
-   *   while (true) {
-   *     ListBooksResponse response = libraryClient.listBooksCallable().call(request);
-   *     for (Book element : response.getBooksList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
    *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listBooksCallable() { - return stub.listBooksCallable(); + public final ListBooksPagedResponse listBooks(String filter, BookName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   libraryClient.deleteBook(name);
+   *   String filter = "book-filter-string";
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to delete. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteBook(BookName name) { - DeleteBookRequest request = - DeleteBookRequest.newBuilder() - .setName(name == null ? null : name.toString()) + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) .build(); - deleteBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   libraryClient.deleteBook(name.toString());
+   *   String filter = "book-filter-string";
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to delete. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteBook(String name) { - DeleteBookRequest request = - DeleteBookRequest.newBuilder() - .setName(name) + public final ListBooksPagedResponse listBooks(String filter, OrganizationName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) .build(); - deleteBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   libraryClient.deleteBook(request);
+   *   String filter = "book-filter-string";
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteBook(DeleteBookRequest request) { - deleteBookCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = libraryClient.deleteBookCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteBookCallable() { - return stub.deleteBookCallable(); + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   Book book = Book.newBuilder().build();
-   *   Book response = libraryClient.updateBook(name, book);
+   *   String filter = "book-filter-string";
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to update. - * @param book The book to update with. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(BookName name, Book book) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, BookName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name == null ? null : name.toString()) - .setBook(book) .build(); - return updateBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   Book book = Book.newBuilder().build();
-   *   Book response = libraryClient.updateBook(name.toString(), book);
+   *   String filter = "book-filter-string";
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to update. - * @param book The book to update with. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(String name, Book book) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name) - .setBook(book) .build(); - return updateBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String optionalFoo = "";
-   *   Book book = Book.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build();
-   *   Book response = libraryClient.updateBook(name, optionalFoo, book, updateMask, physicalMask);
+   *   String filter = "book-filter-string";
+   *   String name = "";
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to update. - * @param optionalFoo An optional foo. - * @param book The book to update with. - * @param updateMask A field mask to apply, rendered as an HTTP parameter. - * @param physicalMask To test Python import clash resolution. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(BookName name, String optionalFoo, Book book, FieldMask updateMask, com.google.example.library.v1.FieldMask physicalMask) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, PublisherName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name == null ? null : name.toString()) - .setOptionalFoo(optionalFoo) - .setBook(book) - .setUpdateMask(updateMask) - .setPhysicalMask(physicalMask) .build(); - return updateBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String optionalFoo = "";
-   *   Book book = Book.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build();
-   *   Book response = libraryClient.updateBook(name.toString(), optionalFoo, book, updateMask, physicalMask);
+   *   String filter = "book-filter-string";
+   *   String name = "";
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to update. - * @param optionalFoo An optional foo. - * @param book The book to update with. - * @param updateMask A field mask to apply, rendered as an HTTP parameter. - * @param physicalMask To test Python import clash resolution. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(String name, String optionalFoo, Book book, FieldMask updateMask, com.google.example.library.v1.FieldMask physicalMask) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name) - .setOptionalFoo(optionalFoo) - .setBook(book) - .setUpdateMask(updateMask) - .setPhysicalMask(physicalMask) .build(); - return updateBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   Book book = Book.newBuilder().build();
-   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setBook(book)
-   *     .build();
-   *   Book response = libraryClient.updateBook(request);
+   *   String filter = "book-filter-string";
+   *   FolderName name = FolderName.of("[FOLDER]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(UpdateBookRequest request) { - return updateBookCallable().call(request); + public final ListBooksPagedResponse listBooks(String filter, FolderName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   Book book = Book.newBuilder().build();
-   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setBook(book)
-   *     .build();
-   *   ApiFuture<Book> future = libraryClient.updateBookCallable().futureCall(request);
-   *   // Do something
-   *   Book response = future.get();
+   *   String filter = "book-filter-string";
+   *   FolderName name = FolderName.of("[FOLDER]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable updateBookCallable() { - return stub.updateBookCallable(); + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   Book response = libraryClient.moveBook(name, otherShelfName);
+   *   String filter = "book-filter-string";
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to move. - * @param otherShelfName The name of the destination shelf. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book moveBook(BookName name, ShelfName otherShelfName) { - MoveBookRequest request = - MoveBookRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, BookName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name == null ? null : name.toString()) - .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) .build(); - return moveBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   Book response = libraryClient.moveBook(name.toString(), otherShelfName.toString());
+   *   String filter = "book-filter-string";
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to move. - * @param otherShelfName The name of the destination shelf. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book moveBook(String name, String otherShelfName) { - MoveBookRequest request = - MoveBookRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name) - .setOtherShelfName(otherShelfName) .build(); - return moveBook(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   MoveBookRequest request = MoveBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setOtherShelfName(otherShelfName.toString())
-   *     .build();
-   *   Book response = libraryClient.moveBook(request);
+   *   String filter = "book-filter-string";
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book moveBook(MoveBookRequest request) { - return moveBookCallable().call(request); + public final ListBooksPagedResponse listBooks(String filter, ArchivedBookName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   MoveBookRequest request = MoveBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setOtherShelfName(otherShelfName.toString())
-   *     .build();
-   *   ApiFuture<Book> future = libraryClient.moveBookCallable().futureCall(request);
-   *   // Do something
-   *   Book response = future.get();
+   *   String filter = "book-filter-string";
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable moveBookCallable() { - return stub.moveBookCallable(); + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *
-   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
+   *   String filter = "book-filter-string";
+   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings() { - ListStringsRequest request = - ListStringsRequest.newBuilder().build(); - return listStrings(request); + public final ListBooksPagedResponse listBooks(String filter, ArchiveName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
+   *   String filter = "book-filter-string";
+   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param name + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings(ResourceName name) { - ListStringsRequest request = - ListStringsRequest.newBuilder() - .setName(name == null ? null : name.toString()) + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) .build(); - return listStrings(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
+   *   String filter = "book-filter-string";
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param name + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings(String name) { - ListStringsRequest request = - ListStringsRequest.newBuilder() - .setName(name) + public final ListBooksPagedResponse listBooks(String filter, ShelfName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) .build(); - return listStrings(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
-   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
+   *   String filter = "book-filter-string";
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings(ListStringsRequest request) { - return listStringsPagedCallable() - .call(request); + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
-   *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
+   *   String filter = "book-filter-string";
+   *   BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listStringsPagedCallable() { - return stub.listStringsPagedCallable(); + public final ListBooksPagedResponse listBooks(String filter, BillingAccountName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
-   *   while (true) {
-   *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
-   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
+   *   String filter = "book-filter-string";
+   *   BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
    *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listStringsCallable() { - return stub.listStringsCallable(); + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
-   *   libraryClient.addComments(name, comments);
+   *   String filter = "book-filter-string";
+   *   String name = "";
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name - * @param comments + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void addComments(BookName name, List comments) { - AddCommentsRequest request = - AddCommentsRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, PublisherName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name == null ? null : name.toString()) - .addAllComments(comments) .build(); - addComments(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
-   *   libraryClient.addComments(name.toString(), comments);
+   *   String filter = "book-filter-string";
+   *   String name = "";
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name - * @param comments + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void addComments(String name, List comments) { - AddCommentsRequest request = - AddCommentsRequest.newBuilder() + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) .setName(name) - .addAllComments(comments) .build(); - addComments(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
-   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .addAllComments(comments)
-   *     .build();
-   *   libraryClient.addComments(request);
+   *   String filter = "book-filter-string";
+   *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void addComments(AddCommentsRequest request) { - addCommentsCallable().call(request); + public final ListBooksPagedResponse listBooks(String filter, LocationName name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name == null ? null : name.toString()) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
-   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .addAllComments(comments)
-   *     .build();
-   *   ApiFuture<Void> future = libraryClient.addCommentsCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   String filter = "book-filter-string";
+   *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable addCommentsCallable() { - return stub.addCommentsCallable(); + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) + .build(); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   String filter = "book-filter-string";
+   *   String name = "";
+   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to retrieve. - * @param parent + * @param filter To test python built-in wrapping. + * @param name The name of the shelf whose books we'd like to list. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ProjectName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) + public final ListBooksPagedResponse listBooks(String filter, String name) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setFilter(filter) + .setName(name) .build(); - return getBookFromArchive(request); + return listBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name.toString(), parent.toString());
+   *   String name = "";
+   *   String filter = "book-filter-string";
+   *   ListBooksRequest request = ListBooksRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setFilter(filter)
+   *     .build();
+   *   for (Book element : libraryClient.listBooks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to retrieve. - * @param parent + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(String name, String parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name) - .setParent(parent) - .build(); - return getBookFromArchive(request); + public final ListBooksPagedResponse listBooks(ListBooksRequest request) { + return listBooksPagedCallable() + .call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
+   *   String name = "";
+   *   String filter = "book-filter-string";
+   *   ListBooksRequest request = ListBooksRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setParent(parent.toString())
+   *     .setFilter(filter)
    *     .build();
-   *   BookFromArchive response = libraryClient.getBookFromArchive(request);
+   *   ApiFuture<ListBooksPagedResponse> future = libraryClient.listBooksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Book element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(GetBookFromArchiveRequest request) { - return getBookFromArchiveCallable().call(request); + public final UnaryCallable listBooksPagedCallable() { + return stub.listBooksPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Lists books in a shelf. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
+   *   String name = "";
+   *   String filter = "book-filter-string";
+   *   ListBooksRequest request = ListBooksRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setParent(parent.toString())
+   *     .setFilter(filter)
    *     .build();
-   *   ApiFuture<BookFromArchive> future = libraryClient.getBookFromArchiveCallable().futureCall(request);
-   *   // Do something
-   *   BookFromArchive response = future.get();
+   *   while (true) {
+   *     ListBooksResponse response = libraryClient.listBooksCallable().call(request);
+   *     for (Book element : response.getBooksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
    * }
    * 
*/ - public final UnaryCallable getBookFromArchiveCallable() { - return stub.getBookFromArchiveCallable(); + public final UnaryCallable listBooksCallable() { + return stub.listBooksCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from a shelf or archive. + * Deletes a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName altBookName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(name, altBookName, place, folder);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.deleteBook(name);
    * }
    * 
* - * @param name The name of the book to retrieve. - * @param altBookName An alternate book name, used to test restricting flattened field to a - * single resource name type in a oneof. - * @param place - * @param folder + * @param name The name of the book to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAnywhere(BookName name, BookName altBookName, LocationName place, FolderName folder) { - GetBookFromAnywhereRequest request = - GetBookFromAnywhereRequest.newBuilder() + public final void deleteBook(BookName name) { + DeleteBookRequest request = + DeleteBookRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setAltBookName(altBookName == null ? null : altBookName.toString()) - .setPlace(place == null ? null : place.toString()) - .setFolder(folder == null ? null : folder.toString()) .build(); - return getBookFromAnywhere(request); + deleteBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from a shelf or archive. + * Deletes a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName altBookName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(name.toString(), altBookName.toString(), place.toString(), folder.toString());
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.deleteBook(name.toString());
    * }
    * 
* - * @param name The name of the book to retrieve. - * @param altBookName An alternate book name, used to test restricting flattened field to a - * single resource name type in a oneof. - * @param place - * @param folder + * @param name The name of the book to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAnywhere(String name, String altBookName, String place, String folder) { - GetBookFromAnywhereRequest request = - GetBookFromAnywhereRequest.newBuilder() + public final void deleteBook(String name) { + DeleteBookRequest request = + DeleteBookRequest.newBuilder() .setName(name) - .setAltBookName(altBookName) - .setPlace(place) - .setFolder(folder) .build(); - return getBookFromAnywhere(request); + deleteBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from a shelf or archive. + * Deletes a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName altBookName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setAltBookName(altBookName.toString())
-   *     .setPlace(place.toString())
-   *     .setFolder(folder.toString())
    *     .build();
-   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(request);
+   *   libraryClient.deleteBook(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAnywhere(GetBookFromAnywhereRequest request) { - return getBookFromAnywhereCallable().call(request); + public final void deleteBook(DeleteBookRequest request) { + deleteBookCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from a shelf or archive. + * Deletes a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName altBookName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setAltBookName(altBookName.toString())
-   *     .setPlace(place.toString())
-   *     .setFolder(folder.toString())
    *     .build();
-   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAnywhereCallable().futureCall(request);
+   *   ApiFuture<Void> future = libraryClient.deleteBookCallable().futureCall(request);
    *   // Do something
-   *   BookFromAnywhere response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable getBookFromAnywhereCallable() { - return stub.getBookFromAnywhereCallable(); + public final UnaryCallable deleteBookCallable() { + return stub.deleteBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test proper OneOf-Any resource name mapping + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name);
+   *   Book book = Book.newBuilder().build();
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.updateBook(book, name);
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param book The book to update with. + * @param name The name of the book to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAbsolutelyAnywhere(BookName name) { - GetBookFromAbsolutelyAnywhereRequest request = - GetBookFromAbsolutelyAnywhereRequest.newBuilder() + public final Book updateBook(Book book, BookName name) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setBook(book) .setName(name == null ? null : name.toString()) .build(); - return getBookFromAbsolutelyAnywhere(request); + return updateBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test proper OneOf-Any resource name mapping + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name.toString());
+   *   Book book = Book.newBuilder().build();
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.updateBook(book, name.toString());
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param book The book to update with. + * @param name The name of the book to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAbsolutelyAnywhere(String name) { - GetBookFromAbsolutelyAnywhereRequest request = - GetBookFromAbsolutelyAnywhereRequest.newBuilder() + public final Book updateBook(Book book, String name) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setBook(book) .setName(name) .build(); - return getBookFromAbsolutelyAnywhere(request); + return updateBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test proper OneOf-Any resource name mapping + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(request);
+   *   String optionalFoo = "";
+   *   Book book = Book.newBuilder().build();
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   FieldMask physicalMask = FieldMask.newBuilder().build();
+   *   com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build();
+   *   Book response = libraryClient.updateBook(optionalFoo, book, name, physicalMask, updateMask);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param optionalFoo An optional foo. + * @param book The book to update with. + * @param name The name of the book to update. + * @param physicalMask To test Python import clash resolution. + * @param updateMask A field mask to apply, rendered as an HTTP parameter. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAbsolutelyAnywhere(GetBookFromAbsolutelyAnywhereRequest request) { - return getBookFromAbsolutelyAnywhereCallable().call(request); + public final Book updateBook(String optionalFoo, Book book, BookName name, FieldMask physicalMask, com.google.protobuf.FieldMask updateMask) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setOptionalFoo(optionalFoo) + .setBook(book) + .setName(name == null ? null : name.toString()) + .setPhysicalMask(physicalMask) + .setUpdateMask(updateMask) + .build(); + return updateBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test proper OneOf-Any resource name mapping + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAbsolutelyAnywhereCallable().futureCall(request);
-   *   // Do something
-   *   BookFromAnywhere response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable getBookFromAbsolutelyAnywhereCallable() { - return stub.getBookFromAbsolutelyAnywhereCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates the index of a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String indexName = "default index";
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   libraryClient.updateBookIndex(name, indexName, indexMap);
-   * }
-   * 
- * - * @param name The name of the book to update. - * @param indexName The name of the index for the book - * @param indexMap The index to update the book with - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void updateBookIndex(BookName name, String indexName, Map indexMap) { - UpdateBookIndexRequest request = - UpdateBookIndexRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setIndexName(indexName) - .putAllIndexMap(indexMap) - .build(); - updateBookIndex(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates the index of a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String indexName = "default index";
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   libraryClient.updateBookIndex(name.toString(), indexName, indexMap);
+   *   String optionalFoo = "";
+   *   Book book = Book.newBuilder().build();
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   FieldMask physicalMask = FieldMask.newBuilder().build();
+   *   com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build();
+   *   Book response = libraryClient.updateBook(optionalFoo, book, name.toString(), physicalMask, updateMask);
    * }
    * 
* + * @param optionalFoo An optional foo. + * @param book The book to update with. * @param name The name of the book to update. - * @param indexName The name of the index for the book - * @param indexMap The index to update the book with + * @param physicalMask To test Python import clash resolution. + * @param updateMask A field mask to apply, rendered as an HTTP parameter. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void updateBookIndex(String name, String indexName, Map indexMap) { - UpdateBookIndexRequest request = - UpdateBookIndexRequest.newBuilder() + public final Book updateBook(String optionalFoo, Book book, String name, FieldMask physicalMask, com.google.protobuf.FieldMask updateMask) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setOptionalFoo(optionalFoo) + .setBook(book) .setName(name) - .setIndexName(indexName) - .putAllIndexMap(indexMap) + .setPhysicalMask(physicalMask) + .setUpdateMask(updateMask) .build(); - updateBookIndex(request); + return updateBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the index of a book. + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String indexName = "default index";
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book book = Book.newBuilder().build();
+   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setIndexName(indexName)
-   *     .putAllIndexMap(indexMap)
+   *     .setBook(book)
    *     .build();
-   *   libraryClient.updateBookIndex(request);
+   *   Book response = libraryClient.updateBook(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void updateBookIndex(UpdateBookIndexRequest request) { - updateBookIndexCallable().call(request); + public final Book updateBook(UpdateBookRequest request) { + return updateBookCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the index of a book. + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String indexName = "default index";
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book book = Book.newBuilder().build();
+   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setIndexName(indexName)
-   *     .putAllIndexMap(indexMap)
+   *     .setBook(book)
    *     .build();
-   *   ApiFuture<Void> future = libraryClient.updateBookIndexCallable().futureCall(request);
+   *   ApiFuture<Book> future = libraryClient.updateBookCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   Book response = future.get();
    * }
    * 
*/ - public final UnaryCallable updateBookIndexCallable() { - return stub.updateBookIndexCallable(); + public final UnaryCallable updateBookCallable() { + return stub.updateBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test server streaming - * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + * Moves a book to another shelf, and returns the new book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   StreamShelvesRequest request = StreamShelvesRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *
-   *   ServerStream<StreamShelvesResponse> stream = libraryClient.streamShelvesCallable().call(request);
-   *   for (StreamShelvesResponse response : stream) {
-   *     // Do something when receive a response
-   *   }
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.moveBook(otherShelfName, name);
    * }
    * 
+ * + * @param otherShelfName The name of the destination shelf. + * @param name The name of the book to move. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ServerStreamingCallable streamShelvesCallable() { - return stub.streamShelvesCallable(); + public final Book moveBook(ShelfName otherShelfName, BookName name) { + MoveBookRequest request = + MoveBookRequest.newBuilder() + .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) + .setName(name == null ? null : name.toString()) + .build(); + return moveBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test server streaming, non-paged responses. - * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + * Moves a book to another shelf, and returns the new book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String name = "";
-   *   StreamBooksRequest request = StreamBooksRequest.newBuilder()
-   *     .setName(name)
-   *     .build();
-   *
-   *   ServerStream<Book> stream = libraryClient.streamBooksCallable().call(request);
-   *   for (Book response : stream) {
-   *     // Do something when receive a response
-   *   }
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.moveBook(otherShelfName.toString(), name.toString());
    * }
    * 
+ * + * @param otherShelfName The name of the destination shelf. + * @param name The name of the book to move. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ServerStreamingCallable streamBooksCallable() { - return stub.streamBooksCallable(); + public final Book moveBook(String otherShelfName, String name) { + MoveBookRequest request = + MoveBookRequest.newBuilder() + .setOtherShelfName(otherShelfName) + .setName(name) + .build(); + return moveBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test bidi-streaming. + * Moves a book to another shelf, and returns the new book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BidiStream<DiscussBookRequest, Comment> bidiStream =
-   *       libraryClient.discussBookCallable().call();
-   *
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   MoveBookRequest request = MoveBookRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setOtherShelfName(otherShelfName.toString())
    *     .build();
-   *   bidiStream.send(request);
-   *   for (Comment response : bidiStream) {
-   *     // Do something when receive a response
-   *   }
+   *   Book response = libraryClient.moveBook(request);
    * }
    * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BidiStreamingCallable discussBookCallable() { - return stub.discussBookCallable(); + public final Book moveBook(MoveBookRequest request) { + return moveBookCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test client streaming. + * Moves a book to another shelf, and returns the new book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ApiStreamObserver<Comment> responseObserver =
-   *       new ApiStreamObserver<Comment>() {
-   *         {@literal @}Override
-   *         public void onNext(Comment response) {
-   *           // Do something when receive a response
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onError(Throwable t) {
-   *           // Add error-handling
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onCompleted() {
-   *           // Do something when complete.
-   *         }
-   *       };
-   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
-   *       libraryClient.monologAboutBookCallable().clientStreamingCall(responseObserver);
-   *
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   MoveBookRequest request = MoveBookRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setOtherShelfName(otherShelfName.toString())
    *     .build();
-   *   requestObserver.onNext(request);
+   *   ApiFuture<Book> future = libraryClient.moveBookCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
    * }
    * 
*/ - public final ClientStreamingCallable monologAboutBookCallable() { - return stub.monologAboutBookCallable(); + public final UnaryCallable moveBookCallable() { + return stub.moveBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test samplegen response handling when a client streaming method returns Empty. - * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ApiStreamObserver<Void> responseObserver =
-   *       new ApiStreamObserver<Void>() {
-   *         {@literal @}Override
-   *         public void onNext(Void response) {
-   *           // Do something when receive a response
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onError(Throwable t) {
-   *           // Add error-handling
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onCompleted() {
-   *           // Do something when complete.
-   *         }
-   *       };
-   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
-   *       libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver);
-   *
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   requestObserver.onNext(request);
+   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
+   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ClientStreamingCallable babbleAboutBookCallable() { - return stub.babbleAboutBookCallable(); + public final ListStringsPagedResponse listStrings(ResourceName name) { + ListStringsRequest request = + ListStringsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return listStrings(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String namesElement = "";
-   *   List<String> names = Arrays.asList(namesElement);
-   *   List<String> formattedShelves = new ArrayList<>();
-   *   for (BookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsBookName()) {
+   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
+   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param names - * @param shelves + * @param name * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { - FindRelatedBooksRequest request = - FindRelatedBooksRequest.newBuilder() - .addAllNames(names) - .addAllShelves(shelves) - .build(); - return findRelatedBooks(request); + public final ListStringsPagedResponse listStrings(String name) { + ListStringsRequest request = + ListStringsRequest.newBuilder() + .setName(name) + .build(); + return listStrings(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** + * Lists a primitive resource. To test go page streaming. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
+   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
* + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListStringsPagedResponse listStrings(String name) { + ListStringsRequest request = + ListStringsRequest.newBuilder() + .setName(name) + .build(); + return listStrings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName namesElement = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   List<BookName> names = Arrays.asList(namesElement);
-   *   List<ShelfName> shelves = new ArrayList<>();
-   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(BookName.toStringList(names))
-   *     .addAllShelves(ShelfName.toStringList(shelves))
-   *     .build();
-   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
+   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
+   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -7126,54 +7075,42 @@ public class LibraryClient implements BackgroundResource {
    * @param request The request object containing all of the parameters for the API call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final FindRelatedBooksPagedResponse findRelatedBooks(FindRelatedBooksRequest request) {
-    return findRelatedBooksPagedCallable()
+  public final ListStringsPagedResponse listStrings(ListStringsRequest request) {
+    return listStringsPagedCallable()
         .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   *
+   * Lists a primitive resource. To test go page streaming.
    *
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName namesElement = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   List<BookName> names = Arrays.asList(namesElement);
-   *   List<ShelfName> shelves = new ArrayList<>();
-   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(BookName.toStringList(names))
-   *     .addAllShelves(ShelfName.toStringList(shelves))
-   *     .build();
-   *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
+   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
+   *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
    *   // Do something
-   *   for (BookName element : future.get().iterateAllAsBookName()) {
+   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
*/ - public final UnaryCallable findRelatedBooksPagedCallable() { - return stub.findRelatedBooksPagedCallable(); + public final UnaryCallable listStringsPagedCallable() { + return stub.listStringsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName namesElement = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   List<BookName> names = Arrays.asList(namesElement);
-   *   List<ShelfName> shelves = new ArrayList<>();
-   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(BookName.toStringList(names))
-   *     .addAllShelves(ShelfName.toStringList(shelves))
-   *     .build();
+   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    *   while (true) {
-   *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
-   *     for (BookName element : BookName.parseList(response.getNamesList())) {
+   *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
+   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -7186,2538 +7123,6045 @@ public class LibraryClient implements BackgroundResource {
    * }
    * 
*/ - public final UnaryCallable findRelatedBooksCallable() { - return stub.findRelatedBooksCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Adds a label to the entity. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName resource = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String label = "";
-   *   AddLabelRequest request = AddLabelRequest.newBuilder()
-   *     .setResource(resource.toString())
-   *     .setLabel(label)
-   *     .build();
-   *   AddLabelResponse response = libraryClient.addLabel(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @Deprecated - /* package-private */ final AddLabelResponse addLabel(AddLabelRequest request) { - return addLabelCallable().call(request); + public final UnaryCallable listStringsCallable() { + return stub.listStringsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds a label to the entity. + * Adds comments to a book * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName resource = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String label = "";
-   *   AddLabelRequest request = AddLabelRequest.newBuilder()
-   *     .setResource(resource.toString())
-   *     .setLabel(label)
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
    *     .build();
-   *   ApiFuture<AddLabelResponse> future = libraryClient.addLabelCallable().futureCall(request);
-   *   // Do something
-   *   AddLabelResponse response = future.get();
-   * }
-   * 
- */ - @Deprecated - /* package-private */ final UnaryCallable addLabelCallable() { - return stub.addLabelCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test long-running operations - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   Book response = libraryClient.getBigBookAsync(name).get();
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.addComments(comments, name);
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param comments + * @param name * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(BookName name) { - GetBookRequest request = - GetBookRequest.newBuilder() + public final void addComments(List comments, BookName name) { + AddCommentsRequest request = + AddCommentsRequest.newBuilder() + .addAllComments(comments) .setName(name == null ? null : name.toString()) .build(); - return getBigBookAsync(request); + addComments(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * Adds comments to a book * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
+   *     .build();
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.addComments(comments, name.toString());
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param comments + * @param name * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() + public final void addComments(List comments, String name) { + AddCommentsRequest request = + AddCommentsRequest.newBuilder() + .addAllComments(comments) .setName(name) .build(); - return getBigBookAsync(request); + addComments(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * Adds comments to a book * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
+   *     .build();
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
    *     .setName(name.toString())
+   *     .addAllComments(comments)
    *     .build();
-   *   Book response = libraryClient.getBigBookAsync(request).get();
+   *   libraryClient.addComments(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(GetBookRequest request) { - return getBigBookOperationCallable().futureCall(request); + public final void addComments(AddCommentsRequest request) { + addCommentsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * Adds comments to a book * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
    *     .build();
-   *   OperationFuture<Book, GetBigBookMetadata> future = libraryClient.getBigBookOperationCallable().futureCall(request);
-   *   // Do something
-   *   Book response = future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable getBigBookOperationCallable() { - return stub.getBigBookOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test long-running operations - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
    *     .setName(name.toString())
+   *     .addAllComments(comments)
    *     .build();
-   *   ApiFuture<Operation> future = libraryClient.getBigBookCallable().futureCall(request);
+   *   ApiFuture<Void> future = libraryClient.addCommentsCallable().futureCall(request);
    *   // Do something
-   *   Operation response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable getBigBookCallable() { - return stub.getBigBookCallable(); + public final UnaryCallable addCommentsCallable() { + return stub.addCommentsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   libraryClient.getBigNothingAsync(name).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(parent, name);
    * }
    * 
* + * @param parent * @param name The name of the book to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(BookName name) { - GetBookRequest request = - GetBookRequest.newBuilder() + public final BookFromArchive getBookFromArchive(LocationName parent, ArchivedBookName name) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) .setName(name == null ? null : name.toString()) .build(); - return getBigNothingAsync(request); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   libraryClient.getBigNothingAsync(name.toString()).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(parent.toString(), name.toString());
    * }
    * 
* + * @param parent * @param name The name of the book to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() + public final BookFromArchive getBookFromArchive(String parent, String name) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setParent(parent) .setName(name) .build(); - return getBigNothingAsync(request); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   libraryClient.getBigNothingAsync(request).get();
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   String parent = "";
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(GetBookRequest request) { - return getBigNothingOperationCallable().futureCall(request); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, PublisherName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, GetBigBookMetadata> future = libraryClient.getBigNothingOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
+ * + * @param name The name of the book to retrieve. + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable getBigNothingOperationCallable() { - return stub.getBigNothingOperationCallable(); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ProjectName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = libraryClient.getBigNothingCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
+ * + * @param name The name of the book to retrieve. + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable getBigNothingCallable() { - return stub.getBigNothingCallable(); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, BookName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test optional flattening parameters of all types + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromArchive getBookFromArchive(ArchivedBookName name, OrganizationName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from an archive. * - * TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(); + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
+ * + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams() { - TestOptionalRequiredFlatteningParamsRequest request = - TestOptionalRequiredFlatteningParamsRequest.newBuilder().build(); - return testOptionalRequiredFlatteningParams(request); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, BookName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test optional flattening parameters of all types + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   int requiredSingularInt32 = 0;
-   *   long requiredSingularInt64 = 0L;
-   *   float requiredSingularFloat = 0.0F;
-   *   double requiredSingularDouble = 0.0;
-   *   boolean requiredSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String requiredSingularString = "";
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String requiredSingularResourceNameCommon = "";
-   *   int requiredSingularFixed32 = 0;
-   *   long requiredSingularFixed64 = 0L;
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
-   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   int optionalSingularInt32 = 0;
-   *   long optionalSingularInt64 = 0L;
-   *   float optionalSingularFloat = 0.0F;
-   *   double optionalSingularDouble = 0.0;
-   *   boolean optionalSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String optionalSingularString = "";
-   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName optionalSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName optionalSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String optionalSingularResourceNameCommon = "";
-   *   int optionalSingularFixed32 = 0;
-   *   long optionalSingularFixed64 = 0L;
-   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
-   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
-   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
-   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
-   *   List<String> optionalRepeatedString = new ArrayList<>();
-   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
-   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
-   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> optionalMap = new HashMap<>();
-   *   Any anyValue = Any.newBuilder().build();
-   *   Struct structValue = Struct.newBuilder().build();
-   *   Value valueValue = Value.newBuilder().build();
-   *   ListValue listValueValue = ListValue.newBuilder().build();
-   *   Timestamp timeValue = Timestamp.newBuilder().build();
-   *   Duration durationValue = Duration.newBuilder().build();
-   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value int32Value = Int32Value.newBuilder().build();
-   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value int64Value = Int64Value.newBuilder().build();
-   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue floatValue = FloatValue.newBuilder().build();
-   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
-   *   StringValue stringValue = StringValue.newBuilder().build();
-   *   BoolValue boolValue = BoolValue.newBuilder().build();
-   *   BytesValue bytesValue = BytesValue.newBuilder().build();
-   *   List<Any> repeatedAnyValue = new ArrayList<>();
-   *   List<Struct> repeatedStructValue = new ArrayList<>();
-   *   List<Value> repeatedValueValue = new ArrayList<>();
-   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
-   *   List<Duration> repeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> repeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   String parent = "";
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
* - * @param requiredSingularInt32 - * @param requiredSingularInt64 - * @param requiredSingularFloat - * @param requiredSingularDouble - * @param requiredSingularBool - * @param requiredSingularEnum - * @param requiredSingularString - * @param requiredSingularBytes - * @param requiredSingularMessage - * @param requiredSingularResourceName - * @param requiredSingularResourceNameOneof - * @param requiredSingularResourceNameCommon - * @param requiredSingularFixed32 - * @param requiredSingularFixed64 - * @param requiredRepeatedInt32 - * @param requiredRepeatedInt64 - * @param requiredRepeatedFloat - * @param requiredRepeatedDouble - * @param requiredRepeatedBool - * @param requiredRepeatedEnum - * @param requiredRepeatedString - * @param requiredRepeatedBytes - * @param requiredRepeatedMessage - * @param requiredRepeatedResourceName - * @param requiredRepeatedResourceNameOneof - * @param requiredRepeatedResourceNameCommon - * @param requiredRepeatedFixed32 - * @param requiredRepeatedFixed64 - * @param requiredMap - * @param requiredAnyValue - * @param requiredStructValue - * @param requiredValueValue - * @param requiredListValueValue - * @param requiredTimeValue - * @param requiredDurationValue - * @param requiredFieldMaskValue - * @param requiredInt32Value - * @param requiredUint32Value - * @param requiredInt64Value - * @param requiredUint64Value - * @param requiredFloatValue - * @param requiredDoubleValue - * @param requiredStringValue - * @param requiredBoolValue - * @param requiredBytesValue - * @param requiredRepeatedAnyValue - * @param requiredRepeatedStructValue - * @param requiredRepeatedValueValue - * @param requiredRepeatedListValueValue - * @param requiredRepeatedTimeValue - * @param requiredRepeatedDurationValue - * @param requiredRepeatedFieldMaskValue - * @param requiredRepeatedInt32Value - * @param requiredRepeatedUint32Value - * @param requiredRepeatedInt64Value - * @param requiredRepeatedUint64Value - * @param requiredRepeatedFloatValue - * @param requiredRepeatedDoubleValue - * @param requiredRepeatedStringValue - * @param requiredRepeatedBoolValue - * @param requiredRepeatedBytesValue - * @param optionalSingularInt32 - * @param optionalSingularInt64 - * @param optionalSingularFloat - * @param optionalSingularDouble - * @param optionalSingularBool - * @param optionalSingularEnum - * @param optionalSingularString - * @param optionalSingularBytes - * @param optionalSingularMessage - * @param optionalSingularResourceName - * @param optionalSingularResourceNameOneof - * @param optionalSingularResourceNameCommon - * @param optionalSingularFixed32 - * @param optionalSingularFixed64 - * @param optionalRepeatedInt32 - * @param optionalRepeatedInt64 - * @param optionalRepeatedFloat - * @param optionalRepeatedDouble - * @param optionalRepeatedBool - * @param optionalRepeatedEnum - * @param optionalRepeatedString - * @param optionalRepeatedBytes - * @param optionalRepeatedMessage - * @param optionalRepeatedResourceName - * @param optionalRepeatedResourceNameOneof - * @param optionalRepeatedResourceNameCommon - * @param optionalRepeatedFixed32 - * @param optionalRepeatedFixed64 - * @param optionalMap - * @param anyValue - * @param structValue - * @param valueValue - * @param listValueValue - * @param timeValue - * @param durationValue - * @param fieldMaskValue - * @param int32Value - * @param uint32Value - * @param int64Value - * @param uint64Value - * @param floatValue - * @param doubleValue - * @param stringValue - * @param boolValue - * @param bytesValue - * @param repeatedAnyValue - * @param repeatedStructValue - * @param repeatedValueValue - * @param repeatedListValueValue - * @param repeatedTimeValue - * @param repeatedDurationValue - * @param repeatedFieldMaskValue - * @param repeatedInt32Value - * @param repeatedUint32Value - * @param repeatedInt64Value - * @param repeatedUint64Value - * @param repeatedFloatValue - * @param repeatedDoubleValue - * @param repeatedStringValue - * @param repeatedBoolValue - * @param repeatedBytesValue + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, String requiredSingularResourceName, String requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String optionalSingularResourceName, String optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { - TestOptionalRequiredFlatteningParamsRequest request = - TestOptionalRequiredFlatteningParamsRequest.newBuilder() - .setRequiredSingularInt32(requiredSingularInt32) - .setRequiredSingularInt64(requiredSingularInt64) - .setRequiredSingularFloat(requiredSingularFloat) - .setRequiredSingularDouble(requiredSingularDouble) - .setRequiredSingularBool(requiredSingularBool) - .setRequiredSingularEnum(requiredSingularEnum) - .setRequiredSingularString(requiredSingularString) - .setRequiredSingularBytes(requiredSingularBytes) - .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredSingularResourceName(requiredSingularResourceName) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) - .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) - .setRequiredSingularFixed32(requiredSingularFixed32) - .setRequiredSingularFixed64(requiredSingularFixed64) - .addAllRequiredRepeatedInt32(requiredRepeatedInt32) - .addAllRequiredRepeatedInt64(requiredRepeatedInt64) - .addAllRequiredRepeatedFloat(requiredRepeatedFloat) - .addAllRequiredRepeatedDouble(requiredRepeatedDouble) - .addAllRequiredRepeatedBool(requiredRepeatedBool) - .addAllRequiredRepeatedEnum(requiredRepeatedEnum) - .addAllRequiredRepeatedString(requiredRepeatedString) - .addAllRequiredRepeatedBytes(requiredRepeatedBytes) - .addAllRequiredRepeatedMessage(requiredRepeatedMessage) - .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName) - .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof) - .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) - .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) - .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) - .putAllRequiredMap(requiredMap) - .setRequiredAnyValue(requiredAnyValue) - .setRequiredStructValue(requiredStructValue) - .setRequiredValueValue(requiredValueValue) - .setRequiredListValueValue(requiredListValueValue) - .setRequiredTimeValue(requiredTimeValue) - .setRequiredDurationValue(requiredDurationValue) - .setRequiredFieldMaskValue(requiredFieldMaskValue) - .setRequiredInt32Value(requiredInt32Value) - .setRequiredUint32Value(requiredUint32Value) - .setRequiredInt64Value(requiredInt64Value) - .setRequiredUint64Value(requiredUint64Value) - .setRequiredFloatValue(requiredFloatValue) - .setRequiredDoubleValue(requiredDoubleValue) - .setRequiredStringValue(requiredStringValue) - .setRequiredBoolValue(requiredBoolValue) - .setRequiredBytesValue(requiredBytesValue) - .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) - .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) - .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) - .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) - .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) - .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) - .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) - .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) - .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) - .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) - .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) - .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) - .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) - .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) - .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) - .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) - .setOptionalSingularInt32(optionalSingularInt32) - .setOptionalSingularInt64(optionalSingularInt64) - .setOptionalSingularFloat(optionalSingularFloat) - .setOptionalSingularDouble(optionalSingularDouble) - .setOptionalSingularBool(optionalSingularBool) - .setOptionalSingularEnum(optionalSingularEnum) - .setOptionalSingularString(optionalSingularString) - .setOptionalSingularBytes(optionalSingularBytes) - .setOptionalSingularMessage(optionalSingularMessage) - .setOptionalSingularResourceName(optionalSingularResourceName) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) - .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) - .setOptionalSingularFixed32(optionalSingularFixed32) - .setOptionalSingularFixed64(optionalSingularFixed64) - .addAllOptionalRepeatedInt32(optionalRepeatedInt32) - .addAllOptionalRepeatedInt64(optionalRepeatedInt64) - .addAllOptionalRepeatedFloat(optionalRepeatedFloat) - .addAllOptionalRepeatedDouble(optionalRepeatedDouble) - .addAllOptionalRepeatedBool(optionalRepeatedBool) - .addAllOptionalRepeatedEnum(optionalRepeatedEnum) - .addAllOptionalRepeatedString(optionalRepeatedString) - .addAllOptionalRepeatedBytes(optionalRepeatedBytes) - .addAllOptionalRepeatedMessage(optionalRepeatedMessage) - .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName) - .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof) - .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) - .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) - .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) - .putAllOptionalMap(optionalMap) - .setAnyValue(anyValue) - .setStructValue(structValue) - .setValueValue(valueValue) - .setListValueValue(listValueValue) - .setTimeValue(timeValue) - .setDurationValue(durationValue) - .setFieldMaskValue(fieldMaskValue) - .setInt32Value(int32Value) - .setUint32Value(uint32Value) - .setInt64Value(int64Value) - .setUint64Value(uint64Value) - .setFloatValue(floatValue) - .setDoubleValue(doubleValue) - .setStringValue(stringValue) - .setBoolValue(boolValue) - .setBytesValue(bytesValue) - .addAllRepeatedAnyValue(repeatedAnyValue) - .addAllRepeatedStructValue(repeatedStructValue) - .addAllRepeatedValueValue(repeatedValueValue) - .addAllRepeatedListValueValue(repeatedListValueValue) - .addAllRepeatedTimeValue(repeatedTimeValue) - .addAllRepeatedDurationValue(repeatedDurationValue) - .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) - .addAllRepeatedInt32Value(repeatedInt32Value) - .addAllRepeatedUint32Value(repeatedUint32Value) - .addAllRepeatedInt64Value(repeatedInt64Value) - .addAllRepeatedUint64Value(repeatedUint64Value) - .addAllRepeatedFloatValue(repeatedFloatValue) - .addAllRepeatedDoubleValue(repeatedDoubleValue) - .addAllRepeatedStringValue(repeatedStringValue) - .addAllRepeatedBoolValue(repeatedBoolValue) - .addAllRepeatedBytesValue(repeatedBytesValue) + public final BookFromArchive getBookFromArchive(ArchivedBookName name, PublisherName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); - return testOptionalRequiredFlatteningParams(request); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test optional flattening parameters of all types + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   int requiredSingularInt32 = 0;
-   *   long requiredSingularInt64 = 0L;
-   *   float requiredSingularFloat = 0.0F;
-   *   double requiredSingularDouble = 0.0;
-   *   boolean requiredSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String requiredSingularString = "";
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   String formattedRequiredSingularResourceName = LibraryClient.formatShelfBookName("[BOOK_SHELF]", "[BOOK]");
-   *   String formattedRequiredSingularResourceNameOneof = LibraryClient.formatShelfBookName("[BOOK_SHELF]", "[BOOK]");
-   *   String requiredSingularResourceNameCommon = "";
-   *   int requiredSingularFixed32 = 0;
-   *   long requiredSingularFixed64 = 0L;
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
-   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   int optionalSingularInt32 = 0;
-   *   long optionalSingularInt64 = 0L;
-   *   float optionalSingularFloat = 0.0F;
-   *   double optionalSingularDouble = 0.0;
-   *   boolean optionalSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String optionalSingularString = "";
-   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   String formattedOptionalSingularResourceName = LibraryClient.formatShelfBookName("[BOOK_SHELF]", "[BOOK]");
-   *   String formattedOptionalSingularResourceNameOneof = LibraryClient.formatShelfBookName("[BOOK_SHELF]", "[BOOK]");
-   *   String optionalSingularResourceNameCommon = "";
-   *   int optionalSingularFixed32 = 0;
-   *   long optionalSingularFixed64 = 0L;
-   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
-   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
-   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
-   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
-   *   List<String> optionalRepeatedString = new ArrayList<>();
-   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
-   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
-   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> optionalMap = new HashMap<>();
-   *   Any anyValue = Any.newBuilder().build();
-   *   Struct structValue = Struct.newBuilder().build();
-   *   Value valueValue = Value.newBuilder().build();
-   *   ListValue listValueValue = ListValue.newBuilder().build();
-   *   Timestamp timeValue = Timestamp.newBuilder().build();
-   *   Duration durationValue = Duration.newBuilder().build();
-   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value int32Value = Int32Value.newBuilder().build();
-   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value int64Value = Int64Value.newBuilder().build();
-   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue floatValue = FloatValue.newBuilder().build();
-   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
-   *   StringValue stringValue = StringValue.newBuilder().build();
-   *   BoolValue boolValue = BoolValue.newBuilder().build();
-   *   BytesValue bytesValue = BytesValue.newBuilder().build();
-   *   List<Any> repeatedAnyValue = new ArrayList<>();
-   *   List<Struct> repeatedStructValue = new ArrayList<>();
-   *   List<Value> repeatedValueValue = new ArrayList<>();
-   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
-   *   List<Duration> repeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> repeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, formattedRequiredSingularResourceName, formattedRequiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, formattedOptionalSingularResourceName, formattedOptionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
* - * @param requiredSingularInt32 - * @param requiredSingularInt64 - * @param requiredSingularFloat - * @param requiredSingularDouble - * @param requiredSingularBool - * @param requiredSingularEnum - * @param requiredSingularString - * @param requiredSingularBytes - * @param requiredSingularMessage - * @param requiredSingularResourceName - * @param requiredSingularResourceNameOneof - * @param requiredSingularResourceNameCommon - * @param requiredSingularFixed32 - * @param requiredSingularFixed64 - * @param requiredRepeatedInt32 - * @param requiredRepeatedInt64 - * @param requiredRepeatedFloat - * @param requiredRepeatedDouble - * @param requiredRepeatedBool - * @param requiredRepeatedEnum - * @param requiredRepeatedString - * @param requiredRepeatedBytes - * @param requiredRepeatedMessage - * @param requiredRepeatedResourceName - * @param requiredRepeatedResourceNameOneof - * @param requiredRepeatedResourceNameCommon - * @param requiredRepeatedFixed32 - * @param requiredRepeatedFixed64 - * @param requiredMap - * @param requiredAnyValue - * @param requiredStructValue - * @param requiredValueValue - * @param requiredListValueValue - * @param requiredTimeValue - * @param requiredDurationValue - * @param requiredFieldMaskValue - * @param requiredInt32Value - * @param requiredUint32Value - * @param requiredInt64Value - * @param requiredUint64Value - * @param requiredFloatValue - * @param requiredDoubleValue - * @param requiredStringValue - * @param requiredBoolValue - * @param requiredBytesValue - * @param requiredRepeatedAnyValue - * @param requiredRepeatedStructValue - * @param requiredRepeatedValueValue - * @param requiredRepeatedListValueValue - * @param requiredRepeatedTimeValue - * @param requiredRepeatedDurationValue - * @param requiredRepeatedFieldMaskValue - * @param requiredRepeatedInt32Value - * @param requiredRepeatedUint32Value - * @param requiredRepeatedInt64Value - * @param requiredRepeatedUint64Value - * @param requiredRepeatedFloatValue - * @param requiredRepeatedDoubleValue - * @param requiredRepeatedStringValue - * @param requiredRepeatedBoolValue - * @param requiredRepeatedBytesValue - * @param optionalSingularInt32 - * @param optionalSingularInt64 - * @param optionalSingularFloat - * @param optionalSingularDouble - * @param optionalSingularBool - * @param optionalSingularEnum - * @param optionalSingularString - * @param optionalSingularBytes - * @param optionalSingularMessage - * @param optionalSingularResourceName - * @param optionalSingularResourceNameOneof - * @param optionalSingularResourceNameCommon - * @param optionalSingularFixed32 - * @param optionalSingularFixed64 - * @param optionalRepeatedInt32 - * @param optionalRepeatedInt64 - * @param optionalRepeatedFloat - * @param optionalRepeatedDouble - * @param optionalRepeatedBool - * @param optionalRepeatedEnum - * @param optionalRepeatedString - * @param optionalRepeatedBytes - * @param optionalRepeatedMessage - * @param optionalRepeatedResourceName - * @param optionalRepeatedResourceNameOneof - * @param optionalRepeatedResourceNameCommon - * @param optionalRepeatedFixed32 - * @param optionalRepeatedFixed64 - * @param optionalMap - * @param anyValue - * @param structValue - * @param valueValue - * @param listValueValue - * @param timeValue - * @param durationValue - * @param fieldMaskValue - * @param int32Value - * @param uint32Value - * @param int64Value - * @param uint64Value - * @param floatValue - * @param doubleValue - * @param stringValue - * @param boolValue - * @param bytesValue - * @param repeatedAnyValue - * @param repeatedStructValue - * @param repeatedValueValue - * @param repeatedListValueValue - * @param repeatedTimeValue - * @param repeatedDurationValue - * @param repeatedFieldMaskValue - * @param repeatedInt32Value - * @param repeatedUint32Value - * @param repeatedInt64Value - * @param repeatedUint64Value - * @param repeatedFloatValue - * @param repeatedDoubleValue - * @param repeatedStringValue - * @param repeatedBoolValue - * @param repeatedBytesValue + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, String requiredSingularResourceName, String requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String optionalSingularResourceName, String optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { - TestOptionalRequiredFlatteningParamsRequest request = - TestOptionalRequiredFlatteningParamsRequest.newBuilder() - .setRequiredSingularInt32(requiredSingularInt32) - .setRequiredSingularInt64(requiredSingularInt64) - .setRequiredSingularFloat(requiredSingularFloat) - .setRequiredSingularDouble(requiredSingularDouble) - .setRequiredSingularBool(requiredSingularBool) - .setRequiredSingularEnum(requiredSingularEnum) - .setRequiredSingularString(requiredSingularString) - .setRequiredSingularBytes(requiredSingularBytes) - .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredSingularResourceName(requiredSingularResourceName) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) - .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) - .setRequiredSingularFixed32(requiredSingularFixed32) - .setRequiredSingularFixed64(requiredSingularFixed64) - .addAllRequiredRepeatedInt32(requiredRepeatedInt32) - .addAllRequiredRepeatedInt64(requiredRepeatedInt64) - .addAllRequiredRepeatedFloat(requiredRepeatedFloat) - .addAllRequiredRepeatedDouble(requiredRepeatedDouble) - .addAllRequiredRepeatedBool(requiredRepeatedBool) - .addAllRequiredRepeatedEnum(requiredRepeatedEnum) - .addAllRequiredRepeatedString(requiredRepeatedString) - .addAllRequiredRepeatedBytes(requiredRepeatedBytes) - .addAllRequiredRepeatedMessage(requiredRepeatedMessage) - .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName) - .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof) - .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) - .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) - .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) - .putAllRequiredMap(requiredMap) - .setRequiredAnyValue(requiredAnyValue) - .setRequiredStructValue(requiredStructValue) - .setRequiredValueValue(requiredValueValue) - .setRequiredListValueValue(requiredListValueValue) - .setRequiredTimeValue(requiredTimeValue) - .setRequiredDurationValue(requiredDurationValue) - .setRequiredFieldMaskValue(requiredFieldMaskValue) - .setRequiredInt32Value(requiredInt32Value) - .setRequiredUint32Value(requiredUint32Value) - .setRequiredInt64Value(requiredInt64Value) - .setRequiredUint64Value(requiredUint64Value) - .setRequiredFloatValue(requiredFloatValue) - .setRequiredDoubleValue(requiredDoubleValue) - .setRequiredStringValue(requiredStringValue) - .setRequiredBoolValue(requiredBoolValue) - .setRequiredBytesValue(requiredBytesValue) - .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) - .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) - .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) - .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) - .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) - .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) - .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) - .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) - .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) - .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) - .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) - .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) - .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) - .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) - .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) - .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) - .setOptionalSingularInt32(optionalSingularInt32) - .setOptionalSingularInt64(optionalSingularInt64) - .setOptionalSingularFloat(optionalSingularFloat) - .setOptionalSingularDouble(optionalSingularDouble) - .setOptionalSingularBool(optionalSingularBool) - .setOptionalSingularEnum(optionalSingularEnum) - .setOptionalSingularString(optionalSingularString) - .setOptionalSingularBytes(optionalSingularBytes) - .setOptionalSingularMessage(optionalSingularMessage) - .setOptionalSingularResourceName(optionalSingularResourceName) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) - .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) - .setOptionalSingularFixed32(optionalSingularFixed32) - .setOptionalSingularFixed64(optionalSingularFixed64) - .addAllOptionalRepeatedInt32(optionalRepeatedInt32) - .addAllOptionalRepeatedInt64(optionalRepeatedInt64) - .addAllOptionalRepeatedFloat(optionalRepeatedFloat) - .addAllOptionalRepeatedDouble(optionalRepeatedDouble) - .addAllOptionalRepeatedBool(optionalRepeatedBool) - .addAllOptionalRepeatedEnum(optionalRepeatedEnum) - .addAllOptionalRepeatedString(optionalRepeatedString) - .addAllOptionalRepeatedBytes(optionalRepeatedBytes) - .addAllOptionalRepeatedMessage(optionalRepeatedMessage) - .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName) - .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof) - .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) - .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) - .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) - .putAllOptionalMap(optionalMap) - .setAnyValue(anyValue) - .setStructValue(structValue) - .setValueValue(valueValue) - .setListValueValue(listValueValue) - .setTimeValue(timeValue) - .setDurationValue(durationValue) - .setFieldMaskValue(fieldMaskValue) - .setInt32Value(int32Value) - .setUint32Value(uint32Value) - .setInt64Value(int64Value) - .setUint64Value(uint64Value) - .setFloatValue(floatValue) - .setDoubleValue(doubleValue) - .setStringValue(stringValue) - .setBoolValue(boolValue) - .setBytesValue(bytesValue) - .addAllRepeatedAnyValue(repeatedAnyValue) - .addAllRepeatedStructValue(repeatedStructValue) - .addAllRepeatedValueValue(repeatedValueValue) - .addAllRepeatedListValueValue(repeatedListValueValue) - .addAllRepeatedTimeValue(repeatedTimeValue) - .addAllRepeatedDurationValue(repeatedDurationValue) - .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) - .addAllRepeatedInt32Value(repeatedInt32Value) - .addAllRepeatedUint32Value(repeatedUint32Value) - .addAllRepeatedInt64Value(repeatedInt64Value) - .addAllRepeatedUint64Value(repeatedUint64Value) - .addAllRepeatedFloatValue(repeatedFloatValue) - .addAllRepeatedDoubleValue(repeatedDoubleValue) - .addAllRepeatedStringValue(repeatedStringValue) - .addAllRepeatedBoolValue(repeatedBoolValue) - .addAllRepeatedBytesValue(repeatedBytesValue) + public final BookFromArchive getBookFromArchive(ArchivedBookName name, FolderName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); - return testOptionalRequiredFlatteningParams(request); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test optional flattening parameters of all types + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   int requiredSingularInt32 = 0;
-   *   long requiredSingularInt64 = 0L;
-   *   float requiredSingularFloat = 0.0F;
-   *   double requiredSingularDouble = 0.0;
-   *   boolean requiredSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String requiredSingularString = "";
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String requiredSingularResourceNameCommon = "";
-   *   int requiredSingularFixed32 = 0;
-   *   long requiredSingularFixed64 = 0L;
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceName = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder()
-   *     .setRequiredSingularInt32(requiredSingularInt32)
-   *     .setRequiredSingularInt64(requiredSingularInt64)
-   *     .setRequiredSingularFloat(requiredSingularFloat)
-   *     .setRequiredSingularDouble(requiredSingularDouble)
-   *     .setRequiredSingularBool(requiredSingularBool)
-   *     .setRequiredSingularEnum(requiredSingularEnum)
-   *     .setRequiredSingularString(requiredSingularString)
-   *     .setRequiredSingularBytes(requiredSingularBytes)
-   *     .setRequiredSingularMessage(requiredSingularMessage)
-   *     .setRequiredSingularResourceName(requiredSingularResourceName.toString())
-   *     .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString())
-   *     .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon)
-   *     .setRequiredSingularFixed32(requiredSingularFixed32)
-   *     .setRequiredSingularFixed64(requiredSingularFixed64)
-   *     .addAllRequiredRepeatedInt32(requiredRepeatedInt32)
-   *     .addAllRequiredRepeatedInt64(requiredRepeatedInt64)
-   *     .addAllRequiredRepeatedFloat(requiredRepeatedFloat)
-   *     .addAllRequiredRepeatedDouble(requiredRepeatedDouble)
-   *     .addAllRequiredRepeatedBool(requiredRepeatedBool)
-   *     .addAllRequiredRepeatedEnum(requiredRepeatedEnum)
-   *     .addAllRequiredRepeatedString(requiredRepeatedString)
-   *     .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
-   *     .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
-   *     .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName))
-   *     .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof))
-   *     .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
-   *     .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
-   *     .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
-   *     .putAllRequiredMap(requiredMap)
-   *     .setRequiredAnyValue(requiredAnyValue)
-   *     .setRequiredStructValue(requiredStructValue)
-   *     .setRequiredValueValue(requiredValueValue)
-   *     .setRequiredListValueValue(requiredListValueValue)
-   *     .setRequiredTimeValue(requiredTimeValue)
-   *     .setRequiredDurationValue(requiredDurationValue)
-   *     .setRequiredFieldMaskValue(requiredFieldMaskValue)
-   *     .setRequiredInt32Value(requiredInt32Value)
-   *     .setRequiredUint32Value(requiredUint32Value)
-   *     .setRequiredInt64Value(requiredInt64Value)
-   *     .setRequiredUint64Value(requiredUint64Value)
-   *     .setRequiredFloatValue(requiredFloatValue)
-   *     .setRequiredDoubleValue(requiredDoubleValue)
-   *     .setRequiredStringValue(requiredStringValue)
-   *     .setRequiredBoolValue(requiredBoolValue)
-   *     .setRequiredBytesValue(requiredBytesValue)
-   *     .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue)
-   *     .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue)
-   *     .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue)
-   *     .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue)
-   *     .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue)
-   *     .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue)
-   *     .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue)
-   *     .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value)
-   *     .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value)
-   *     .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value)
-   *     .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value)
-   *     .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue)
-   *     .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue)
-   *     .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue)
-   *     .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue)
-   *     .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue)
-   *     .build();
-   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(request);
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest request) { - return testOptionalRequiredFlatteningParamsCallable().call(request); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, BookName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test optional flattening parameters of all types + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   int requiredSingularInt32 = 0;
-   *   long requiredSingularInt64 = 0L;
-   *   float requiredSingularFloat = 0.0F;
-   *   double requiredSingularDouble = 0.0;
-   *   boolean requiredSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String requiredSingularString = "";
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]");
-   *   String requiredSingularResourceNameCommon = "";
-   *   int requiredSingularFixed32 = 0;
-   *   long requiredSingularFixed64 = 0L;
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceName = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder()
-   *     .setRequiredSingularInt32(requiredSingularInt32)
-   *     .setRequiredSingularInt64(requiredSingularInt64)
-   *     .setRequiredSingularFloat(requiredSingularFloat)
-   *     .setRequiredSingularDouble(requiredSingularDouble)
-   *     .setRequiredSingularBool(requiredSingularBool)
-   *     .setRequiredSingularEnum(requiredSingularEnum)
-   *     .setRequiredSingularString(requiredSingularString)
-   *     .setRequiredSingularBytes(requiredSingularBytes)
-   *     .setRequiredSingularMessage(requiredSingularMessage)
-   *     .setRequiredSingularResourceName(requiredSingularResourceName.toString())
-   *     .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString())
-   *     .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon)
-   *     .setRequiredSingularFixed32(requiredSingularFixed32)
-   *     .setRequiredSingularFixed64(requiredSingularFixed64)
-   *     .addAllRequiredRepeatedInt32(requiredRepeatedInt32)
-   *     .addAllRequiredRepeatedInt64(requiredRepeatedInt64)
-   *     .addAllRequiredRepeatedFloat(requiredRepeatedFloat)
-   *     .addAllRequiredRepeatedDouble(requiredRepeatedDouble)
-   *     .addAllRequiredRepeatedBool(requiredRepeatedBool)
-   *     .addAllRequiredRepeatedEnum(requiredRepeatedEnum)
-   *     .addAllRequiredRepeatedString(requiredRepeatedString)
-   *     .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
-   *     .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
-   *     .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName))
-   *     .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof))
-   *     .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
-   *     .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
-   *     .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
-   *     .putAllRequiredMap(requiredMap)
-   *     .setRequiredAnyValue(requiredAnyValue)
-   *     .setRequiredStructValue(requiredStructValue)
-   *     .setRequiredValueValue(requiredValueValue)
-   *     .setRequiredListValueValue(requiredListValueValue)
-   *     .setRequiredTimeValue(requiredTimeValue)
-   *     .setRequiredDurationValue(requiredDurationValue)
-   *     .setRequiredFieldMaskValue(requiredFieldMaskValue)
-   *     .setRequiredInt32Value(requiredInt32Value)
-   *     .setRequiredUint32Value(requiredUint32Value)
-   *     .setRequiredInt64Value(requiredInt64Value)
-   *     .setRequiredUint64Value(requiredUint64Value)
-   *     .setRequiredFloatValue(requiredFloatValue)
-   *     .setRequiredDoubleValue(requiredDoubleValue)
-   *     .setRequiredStringValue(requiredStringValue)
-   *     .setRequiredBoolValue(requiredBoolValue)
-   *     .setRequiredBytesValue(requiredBytesValue)
-   *     .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue)
-   *     .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue)
-   *     .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue)
-   *     .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue)
-   *     .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue)
-   *     .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue)
-   *     .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue)
-   *     .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value)
-   *     .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value)
-   *     .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value)
-   *     .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value)
-   *     .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue)
-   *     .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue)
-   *     .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue)
-   *     .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue)
-   *     .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue)
-   *     .build();
-   *   ApiFuture<TestOptionalRequiredFlatteningParamsResponse> future = libraryClient.testOptionalRequiredFlatteningParamsCallable().futureCall(request);
-   *   // Do something
-   *   TestOptionalRequiredFlatteningParamsResponse response = future.get();
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
+ * + * @param name The name of the book to retrieve. + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable testOptionalRequiredFlatteningParamsCallable() { - return stub.testOptionalRequiredFlatteningParamsCallable(); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchivedBookName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * This method is not exposed in the GAPIC config. It should be generated. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *
-   *   Book response = libraryClient.privateListShelves();
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ArchiveName parent = ArchiveName.of("[ARCHIVE]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
+ * + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book privateListShelves() { - ListShelvesRequest request = - ListShelvesRequest.newBuilder().build(); - return privateListShelves(request); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchiveName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * This method is not exposed in the GAPIC config. It should be generated. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
-   *   Book response = libraryClient.privateListShelves(request);
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ShelfName parent = ShelfName.of("[SHELF_ID]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book privateListShelves(ListShelvesRequest request) { - return privateListShelvesCallable().call(request); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ShelfName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * This method is not exposed in the GAPIC config. It should be generated. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
-   *   ApiFuture<Book> future = libraryClient.privateListShelvesCallable().futureCall(request);
-   *   // Do something
-   *   Book response = future.get();
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
+ * + * @param name The name of the book to retrieve. + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable privateListShelvesCallable() { - return stub.privateListShelvesCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); + public final BookFromArchive getBookFromArchive(ArchivedBookName name, BillingAccountName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } - @Override - public boolean isTerminated() { - return stub.isTerminated(); + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from an archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   String parent = "";
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromArchive getBookFromArchive(ArchivedBookName name, PublisherName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) + .build(); + return getBookFromArchive(request); } - @Override - public void shutdownNow() { - stub.shutdownNow(); + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from an archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   String parent = "";
+   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setParent(parent.toString())
+   *     .build();
+   *   BookFromArchive response = libraryClient.getBookFromArchive(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromArchive getBookFromArchive(GetBookFromArchiveRequest request) { + return getBookFromArchiveCallable().call(request); } - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from an archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   String parent = "";
+   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<BookFromArchive> future = libraryClient.getBookFromArchiveCallable().futureCall(request);
+   *   // Do something
+   *   BookFromArchive response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getBookFromArchiveCallable() { + return stub.getBookFromArchiveCallable(); } - public static class ListShelvesPagedResponse extends AbstractPagedListResponse< - ListShelvesRequest, - ListShelvesResponse, - Shelf, - ListShelvesPage, - ListShelvesFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListShelvesPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListShelvesPagedResponse apply(ListShelvesPage input) { - return new ListShelvesPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); - } - - private ListShelvesPagedResponse(ListShelvesPage page) { - super(page, ListShelvesFixedSizeCollection.createEmptyCollection()); - } - - + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from a shelf or archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(folder, name, place, altBookName);
+   * }
+   * 
+ * + * @param folder + * @param name The name of the book to retrieve. + * @param place + * @param altBookName An alternate book name, used to test restricting flattened field to a + * single resource name type in a oneof. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAnywhere(FolderName folder, BookName name, LocationName place, BookName altBookName) { + GetBookFromAnywhereRequest request = + GetBookFromAnywhereRequest.newBuilder() + .setFolder(folder == null ? null : folder.toString()) + .setName(name == null ? null : name.toString()) + .setPlace(place == null ? null : place.toString()) + .setAltBookName(altBookName == null ? null : altBookName.toString()) + .build(); + return getBookFromAnywhere(request); } - public static class ListShelvesPage extends AbstractPage< - ListShelvesRequest, - ListShelvesResponse, - Shelf, - ListShelvesPage> { - - private ListShelvesPage( - PageContext context, - ListShelvesResponse response) { - super(context, response); - } - - private static ListShelvesPage createEmptyPage() { - return new ListShelvesPage(null, null); - } - - @Override - protected ListShelvesPage createPage( - PageContext context, - ListShelvesResponse response) { - return new ListShelvesPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - - - - + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from a shelf or archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(folder.toString(), name.toString(), place.toString(), altBookName.toString());
+   * }
+   * 
+ * + * @param folder + * @param name The name of the book to retrieve. + * @param place + * @param altBookName An alternate book name, used to test restricting flattened field to a + * single resource name type in a oneof. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAnywhere(String folder, String name, String place, String altBookName) { + GetBookFromAnywhereRequest request = + GetBookFromAnywhereRequest.newBuilder() + .setFolder(folder) + .setName(name) + .setPlace(place) + .setAltBookName(altBookName) + .build(); + return getBookFromAnywhere(request); } - public static class ListShelvesFixedSizeCollection extends AbstractFixedSizeCollection< - ListShelvesRequest, - ListShelvesResponse, - Shelf, - ListShelvesPage, - ListShelvesFixedSizeCollection> { - - private ListShelvesFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListShelvesFixedSizeCollection createEmptyCollection() { - return new ListShelvesFixedSizeCollection(null, 0); - } - - @Override - protected ListShelvesFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListShelvesFixedSizeCollection(pages, collectionSize); - } - - + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from a shelf or archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setAltBookName(altBookName.toString())
+   *     .setPlace(place.toString())
+   *     .setFolder(folder.toString())
+   *     .build();
+   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAnywhere(GetBookFromAnywhereRequest request) { + return getBookFromAnywhereCallable().call(request); } - public static class ListBooksPagedResponse extends AbstractPagedListResponse< - ListBooksRequest, - ListBooksResponse, - Book, - ListBooksPage, - ListBooksFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListBooksPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListBooksPagedResponse apply(ListBooksPage input) { - return new ListBooksPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); - } - - private ListBooksPagedResponse(ListBooksPage page) { - super(page, ListBooksFixedSizeCollection.createEmptyCollection()); - } - + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from a shelf or archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setAltBookName(altBookName.toString())
+   *     .setPlace(place.toString())
+   *     .setFolder(folder.toString())
+   *     .build();
+   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAnywhereCallable().futureCall(request);
+   *   // Do something
+   *   BookFromAnywhere response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getBookFromAnywhereCallable() { + return stub.getBookFromAnywhereCallable(); } - public static class ListBooksPage extends AbstractPage< - ListBooksRequest, - ListBooksResponse, - Book, - ListBooksPage> { - - private ListBooksPage( - PageContext context, - ListBooksResponse response) { - super(context, response); - } - - private static ListBooksPage createEmptyPage() { - return new ListBooksPage(null, null); - } - - @Override - protected ListBooksPage createPage( - PageContext context, - ListBooksResponse response) { - return new ListBooksPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - - - - + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test proper OneOf-Any resource name mapping + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name);
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAbsolutelyAnywhere(BookName name) { + GetBookFromAbsolutelyAnywhereRequest request = + GetBookFromAbsolutelyAnywhereRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getBookFromAbsolutelyAnywhere(request); } - public static class ListBooksFixedSizeCollection extends AbstractFixedSizeCollection< - ListBooksRequest, - ListBooksResponse, - Book, - ListBooksPage, - ListBooksFixedSizeCollection> { - - private ListBooksFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListBooksFixedSizeCollection createEmptyCollection() { - return new ListBooksFixedSizeCollection(null, 0); - } - - @Override - protected ListBooksFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListBooksFixedSizeCollection(pages, collectionSize); - } - + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test proper OneOf-Any resource name mapping + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name.toString());
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAbsolutelyAnywhere(String name) { + GetBookFromAbsolutelyAnywhereRequest request = + GetBookFromAbsolutelyAnywhereRequest.newBuilder() + .setName(name) + .build(); + return getBookFromAbsolutelyAnywhere(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test proper OneOf-Any resource name mapping + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAbsolutelyAnywhere(GetBookFromAbsolutelyAnywhereRequest request) { + return getBookFromAbsolutelyAnywhereCallable().call(request); } - public static class ListStringsPagedResponse extends AbstractPagedListResponse< - ListStringsRequest, - ListStringsResponse, - String, - ListStringsPage, - ListStringsFixedSizeCollection> { - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListStringsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListStringsPagedResponse apply(ListStringsPage input) { - return new ListStringsPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test proper OneOf-Any resource name mapping + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAbsolutelyAnywhereCallable().futureCall(request);
+   *   // Do something
+   *   BookFromAnywhere response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getBookFromAbsolutelyAnywhereCallable() { + return stub.getBookFromAbsolutelyAnywhereCallable(); + } - private ListStringsPagedResponse(ListStringsPage page) { - super(page, ListStringsFixedSizeCollection.createEmptyCollection()); - } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the index of a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   String indexName = "default index";
+   *   libraryClient.updateBookIndex(name, indexMap, indexName);
+   * }
+   * 
+ * + * @param name The name of the book to update. + * @param indexMap The index to update the book with + * @param indexName The name of the index for the book + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void updateBookIndex(BookName name, Map indexMap, String indexName) { + UpdateBookIndexRequest request = + UpdateBookIndexRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .putAllIndexMap(indexMap) + .setIndexName(indexName) + .build(); + updateBookIndex(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the index of a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   String indexName = "default index";
+   *   libraryClient.updateBookIndex(name.toString(), indexMap, indexName);
+   * }
+   * 
+ * + * @param name The name of the book to update. + * @param indexMap The index to update the book with + * @param indexName The name of the index for the book + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void updateBookIndex(String name, Map indexMap, String indexName) { + UpdateBookIndexRequest request = + UpdateBookIndexRequest.newBuilder() + .setName(name) + .putAllIndexMap(indexMap) + .setIndexName(indexName) + .build(); + updateBookIndex(request); } - public static class ListStringsPage extends AbstractPage< - ListStringsRequest, - ListStringsResponse, - String, - ListStringsPage> { + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the index of a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String indexName = "default index";
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setIndexName(indexName)
+   *     .putAllIndexMap(indexMap)
+   *     .build();
+   *   libraryClient.updateBookIndex(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void updateBookIndex(UpdateBookIndexRequest request) { + updateBookIndexCallable().call(request); + } - private ListStringsPage( - PageContext context, - ListStringsResponse response) { - super(context, response); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the index of a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String indexName = "default index";
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setIndexName(indexName)
+   *     .putAllIndexMap(indexMap)
+   *     .build();
+   *   ApiFuture<Void> future = libraryClient.updateBookIndexCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateBookIndexCallable() { + return stub.updateBookIndexCallable(); + } - private static ListStringsPage createEmptyPage() { - return new ListStringsPage(null, null); - } - - @Override - protected ListStringsPage createPage( - PageContext context, - ListStringsResponse response) { - return new ListStringsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } - - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test server streaming + * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   StreamShelvesRequest request = StreamShelvesRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *
+   *   ServerStream<StreamShelvesResponse> stream = libraryClient.streamShelvesCallable().call(request);
+   *   for (StreamShelvesResponse response : stream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final ServerStreamingCallable streamShelvesCallable() { + return stub.streamShelvesCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test server streaming, non-paged responses. + * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String name = "";
+   *   StreamBooksRequest request = StreamBooksRequest.newBuilder()
+   *     .setName(name)
+   *     .build();
+   *
+   *   ServerStream<Book> stream = libraryClient.streamBooksCallable().call(request);
+   *   for (Book response : stream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final ServerStreamingCallable streamBooksCallable() { + return stub.streamBooksCallable(); } - public static class ListStringsFixedSizeCollection extends AbstractFixedSizeCollection< - ListStringsRequest, - ListStringsResponse, - String, - ListStringsPage, - ListStringsFixedSizeCollection> { - - private ListStringsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListStringsFixedSizeCollection createEmptyCollection() { - return new ListStringsFixedSizeCollection(null, 0); - } - - @Override - protected ListStringsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListStringsFixedSizeCollection(pages, collectionSize); - } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } - + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test bidi-streaming. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BidiStream<DiscussBookRequest, Comment> bidiStream =
+   *       libraryClient.discussBookCallable().call();
+   *
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   bidiStream.send(request);
+   *   for (Comment response : bidiStream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final BidiStreamingCallable discussBookCallable() { + return stub.discussBookCallable(); } - public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse< - FindRelatedBooksRequest, - FindRelatedBooksResponse, - String, - FindRelatedBooksPage, - FindRelatedBooksFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - FindRelatedBooksPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public FindRelatedBooksPagedResponse apply(FindRelatedBooksPage input) { - return new FindRelatedBooksPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); - } - - private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) { - super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection()); - } - public Iterable iterateAllAsBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test client streaming. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ApiStreamObserver<Comment> responseObserver =
+   *       new ApiStreamObserver<Comment>() {
+   *         {@literal @}Override
+   *         public void onNext(Comment response) {
+   *           // Do something when receive a response
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onError(Throwable t) {
+   *           // Add error-handling
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onCompleted() {
+   *           // Do something when complete.
+   *         }
+   *       };
+   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
+   *       libraryClient.monologAboutBookCallable().clientStreamingCall(responseObserver);
+   *
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   requestObserver.onNext(request);
+   * }
+   * 
+ */ + public final ClientStreamingCallable monologAboutBookCallable() { + return stub.monologAboutBookCallable(); } - public static class FindRelatedBooksPage extends AbstractPage< - FindRelatedBooksRequest, - FindRelatedBooksResponse, - String, - FindRelatedBooksPage> { - - private FindRelatedBooksPage( - PageContext context, - FindRelatedBooksResponse response) { - super(context, response); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test samplegen response handling when a client streaming method returns Empty. + * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ApiStreamObserver<Void> responseObserver =
+   *       new ApiStreamObserver<Void>() {
+   *         {@literal @}Override
+   *         public void onNext(Void response) {
+   *           // Do something when receive a response
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onError(Throwable t) {
+   *           // Add error-handling
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onCompleted() {
+   *           // Do something when complete.
+   *         }
+   *       };
+   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
+   *       libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver);
+   *
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   requestObserver.onNext(request);
+   * }
+   * 
+ */ + public final ClientStreamingCallable babbleAboutBookCallable() { + return stub.babbleAboutBookCallable(); + } - private static FindRelatedBooksPage createEmptyPage() { - return new FindRelatedBooksPage(null, null); - } - - @Override - protected FindRelatedBooksPage createPage( - PageContext context, - FindRelatedBooksResponse response) { - return new FindRelatedBooksPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - public Iterable iterateAllAsBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } - - public Iterable getValuesAsBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } - - } - - public static class FindRelatedBooksFixedSizeCollection extends AbstractFixedSizeCollection< - FindRelatedBooksRequest, - FindRelatedBooksResponse, - String, - FindRelatedBooksPage, - FindRelatedBooksFixedSizeCollection> { - - private FindRelatedBooksFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static FindRelatedBooksFixedSizeCollection createEmptyCollection() { - return new FindRelatedBooksFixedSizeCollection(null, 0); - } - - @Override - protected FindRelatedBooksFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new FindRelatedBooksFixedSizeCollection(pages, collectionSize); - } - public Iterable getValuesAsBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String namesElement = "";
+   *   List<String> names = Arrays.asList(namesElement);
+   *   List<String> formattedShelves = new ArrayList<>();
+   *   for (BookName element : libraryClient.findRelatedBooks(names, formattedShelves).iterateAllAsBookName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param names + * @param shelves + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { + FindRelatedBooksRequest request = + FindRelatedBooksRequest.newBuilder() + .addAllNames(names) + .addAllShelves(shelves) + .build(); + return findRelatedBooks(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String namesElement = "";
+   *   List<String> names = Arrays.asList(namesElement);
+   *   List<String> formattedShelves = new ArrayList<>();
+   *   for (BookName element : libraryClient.findRelatedBooks(names, formattedShelves).iterateAllAsBookName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param names + * @param shelves + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { + FindRelatedBooksRequest request = + FindRelatedBooksRequest.newBuilder() + .addAllNames(names) + .addAllShelves(shelves) + .build(); + return findRelatedBooks(request); } -} -============== file: src/main/java/com/google/example/library/v1/LibrarySettings.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.batching.BatchingSettings; -import com.google.api.gax.batching.FlowControlSettings; -import com.google.api.gax.batching.FlowController; -import com.google.api.gax.batching.FlowController.LimitExceededBehavior; -import com.google.api.gax.batching.PartitionKey; -import com.google.api.gax.batching.RequestBuilder; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.BatchedRequestIssuer; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BatchingDescriptor; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.stub.LibraryServiceStubSettings; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.tagger.v1.LabelerGrpc; -import com.google.tagger.v1.TaggerProto.AddLabelRequest; -import com.google.tagger.v1.TaggerProto.AddLabelResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import javax.annotation.Generated; -import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link LibraryClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (library-example.googleapis.com) and default port (1234) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. - * - * For example, to set the total timeout of createShelf to 30 seconds: - * - *

- * 
- * LibrarySettings.Builder librarySettingsBuilder =
- *     LibrarySettings.newBuilder();
- * librarySettingsBuilder.createShelfSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * LibrarySettings librarySettings = librarySettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -public class LibrarySettings extends ClientSettings { + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to createShelf. + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String namesElement = "";
+   *   List<String> names = Arrays.asList(namesElement);
+   *   List<ShelfName> shelves = new ArrayList<>();
+   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
+   *     .addAllNames(PublisherName.toStringList(names))
+   *     .addAllShelves(ShelfName.toStringList(shelves))
+   *     .build();
+   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public UnaryCallSettings createShelfSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).createShelfSettings(); + public final FindRelatedBooksPagedResponse findRelatedBooks(FindRelatedBooksRequest request) { + return findRelatedBooksPagedCallable() + .call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to getShelf. + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String namesElement = "";
+   *   List<String> names = Arrays.asList(namesElement);
+   *   List<ShelfName> shelves = new ArrayList<>();
+   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
+   *     .addAllNames(PublisherName.toStringList(names))
+   *     .addAllShelves(ShelfName.toStringList(shelves))
+   *     .build();
+   *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (BookName element : future.get().iterateAllAsBookName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
*/ - public UnaryCallSettings getShelfSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getShelfSettings(); + public final UnaryCallable findRelatedBooksPagedCallable() { + return stub.findRelatedBooksPagedCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to listShelves. - */ - public PagedCallSettings listShelvesSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).listShelvesSettings(); - } - - /** - * Returns the object with the settings used for calls to deleteShelf. + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String namesElement = "";
+   *   List<String> names = Arrays.asList(namesElement);
+   *   List<ShelfName> shelves = new ArrayList<>();
+   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
+   *     .addAllNames(PublisherName.toStringList(names))
+   *     .addAllShelves(ShelfName.toStringList(shelves))
+   *     .build();
+   *   while (true) {
+   *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
+   *     for (BookName element : BookName.parseList(response.getNamesList())) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
*/ - public UnaryCallSettings deleteShelfSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).deleteShelfSettings(); + public final UnaryCallable findRelatedBooksCallable() { + return stub.findRelatedBooksCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to mergeShelves. + * Adds a label to the entity. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String label = "";
+   *   AddLabelRequest request = AddLabelRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setLabel(label)
+   *     .build();
+   *   AddLabelResponse response = libraryClient.addLabel(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public UnaryCallSettings mergeShelvesSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).mergeShelvesSettings(); + @Deprecated + /* package-private */ final AddLabelResponse addLabel(AddLabelRequest request) { + return addLabelCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to createBook. + * Adds a label to the entity. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String label = "";
+   *   AddLabelRequest request = AddLabelRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setLabel(label)
+   *     .build();
+   *   ApiFuture<AddLabelResponse> future = libraryClient.addLabelCallable().futureCall(request);
+   *   // Do something
+   *   AddLabelResponse response = future.get();
+   * }
+   * 
*/ - public UnaryCallSettings createBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).createBookSettings(); + @Deprecated + /* package-private */ final UnaryCallable addLabelCallable() { + return stub.addLabelCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to publishSeries. + * Test long-running operations + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.getBigBookAsync(name).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public BatchingCallSettings publishSeriesSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).publishSeriesSettings(); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(BookName name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getBigBookAsync(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to getBook. + * Test long-running operations + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public UnaryCallSettings getBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBookSettings(); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) + .build(); + return getBigBookAsync(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to listBooks. + * Test long-running operations + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public PagedCallSettings listBooksSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).listBooksSettings(); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) + .build(); + return getBigBookAsync(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to deleteBook. + * Test long-running operations + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Book response = libraryClient.getBigBookAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public UnaryCallSettings deleteBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).deleteBookSettings(); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(GetBookRequest request) { + return getBigBookOperationCallable().futureCall(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to updateBook. + * Test long-running operations + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Book, GetBigBookMetadata> future = libraryClient.getBigBookOperationCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
+   * }
+   * 
*/ - public UnaryCallSettings updateBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).updateBookSettings(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable getBigBookOperationCallable() { + return stub.getBigBookOperationCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to moveBook. + * Test long-running operations + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = libraryClient.getBigBookCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
*/ - public UnaryCallSettings moveBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).moveBookSettings(); + public final UnaryCallable getBigBookCallable() { + return stub.getBigBookCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to listStrings. + * Test long-running operations with empty return type. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.getBigNothingAsync(name).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public PagedCallSettings listStringsSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).listStringsSettings(); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigNothingAsync(BookName name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getBigNothingAsync(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to addComments. + * Test long-running operations with empty return type. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.getBigNothingAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public BatchingCallSettings addCommentsSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).addCommentsSettings(); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigNothingAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) + .build(); + return getBigNothingAsync(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to getBookFromArchive. - */ - public UnaryCallSettings getBookFromArchiveSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBookFromArchiveSettings(); - } - - /** - * Returns the object with the settings used for calls to getBookFromAnywhere. - */ - public UnaryCallSettings getBookFromAnywhereSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBookFromAnywhereSettings(); - } - - /** - * Returns the object with the settings used for calls to getBookFromAbsolutelyAnywhere. - */ - public UnaryCallSettings getBookFromAbsolutelyAnywhereSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBookFromAbsolutelyAnywhereSettings(); - } - - /** - * Returns the object with the settings used for calls to updateBookIndex. - */ - public UnaryCallSettings updateBookIndexSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).updateBookIndexSettings(); - } - - /** - * Returns the object with the settings used for calls to streamShelves. - */ - public ServerStreamingCallSettings streamShelvesSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).streamShelvesSettings(); - } - - /** - * Returns the object with the settings used for calls to streamBooks. - */ - public ServerStreamingCallSettings streamBooksSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).streamBooksSettings(); - } - - /** - * Returns the object with the settings used for calls to discussBook. - */ - public StreamingCallSettings discussBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).discussBookSettings(); - } - - /** - * Returns the object with the settings used for calls to monologAboutBook. - */ - public StreamingCallSettings monologAboutBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).monologAboutBookSettings(); - } - - /** - * Returns the object with the settings used for calls to babbleAboutBook. - */ - public StreamingCallSettings babbleAboutBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).babbleAboutBookSettings(); - } - - /** - * Returns the object with the settings used for calls to findRelatedBooks. - */ - public PagedCallSettings findRelatedBooksSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).findRelatedBooksSettings(); - } - - /** - * Returns the object with the settings used for calls to addLabel. - */ - /* package-private */ UnaryCallSettings addLabelSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).addLabelSettings(); - } - - /** - * Returns the object with the settings used for calls to getBigBook. - */ - public UnaryCallSettings getBigBookSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBigBookSettings(); - } - - /** - * Returns the object with the settings used for calls to getBigBook. + * Test long-running operations with empty return type. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.getBigNothingAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings getBigBookOperationSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBigBookOperationSettings(); - } - - /** - * Returns the object with the settings used for calls to getBigNothing. - */ - public UnaryCallSettings getBigNothingSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBigNothingSettings(); + public final OperationFuture getBigNothingAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) + .build(); + return getBigNothingAsync(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns the object with the settings used for calls to getBigNothing. + * Test long-running operations with empty return type. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   libraryClient.getBigNothingAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings getBigNothingOperationSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).getBigNothingOperationSettings(); - } - - /** - * Returns the object with the settings used for calls to testOptionalRequiredFlatteningParams. - */ - public UnaryCallSettings testOptionalRequiredFlatteningParamsSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).testOptionalRequiredFlatteningParamsSettings(); - } - - /** - * Returns the object with the settings used for calls to privateListShelves. - */ - public UnaryCallSettings privateListShelvesSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).privateListShelvesSettings(); - } - - - public static final LibrarySettings create(LibraryServiceStubSettings stub) throws IOException { - return new LibrarySettings.Builder(stub.toBuilder()).build(); - } - - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return LibraryServiceStubSettings.defaultExecutorProviderBuilder(); - } - - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return LibraryServiceStubSettings.getDefaultEndpoint(); - } - - - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return LibraryServiceStubSettings.getDefaultServiceScopes(); - } - - - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return LibraryServiceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return LibraryServiceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return LibraryServiceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return LibraryServiceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); + public final OperationFuture getBigNothingAsync(GetBookRequest request) { + return getBigNothingOperationCallable().futureCall(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns a new builder for this class. + * Test long-running operations with empty return type. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, GetBigBookMetadata> future = libraryClient.getBigNothingOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
*/ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable getBigNothingOperationCallable() { + return stub.getBigNothingOperationCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Returns a builder containing all the values of this settings class. + * Test long-running operations with empty return type. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = libraryClient.getBigNothingCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
*/ - public Builder toBuilder() { - return new Builder(this); - } - - protected LibrarySettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); + public final UnaryCallable getBigNothingCallable() { + return stub.getBigNothingCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Builder for LibrarySettings. - */ - public static class Builder extends ClientSettings.Builder { - protected Builder() throws IOException { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(LibraryServiceStubSettings.newBuilder(clientContext)); - } - - private static Builder createDefault() { - return new Builder(LibraryServiceStubSettings.newBuilder()); - } - + * Test optional flattening parameters of all types + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
+   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
+   *   boolean optionalSingularBool = false;
+   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
+   *   int optionalSingularFixed32 = 0;
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
+   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
+   *   Any anyValue = Any.newBuilder().build();
+   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
+   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
+   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
+   *   ListValue listValueValue = ListValue.newBuilder().build();
+   *   Struct structValue = Struct.newBuilder().build();
+   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
+   *   String requiredSingularResourceNameCommon = "";
+   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
+   *   String optionalSingularString = "";
+   *   long optionalSingularInt64 = 0L;
+   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
+   *   Duration requiredDurationValue = Duration.newBuilder().build();
+   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
+   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
+   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
+   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
+   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
+   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
+   *   Map<Integer, String> requiredMap = new HashMap<>();
+   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
+   *   boolean requiredSingularBool = false;
+   *   float requiredSingularFloat = 0.0F;
+   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
+   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   Any requiredAnyValue = Any.newBuilder().build();
+   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
+   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
+   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
+   *   long requiredSingularFixed64 = 0L;
+   *   String requiredSingularString = "";
+   *   Map<Integer, String> optionalMap = new HashMap<>();
+   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
+   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
+   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
+   *   List<Any> repeatedAnyValue = new ArrayList<>();
+   *   List<String> optionalRepeatedString = new ArrayList<>();
+   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
+   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
+   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
+   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
+   *   float optionalSingularFloat = 0.0F;
+   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
+   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
+   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
+   *   String optionalSingularResourceNameCommon = "";
+   *   Int32Value int32Value = Int32Value.newBuilder().build();
+   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
+   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
+   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
+   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
+   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
+   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Value valueValue = Value.newBuilder().build();
+   *   int optionalSingularInt32 = 0;
+   *   BoolValue boolValue = BoolValue.newBuilder().build();
+   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
+   *   double optionalSingularDouble = 0.0;
+   *   List<String> requiredRepeatedString = new ArrayList<>();
+   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
+   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
+   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
+   *   Value requiredValueValue = Value.newBuilder().build();
+   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
+   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
+   *   StringValue stringValue = StringValue.newBuilder().build();
+   *   Timestamp timeValue = Timestamp.newBuilder().build();
+   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
+   *   double requiredSingularDouble = 0.0;
+   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
+   *   long optionalSingularFixed64 = 0L;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
+   *   int requiredSingularInt32 = 0;
+   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
+   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
+   *   int requiredSingularFixed32 = 0;
+   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
+   *   Struct requiredStructValue = Struct.newBuilder().build();
+   *   List<Duration> repeatedDurationValue = new ArrayList<>();
+   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
+   *   BytesValue bytesValue = BytesValue.newBuilder().build();
+   *   List<Value> repeatedValueValue = new ArrayList<>();
+   *   StringValue requiredStringValue = StringValue.newBuilder().build();
+   *   List<StringValue> repeatedStringValue = new ArrayList<>();
+   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
+   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
+   *   long requiredSingularInt64 = 0L;
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
+   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
+   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
+   *   List<Struct> repeatedStructValue = new ArrayList<>();
+   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
+   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
+   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
+   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
+   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   Int64Value int64Value = Int64Value.newBuilder().build();
+   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
+   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
+   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
+   *   FloatValue floatValue = FloatValue.newBuilder().build();
+   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
+   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
+   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
+   *   Duration durationValue = Duration.newBuilder().build();
+   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue);
+   * }
+   * 
+ * + * @param requiredSingularResourceName + * @param requiredRepeatedBytesValue + * @param requiredRepeatedDurationValue + * @param optionalSingularBool + * @param repeatedListValueValue + * @param optionalSingularFixed32 + * @param optionalRepeatedMessage + * @param repeatedUint32Value + * @param anyValue + * @param optionalRepeatedInt64 + * @param optionalRepeatedFixed32 + * @param requiredDoubleValue + * @param listValueValue + * @param structValue + * @param requiredInt64Value + * @param requiredSingularResourceNameCommon + * @param optionalRepeatedBool + * @param optionalSingularString + * @param optionalSingularInt64 + * @param repeatedFloatValue + * @param optionalSingularMessage + * @param requiredSingularResourceNameOneof + * @param requiredRepeatedValueValue + * @param requiredDurationValue + * @param requiredRepeatedAnyValue + * @param requiredBytesValue + * @param requiredRepeatedInt64 + * @param optionalRepeatedDouble + * @param fieldMaskValue + * @param repeatedFieldMaskValue + * @param requiredMap + * @param requiredUint64Value + * @param requiredSingularBool + * @param requiredSingularFloat + * @param requiredRepeatedBytes + * @param optionalSingularBytes + * @param requiredSingularMessage + * @param requiredAnyValue + * @param repeatedInt32Value + * @param requiredRepeatedFixed64 + * @param repeatedUint64Value + * @param requiredSingularFixed64 + * @param requiredSingularString + * @param optionalMap + * @param requiredRepeatedBool + * @param requiredBoolValue + * @param requiredRepeatedStructValue + * @param repeatedAnyValue + * @param optionalRepeatedString + * @param optionalSingularResourceNameOneof + * @param requiredRepeatedMessage + * @param doubleValue + * @param repeatedDoubleValue + * @param requiredRepeatedUint32Value + * @param optionalSingularFloat + * @param optionalRepeatedBytes + * @param optionalRepeatedFixed64 + * @param requiredRepeatedInt32Value + * @param optionalSingularResourceNameCommon + * @param int32Value + * @param requiredRepeatedResourceName + * @param requiredRepeatedFloat + * @param requiredRepeatedStringValue + * @param repeatedInt64Value + * @param requiredFloatValue + * @param optionalSingularResourceName + * @param valueValue + * @param optionalSingularInt32 + * @param boolValue + * @param requiredRepeatedFieldMaskValue + * @param optionalSingularDouble + * @param requiredRepeatedString + * @param requiredInt32Value + * @param optionalRepeatedFloat + * @param uint64Value + * @param requiredRepeatedEnum + * @param requiredValueValue + * @param requiredRepeatedInt32 + * @param requiredRepeatedResourceNameCommon + * @param stringValue + * @param timeValue + * @param optionalRepeatedResourceNameOneof + * @param requiredSingularDouble + * @param requiredSingularBytes + * @param optionalSingularFixed64 + * @param requiredSingularEnum + * @param requiredRepeatedBoolValue + * @param requiredSingularInt32 + * @param optionalRepeatedResourceName + * @param requiredTimeValue + * @param requiredSingularFixed32 + * @param uint32Value + * @param requiredStructValue + * @param repeatedDurationValue + * @param requiredRepeatedDoubleValue + * @param bytesValue + * @param repeatedValueValue + * @param requiredStringValue + * @param repeatedStringValue + * @param requiredRepeatedTimeValue + * @param optionalRepeatedResourceNameCommon + * @param requiredRepeatedResourceNameOneof + * @param requiredSingularInt64 + * @param optionalRepeatedEnum + * @param requiredFieldMaskValue + * @param repeatedTimeValue + * @param repeatedStructValue + * @param requiredRepeatedListValueValue + * @param repeatedBytesValue + * @param requiredRepeatedInt64Value + * @param requiredListValueValue + * @param requiredRepeatedFloatValue + * @param optionalSingularEnum + * @param int64Value + * @param requiredRepeatedFixed32 + * @param optionalRepeatedInt32 + * @param repeatedBoolValue + * @param floatValue + * @param requiredUint32Value + * @param requiredRepeatedDouble + * @param requiredRepeatedUint64Value + * @param durationValue + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(BookName requiredSingularResourceName, List requiredRepeatedBytesValue, List requiredRepeatedDurationValue, boolean optionalSingularBool, List repeatedListValueValue, int optionalSingularFixed32, List optionalRepeatedMessage, List repeatedUint32Value, Any anyValue, List optionalRepeatedInt64, List optionalRepeatedFixed32, DoubleValue requiredDoubleValue, ListValue listValueValue, Struct structValue, Int64Value requiredInt64Value, String requiredSingularResourceNameCommon, List optionalRepeatedBool, String optionalSingularString, long optionalSingularInt64, List repeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, BookName requiredSingularResourceNameOneof, List requiredRepeatedValueValue, Duration requiredDurationValue, List requiredRepeatedAnyValue, BytesValue requiredBytesValue, List requiredRepeatedInt64, List optionalRepeatedDouble, com.google.protobuf.FieldMask fieldMaskValue, List repeatedFieldMaskValue, Map requiredMap, UInt64Value requiredUint64Value, boolean requiredSingularBool, float requiredSingularFloat, List requiredRepeatedBytes, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, Any requiredAnyValue, List repeatedInt32Value, List requiredRepeatedFixed64, List repeatedUint64Value, long requiredSingularFixed64, String requiredSingularString, Map optionalMap, List requiredRepeatedBool, BoolValue requiredBoolValue, List requiredRepeatedStructValue, List repeatedAnyValue, List optionalRepeatedString, BookName optionalSingularResourceNameOneof, List requiredRepeatedMessage, DoubleValue doubleValue, List repeatedDoubleValue, List requiredRepeatedUint32Value, float optionalSingularFloat, List optionalRepeatedBytes, List optionalRepeatedFixed64, List requiredRepeatedInt32Value, String optionalSingularResourceNameCommon, Int32Value int32Value, List requiredRepeatedResourceName, List requiredRepeatedFloat, List requiredRepeatedStringValue, List repeatedInt64Value, FloatValue requiredFloatValue, BookName optionalSingularResourceName, Value valueValue, int optionalSingularInt32, BoolValue boolValue, List requiredRepeatedFieldMaskValue, double optionalSingularDouble, List requiredRepeatedString, Int32Value requiredInt32Value, List optionalRepeatedFloat, UInt64Value uint64Value, List requiredRepeatedEnum, Value requiredValueValue, List requiredRepeatedInt32, List requiredRepeatedResourceNameCommon, StringValue stringValue, Timestamp timeValue, List optionalRepeatedResourceNameOneof, double requiredSingularDouble, ByteString requiredSingularBytes, long optionalSingularFixed64, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, List requiredRepeatedBoolValue, int requiredSingularInt32, List optionalRepeatedResourceName, Timestamp requiredTimeValue, int requiredSingularFixed32, UInt32Value uint32Value, Struct requiredStructValue, List repeatedDurationValue, List requiredRepeatedDoubleValue, BytesValue bytesValue, List repeatedValueValue, StringValue requiredStringValue, List repeatedStringValue, List requiredRepeatedTimeValue, List optionalRepeatedResourceNameCommon, List requiredRepeatedResourceNameOneof, long requiredSingularInt64, List optionalRepeatedEnum, com.google.protobuf.FieldMask requiredFieldMaskValue, List repeatedTimeValue, List repeatedStructValue, List requiredRepeatedListValueValue, List repeatedBytesValue, List requiredRepeatedInt64Value, ListValue requiredListValueValue, List requiredRepeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, Int64Value int64Value, List requiredRepeatedFixed32, List optionalRepeatedInt32, List repeatedBoolValue, FloatValue floatValue, UInt32Value requiredUint32Value, List requiredRepeatedDouble, List requiredRepeatedUint64Value, Duration durationValue) { + TestOptionalRequiredFlatteningParamsRequest request = + TestOptionalRequiredFlatteningParamsRequest.newBuilder() + .setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) + .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) + .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) + .setOptionalSingularBool(optionalSingularBool) + .addAllRepeatedListValueValue(repeatedListValueValue) + .setOptionalSingularFixed32(optionalSingularFixed32) + .addAllOptionalRepeatedMessage(optionalRepeatedMessage) + .addAllRepeatedUint32Value(repeatedUint32Value) + .setAnyValue(anyValue) + .addAllOptionalRepeatedInt64(optionalRepeatedInt64) + .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) + .setRequiredDoubleValue(requiredDoubleValue) + .setListValueValue(listValueValue) + .setStructValue(structValue) + .setRequiredInt64Value(requiredInt64Value) + .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) + .addAllOptionalRepeatedBool(optionalRepeatedBool) + .setOptionalSingularString(optionalSingularString) + .setOptionalSingularInt64(optionalSingularInt64) + .addAllRepeatedFloatValue(repeatedFloatValue) + .setOptionalSingularMessage(optionalSingularMessage) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof == null ? null : requiredSingularResourceNameOneof.toString()) + .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) + .setRequiredDurationValue(requiredDurationValue) + .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) + .setRequiredBytesValue(requiredBytesValue) + .addAllRequiredRepeatedInt64(requiredRepeatedInt64) + .addAllOptionalRepeatedDouble(optionalRepeatedDouble) + .setFieldMaskValue(fieldMaskValue) + .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) + .putAllRequiredMap(requiredMap) + .setRequiredUint64Value(requiredUint64Value) + .setRequiredSingularBool(requiredSingularBool) + .setRequiredSingularFloat(requiredSingularFloat) + .addAllRequiredRepeatedBytes(requiredRepeatedBytes) + .setOptionalSingularBytes(optionalSingularBytes) + .setRequiredSingularMessage(requiredSingularMessage) + .setRequiredAnyValue(requiredAnyValue) + .addAllRepeatedInt32Value(repeatedInt32Value) + .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) + .addAllRepeatedUint64Value(repeatedUint64Value) + .setRequiredSingularFixed64(requiredSingularFixed64) + .setRequiredSingularString(requiredSingularString) + .putAllOptionalMap(optionalMap) + .addAllRequiredRepeatedBool(requiredRepeatedBool) + .setRequiredBoolValue(requiredBoolValue) + .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) + .addAllRepeatedAnyValue(repeatedAnyValue) + .addAllOptionalRepeatedString(optionalRepeatedString) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof == null ? null : optionalSingularResourceNameOneof.toString()) + .addAllRequiredRepeatedMessage(requiredRepeatedMessage) + .setDoubleValue(doubleValue) + .addAllRepeatedDoubleValue(repeatedDoubleValue) + .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) + .setOptionalSingularFloat(optionalSingularFloat) + .addAllOptionalRepeatedBytes(optionalRepeatedBytes) + .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) + .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) + .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) + .setInt32Value(int32Value) + .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : BookName.toStringList(requiredRepeatedResourceName)) + .addAllRequiredRepeatedFloat(requiredRepeatedFloat) + .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) + .addAllRepeatedInt64Value(repeatedInt64Value) + .setRequiredFloatValue(requiredFloatValue) + .setOptionalSingularResourceName(optionalSingularResourceName == null ? null : optionalSingularResourceName.toString()) + .setValueValue(valueValue) + .setOptionalSingularInt32(optionalSingularInt32) + .setBoolValue(boolValue) + .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) + .setOptionalSingularDouble(optionalSingularDouble) + .addAllRequiredRepeatedString(requiredRepeatedString) + .setRequiredInt32Value(requiredInt32Value) + .addAllOptionalRepeatedFloat(optionalRepeatedFloat) + .setUint64Value(uint64Value) + .addAllRequiredRepeatedEnum(requiredRepeatedEnum) + .setRequiredValueValue(requiredValueValue) + .addAllRequiredRepeatedInt32(requiredRepeatedInt32) + .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) + .setStringValue(stringValue) + .setTimeValue(timeValue) + .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof)) + .setRequiredSingularDouble(requiredSingularDouble) + .setRequiredSingularBytes(requiredSingularBytes) + .setOptionalSingularFixed64(optionalSingularFixed64) + .setRequiredSingularEnum(requiredSingularEnum) + .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) + .setRequiredSingularInt32(requiredSingularInt32) + .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : BookName.toStringList(optionalRepeatedResourceName)) + .setRequiredTimeValue(requiredTimeValue) + .setRequiredSingularFixed32(requiredSingularFixed32) + .setUint32Value(uint32Value) + .setRequiredStructValue(requiredStructValue) + .addAllRepeatedDurationValue(repeatedDurationValue) + .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) + .setBytesValue(bytesValue) + .addAllRepeatedValueValue(repeatedValueValue) + .setRequiredStringValue(requiredStringValue) + .addAllRepeatedStringValue(repeatedStringValue) + .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) + .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) + .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof)) + .setRequiredSingularInt64(requiredSingularInt64) + .addAllOptionalRepeatedEnum(optionalRepeatedEnum) + .setRequiredFieldMaskValue(requiredFieldMaskValue) + .addAllRepeatedTimeValue(repeatedTimeValue) + .addAllRepeatedStructValue(repeatedStructValue) + .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) + .addAllRepeatedBytesValue(repeatedBytesValue) + .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) + .setRequiredListValueValue(requiredListValueValue) + .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) + .setOptionalSingularEnum(optionalSingularEnum) + .setInt64Value(int64Value) + .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) + .addAllOptionalRepeatedInt32(optionalRepeatedInt32) + .addAllRepeatedBoolValue(repeatedBoolValue) + .setFloatValue(floatValue) + .setRequiredUint32Value(requiredUint32Value) + .addAllRequiredRepeatedDouble(requiredRepeatedDouble) + .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) + .setDurationValue(durationValue) + .build(); + return testOptionalRequiredFlatteningParams(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test optional flattening parameters of all types + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
+   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
+   *   boolean optionalSingularBool = false;
+   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
+   *   int optionalSingularFixed32 = 0;
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
+   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
+   *   Any anyValue = Any.newBuilder().build();
+   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
+   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
+   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
+   *   ListValue listValueValue = ListValue.newBuilder().build();
+   *   Struct structValue = Struct.newBuilder().build();
+   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
+   *   String requiredSingularResourceNameCommon = "";
+   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
+   *   String optionalSingularString = "";
+   *   long optionalSingularInt64 = 0L;
+   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
+   *   Duration requiredDurationValue = Duration.newBuilder().build();
+   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
+   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
+   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
+   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
+   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
+   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
+   *   Map<Integer, String> requiredMap = new HashMap<>();
+   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
+   *   boolean requiredSingularBool = false;
+   *   float requiredSingularFloat = 0.0F;
+   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
+   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   Any requiredAnyValue = Any.newBuilder().build();
+   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
+   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
+   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
+   *   long requiredSingularFixed64 = 0L;
+   *   String requiredSingularString = "";
+   *   Map<Integer, String> optionalMap = new HashMap<>();
+   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
+   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
+   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
+   *   List<Any> repeatedAnyValue = new ArrayList<>();
+   *   List<String> optionalRepeatedString = new ArrayList<>();
+   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
+   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
+   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
+   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
+   *   float optionalSingularFloat = 0.0F;
+   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
+   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
+   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
+   *   String optionalSingularResourceNameCommon = "";
+   *   Int32Value int32Value = Int32Value.newBuilder().build();
+   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
+   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
+   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
+   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
+   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
+   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Value valueValue = Value.newBuilder().build();
+   *   int optionalSingularInt32 = 0;
+   *   BoolValue boolValue = BoolValue.newBuilder().build();
+   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
+   *   double optionalSingularDouble = 0.0;
+   *   List<String> requiredRepeatedString = new ArrayList<>();
+   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
+   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
+   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
+   *   Value requiredValueValue = Value.newBuilder().build();
+   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
+   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
+   *   StringValue stringValue = StringValue.newBuilder().build();
+   *   Timestamp timeValue = Timestamp.newBuilder().build();
+   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
+   *   double requiredSingularDouble = 0.0;
+   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
+   *   long optionalSingularFixed64 = 0L;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
+   *   int requiredSingularInt32 = 0;
+   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
+   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
+   *   int requiredSingularFixed32 = 0;
+   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
+   *   Struct requiredStructValue = Struct.newBuilder().build();
+   *   List<Duration> repeatedDurationValue = new ArrayList<>();
+   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
+   *   BytesValue bytesValue = BytesValue.newBuilder().build();
+   *   List<Value> repeatedValueValue = new ArrayList<>();
+   *   StringValue requiredStringValue = StringValue.newBuilder().build();
+   *   List<StringValue> repeatedStringValue = new ArrayList<>();
+   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
+   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
+   *   long requiredSingularInt64 = 0L;
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
+   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
+   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
+   *   List<Struct> repeatedStructValue = new ArrayList<>();
+   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
+   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
+   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
+   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
+   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   Int64Value int64Value = Int64Value.newBuilder().build();
+   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
+   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
+   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
+   *   FloatValue floatValue = FloatValue.newBuilder().build();
+   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
+   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
+   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
+   *   Duration durationValue = Duration.newBuilder().build();
+   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularResourceName.toString(), requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof.toString(), requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof.toString(), requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName.toString(), valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue);
+   * }
+   * 
+ * + * @param requiredSingularResourceName + * @param requiredRepeatedBytesValue + * @param requiredRepeatedDurationValue + * @param optionalSingularBool + * @param repeatedListValueValue + * @param optionalSingularFixed32 + * @param optionalRepeatedMessage + * @param repeatedUint32Value + * @param anyValue + * @param optionalRepeatedInt64 + * @param optionalRepeatedFixed32 + * @param requiredDoubleValue + * @param listValueValue + * @param structValue + * @param requiredInt64Value + * @param requiredSingularResourceNameCommon + * @param optionalRepeatedBool + * @param optionalSingularString + * @param optionalSingularInt64 + * @param repeatedFloatValue + * @param optionalSingularMessage + * @param requiredSingularResourceNameOneof + * @param requiredRepeatedValueValue + * @param requiredDurationValue + * @param requiredRepeatedAnyValue + * @param requiredBytesValue + * @param requiredRepeatedInt64 + * @param optionalRepeatedDouble + * @param fieldMaskValue + * @param repeatedFieldMaskValue + * @param requiredMap + * @param requiredUint64Value + * @param requiredSingularBool + * @param requiredSingularFloat + * @param requiredRepeatedBytes + * @param optionalSingularBytes + * @param requiredSingularMessage + * @param requiredAnyValue + * @param repeatedInt32Value + * @param requiredRepeatedFixed64 + * @param repeatedUint64Value + * @param requiredSingularFixed64 + * @param requiredSingularString + * @param optionalMap + * @param requiredRepeatedBool + * @param requiredBoolValue + * @param requiredRepeatedStructValue + * @param repeatedAnyValue + * @param optionalRepeatedString + * @param optionalSingularResourceNameOneof + * @param requiredRepeatedMessage + * @param doubleValue + * @param repeatedDoubleValue + * @param requiredRepeatedUint32Value + * @param optionalSingularFloat + * @param optionalRepeatedBytes + * @param optionalRepeatedFixed64 + * @param requiredRepeatedInt32Value + * @param optionalSingularResourceNameCommon + * @param int32Value + * @param requiredRepeatedResourceName + * @param requiredRepeatedFloat + * @param requiredRepeatedStringValue + * @param repeatedInt64Value + * @param requiredFloatValue + * @param optionalSingularResourceName + * @param valueValue + * @param optionalSingularInt32 + * @param boolValue + * @param requiredRepeatedFieldMaskValue + * @param optionalSingularDouble + * @param requiredRepeatedString + * @param requiredInt32Value + * @param optionalRepeatedFloat + * @param uint64Value + * @param requiredRepeatedEnum + * @param requiredValueValue + * @param requiredRepeatedInt32 + * @param requiredRepeatedResourceNameCommon + * @param stringValue + * @param timeValue + * @param optionalRepeatedResourceNameOneof + * @param requiredSingularDouble + * @param requiredSingularBytes + * @param optionalSingularFixed64 + * @param requiredSingularEnum + * @param requiredRepeatedBoolValue + * @param requiredSingularInt32 + * @param optionalRepeatedResourceName + * @param requiredTimeValue + * @param requiredSingularFixed32 + * @param uint32Value + * @param requiredStructValue + * @param repeatedDurationValue + * @param requiredRepeatedDoubleValue + * @param bytesValue + * @param repeatedValueValue + * @param requiredStringValue + * @param repeatedStringValue + * @param requiredRepeatedTimeValue + * @param optionalRepeatedResourceNameCommon + * @param requiredRepeatedResourceNameOneof + * @param requiredSingularInt64 + * @param optionalRepeatedEnum + * @param requiredFieldMaskValue + * @param repeatedTimeValue + * @param repeatedStructValue + * @param requiredRepeatedListValueValue + * @param repeatedBytesValue + * @param requiredRepeatedInt64Value + * @param requiredListValueValue + * @param requiredRepeatedFloatValue + * @param optionalSingularEnum + * @param int64Value + * @param requiredRepeatedFixed32 + * @param optionalRepeatedInt32 + * @param repeatedBoolValue + * @param floatValue + * @param requiredUint32Value + * @param requiredRepeatedDouble + * @param requiredRepeatedUint64Value + * @param durationValue + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(String requiredSingularResourceName, List requiredRepeatedBytesValue, List requiredRepeatedDurationValue, boolean optionalSingularBool, List repeatedListValueValue, int optionalSingularFixed32, List optionalRepeatedMessage, List repeatedUint32Value, Any anyValue, List optionalRepeatedInt64, List optionalRepeatedFixed32, DoubleValue requiredDoubleValue, ListValue listValueValue, Struct structValue, Int64Value requiredInt64Value, String requiredSingularResourceNameCommon, List optionalRepeatedBool, String optionalSingularString, long optionalSingularInt64, List repeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String requiredSingularResourceNameOneof, List requiredRepeatedValueValue, Duration requiredDurationValue, List requiredRepeatedAnyValue, BytesValue requiredBytesValue, List requiredRepeatedInt64, List optionalRepeatedDouble, com.google.protobuf.FieldMask fieldMaskValue, List repeatedFieldMaskValue, Map requiredMap, UInt64Value requiredUint64Value, boolean requiredSingularBool, float requiredSingularFloat, List requiredRepeatedBytes, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, Any requiredAnyValue, List repeatedInt32Value, List requiredRepeatedFixed64, List repeatedUint64Value, long requiredSingularFixed64, String requiredSingularString, Map optionalMap, List requiredRepeatedBool, BoolValue requiredBoolValue, List requiredRepeatedStructValue, List repeatedAnyValue, List optionalRepeatedString, String optionalSingularResourceNameOneof, List requiredRepeatedMessage, DoubleValue doubleValue, List repeatedDoubleValue, List requiredRepeatedUint32Value, float optionalSingularFloat, List optionalRepeatedBytes, List optionalRepeatedFixed64, List requiredRepeatedInt32Value, String optionalSingularResourceNameCommon, Int32Value int32Value, List requiredRepeatedResourceName, List requiredRepeatedFloat, List requiredRepeatedStringValue, List repeatedInt64Value, FloatValue requiredFloatValue, String optionalSingularResourceName, Value valueValue, int optionalSingularInt32, BoolValue boolValue, List requiredRepeatedFieldMaskValue, double optionalSingularDouble, List requiredRepeatedString, Int32Value requiredInt32Value, List optionalRepeatedFloat, UInt64Value uint64Value, List requiredRepeatedEnum, Value requiredValueValue, List requiredRepeatedInt32, List requiredRepeatedResourceNameCommon, StringValue stringValue, Timestamp timeValue, List optionalRepeatedResourceNameOneof, double requiredSingularDouble, ByteString requiredSingularBytes, long optionalSingularFixed64, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, List requiredRepeatedBoolValue, int requiredSingularInt32, List optionalRepeatedResourceName, Timestamp requiredTimeValue, int requiredSingularFixed32, UInt32Value uint32Value, Struct requiredStructValue, List repeatedDurationValue, List requiredRepeatedDoubleValue, BytesValue bytesValue, List repeatedValueValue, StringValue requiredStringValue, List repeatedStringValue, List requiredRepeatedTimeValue, List optionalRepeatedResourceNameCommon, List requiredRepeatedResourceNameOneof, long requiredSingularInt64, List optionalRepeatedEnum, com.google.protobuf.FieldMask requiredFieldMaskValue, List repeatedTimeValue, List repeatedStructValue, List requiredRepeatedListValueValue, List repeatedBytesValue, List requiredRepeatedInt64Value, ListValue requiredListValueValue, List requiredRepeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, Int64Value int64Value, List requiredRepeatedFixed32, List optionalRepeatedInt32, List repeatedBoolValue, FloatValue floatValue, UInt32Value requiredUint32Value, List requiredRepeatedDouble, List requiredRepeatedUint64Value, Duration durationValue) { + TestOptionalRequiredFlatteningParamsRequest request = + TestOptionalRequiredFlatteningParamsRequest.newBuilder() + .setRequiredSingularResourceName(requiredSingularResourceName) + .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) + .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) + .setOptionalSingularBool(optionalSingularBool) + .addAllRepeatedListValueValue(repeatedListValueValue) + .setOptionalSingularFixed32(optionalSingularFixed32) + .addAllOptionalRepeatedMessage(optionalRepeatedMessage) + .addAllRepeatedUint32Value(repeatedUint32Value) + .setAnyValue(anyValue) + .addAllOptionalRepeatedInt64(optionalRepeatedInt64) + .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) + .setRequiredDoubleValue(requiredDoubleValue) + .setListValueValue(listValueValue) + .setStructValue(structValue) + .setRequiredInt64Value(requiredInt64Value) + .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) + .addAllOptionalRepeatedBool(optionalRepeatedBool) + .setOptionalSingularString(optionalSingularString) + .setOptionalSingularInt64(optionalSingularInt64) + .addAllRepeatedFloatValue(repeatedFloatValue) + .setOptionalSingularMessage(optionalSingularMessage) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) + .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) + .setRequiredDurationValue(requiredDurationValue) + .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) + .setRequiredBytesValue(requiredBytesValue) + .addAllRequiredRepeatedInt64(requiredRepeatedInt64) + .addAllOptionalRepeatedDouble(optionalRepeatedDouble) + .setFieldMaskValue(fieldMaskValue) + .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) + .putAllRequiredMap(requiredMap) + .setRequiredUint64Value(requiredUint64Value) + .setRequiredSingularBool(requiredSingularBool) + .setRequiredSingularFloat(requiredSingularFloat) + .addAllRequiredRepeatedBytes(requiredRepeatedBytes) + .setOptionalSingularBytes(optionalSingularBytes) + .setRequiredSingularMessage(requiredSingularMessage) + .setRequiredAnyValue(requiredAnyValue) + .addAllRepeatedInt32Value(repeatedInt32Value) + .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) + .addAllRepeatedUint64Value(repeatedUint64Value) + .setRequiredSingularFixed64(requiredSingularFixed64) + .setRequiredSingularString(requiredSingularString) + .putAllOptionalMap(optionalMap) + .addAllRequiredRepeatedBool(requiredRepeatedBool) + .setRequiredBoolValue(requiredBoolValue) + .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) + .addAllRepeatedAnyValue(repeatedAnyValue) + .addAllOptionalRepeatedString(optionalRepeatedString) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) + .addAllRequiredRepeatedMessage(requiredRepeatedMessage) + .setDoubleValue(doubleValue) + .addAllRepeatedDoubleValue(repeatedDoubleValue) + .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) + .setOptionalSingularFloat(optionalSingularFloat) + .addAllOptionalRepeatedBytes(optionalRepeatedBytes) + .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) + .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) + .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) + .setInt32Value(int32Value) + .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName) + .addAllRequiredRepeatedFloat(requiredRepeatedFloat) + .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) + .addAllRepeatedInt64Value(repeatedInt64Value) + .setRequiredFloatValue(requiredFloatValue) + .setOptionalSingularResourceName(optionalSingularResourceName) + .setValueValue(valueValue) + .setOptionalSingularInt32(optionalSingularInt32) + .setBoolValue(boolValue) + .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) + .setOptionalSingularDouble(optionalSingularDouble) + .addAllRequiredRepeatedString(requiredRepeatedString) + .setRequiredInt32Value(requiredInt32Value) + .addAllOptionalRepeatedFloat(optionalRepeatedFloat) + .setUint64Value(uint64Value) + .addAllRequiredRepeatedEnum(requiredRepeatedEnum) + .setRequiredValueValue(requiredValueValue) + .addAllRequiredRepeatedInt32(requiredRepeatedInt32) + .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) + .setStringValue(stringValue) + .setTimeValue(timeValue) + .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof) + .setRequiredSingularDouble(requiredSingularDouble) + .setRequiredSingularBytes(requiredSingularBytes) + .setOptionalSingularFixed64(optionalSingularFixed64) + .setRequiredSingularEnum(requiredSingularEnum) + .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) + .setRequiredSingularInt32(requiredSingularInt32) + .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName) + .setRequiredTimeValue(requiredTimeValue) + .setRequiredSingularFixed32(requiredSingularFixed32) + .setUint32Value(uint32Value) + .setRequiredStructValue(requiredStructValue) + .addAllRepeatedDurationValue(repeatedDurationValue) + .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) + .setBytesValue(bytesValue) + .addAllRepeatedValueValue(repeatedValueValue) + .setRequiredStringValue(requiredStringValue) + .addAllRepeatedStringValue(repeatedStringValue) + .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) + .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) + .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof) + .setRequiredSingularInt64(requiredSingularInt64) + .addAllOptionalRepeatedEnum(optionalRepeatedEnum) + .setRequiredFieldMaskValue(requiredFieldMaskValue) + .addAllRepeatedTimeValue(repeatedTimeValue) + .addAllRepeatedStructValue(repeatedStructValue) + .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) + .addAllRepeatedBytesValue(repeatedBytesValue) + .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) + .setRequiredListValueValue(requiredListValueValue) + .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) + .setOptionalSingularEnum(optionalSingularEnum) + .setInt64Value(int64Value) + .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) + .addAllOptionalRepeatedInt32(optionalRepeatedInt32) + .addAllRepeatedBoolValue(repeatedBoolValue) + .setFloatValue(floatValue) + .setRequiredUint32Value(requiredUint32Value) + .addAllRequiredRepeatedDouble(requiredRepeatedDouble) + .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) + .setDurationValue(durationValue) + .build(); + return testOptionalRequiredFlatteningParams(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test optional flattening parameters of all types + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   int requiredSingularInt32 = 0;
+   *   long requiredSingularInt64 = 0L;
+   *   float requiredSingularFloat = 0.0F;
+   *   double requiredSingularDouble = 0.0;
+   *   boolean requiredSingularBool = false;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   String requiredSingularString = "";
+   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String requiredSingularResourceNameCommon = "";
+   *   int requiredSingularFixed32 = 0;
+   *   long requiredSingularFixed64 = 0L;
+   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
+   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
+   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
+   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
+   *   List<String> requiredRepeatedString = new ArrayList<>();
+   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
+   *   List<BookName> requiredRepeatedResourceName = new ArrayList<>();
+   *   List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>();
+   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
+   *   Map<Integer, String> requiredMap = new HashMap<>();
+   *   Any requiredAnyValue = Any.newBuilder().build();
+   *   Struct requiredStructValue = Struct.newBuilder().build();
+   *   Value requiredValueValue = Value.newBuilder().build();
+   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
+   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
+   *   Duration requiredDurationValue = Duration.newBuilder().build();
+   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
+   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
+   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
+   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
+   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
+   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
+   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
+   *   StringValue requiredStringValue = StringValue.newBuilder().build();
+   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
+   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
+   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
+   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
+   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
+   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
+   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
+   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
+   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
+   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
+   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
+   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
+   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
+   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
+   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
+   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
+   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
+   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder()
+   *     .setRequiredSingularInt32(requiredSingularInt32)
+   *     .setRequiredSingularInt64(requiredSingularInt64)
+   *     .setRequiredSingularFloat(requiredSingularFloat)
+   *     .setRequiredSingularDouble(requiredSingularDouble)
+   *     .setRequiredSingularBool(requiredSingularBool)
+   *     .setRequiredSingularEnum(requiredSingularEnum)
+   *     .setRequiredSingularString(requiredSingularString)
+   *     .setRequiredSingularBytes(requiredSingularBytes)
+   *     .setRequiredSingularMessage(requiredSingularMessage)
+   *     .setRequiredSingularResourceName(requiredSingularResourceName.toString())
+   *     .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString())
+   *     .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon)
+   *     .setRequiredSingularFixed32(requiredSingularFixed32)
+   *     .setRequiredSingularFixed64(requiredSingularFixed64)
+   *     .addAllRequiredRepeatedInt32(requiredRepeatedInt32)
+   *     .addAllRequiredRepeatedInt64(requiredRepeatedInt64)
+   *     .addAllRequiredRepeatedFloat(requiredRepeatedFloat)
+   *     .addAllRequiredRepeatedDouble(requiredRepeatedDouble)
+   *     .addAllRequiredRepeatedBool(requiredRepeatedBool)
+   *     .addAllRequiredRepeatedEnum(requiredRepeatedEnum)
+   *     .addAllRequiredRepeatedString(requiredRepeatedString)
+   *     .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
+   *     .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
+   *     .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName))
+   *     .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof))
+   *     .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
+   *     .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
+   *     .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
+   *     .putAllRequiredMap(requiredMap)
+   *     .setRequiredAnyValue(requiredAnyValue)
+   *     .setRequiredStructValue(requiredStructValue)
+   *     .setRequiredValueValue(requiredValueValue)
+   *     .setRequiredListValueValue(requiredListValueValue)
+   *     .setRequiredTimeValue(requiredTimeValue)
+   *     .setRequiredDurationValue(requiredDurationValue)
+   *     .setRequiredFieldMaskValue(requiredFieldMaskValue)
+   *     .setRequiredInt32Value(requiredInt32Value)
+   *     .setRequiredUint32Value(requiredUint32Value)
+   *     .setRequiredInt64Value(requiredInt64Value)
+   *     .setRequiredUint64Value(requiredUint64Value)
+   *     .setRequiredFloatValue(requiredFloatValue)
+   *     .setRequiredDoubleValue(requiredDoubleValue)
+   *     .setRequiredStringValue(requiredStringValue)
+   *     .setRequiredBoolValue(requiredBoolValue)
+   *     .setRequiredBytesValue(requiredBytesValue)
+   *     .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue)
+   *     .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue)
+   *     .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue)
+   *     .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue)
+   *     .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue)
+   *     .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue)
+   *     .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue)
+   *     .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value)
+   *     .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value)
+   *     .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value)
+   *     .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value)
+   *     .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue)
+   *     .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue)
+   *     .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue)
+   *     .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue)
+   *     .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue)
+   *     .build();
+   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest request) { + return testOptionalRequiredFlatteningParamsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test optional flattening parameters of all types + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   int requiredSingularInt32 = 0;
+   *   long requiredSingularInt64 = 0L;
+   *   float requiredSingularFloat = 0.0F;
+   *   double requiredSingularDouble = 0.0;
+   *   boolean requiredSingularBool = false;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   String requiredSingularString = "";
+   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String requiredSingularResourceNameCommon = "";
+   *   int requiredSingularFixed32 = 0;
+   *   long requiredSingularFixed64 = 0L;
+   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
+   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
+   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
+   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
+   *   List<String> requiredRepeatedString = new ArrayList<>();
+   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
+   *   List<BookName> requiredRepeatedResourceName = new ArrayList<>();
+   *   List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>();
+   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
+   *   Map<Integer, String> requiredMap = new HashMap<>();
+   *   Any requiredAnyValue = Any.newBuilder().build();
+   *   Struct requiredStructValue = Struct.newBuilder().build();
+   *   Value requiredValueValue = Value.newBuilder().build();
+   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
+   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
+   *   Duration requiredDurationValue = Duration.newBuilder().build();
+   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
+   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
+   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
+   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
+   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
+   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
+   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
+   *   StringValue requiredStringValue = StringValue.newBuilder().build();
+   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
+   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
+   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
+   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
+   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
+   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
+   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
+   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
+   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
+   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
+   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
+   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
+   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
+   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
+   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
+   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
+   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
+   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder()
+   *     .setRequiredSingularInt32(requiredSingularInt32)
+   *     .setRequiredSingularInt64(requiredSingularInt64)
+   *     .setRequiredSingularFloat(requiredSingularFloat)
+   *     .setRequiredSingularDouble(requiredSingularDouble)
+   *     .setRequiredSingularBool(requiredSingularBool)
+   *     .setRequiredSingularEnum(requiredSingularEnum)
+   *     .setRequiredSingularString(requiredSingularString)
+   *     .setRequiredSingularBytes(requiredSingularBytes)
+   *     .setRequiredSingularMessage(requiredSingularMessage)
+   *     .setRequiredSingularResourceName(requiredSingularResourceName.toString())
+   *     .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString())
+   *     .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon)
+   *     .setRequiredSingularFixed32(requiredSingularFixed32)
+   *     .setRequiredSingularFixed64(requiredSingularFixed64)
+   *     .addAllRequiredRepeatedInt32(requiredRepeatedInt32)
+   *     .addAllRequiredRepeatedInt64(requiredRepeatedInt64)
+   *     .addAllRequiredRepeatedFloat(requiredRepeatedFloat)
+   *     .addAllRequiredRepeatedDouble(requiredRepeatedDouble)
+   *     .addAllRequiredRepeatedBool(requiredRepeatedBool)
+   *     .addAllRequiredRepeatedEnum(requiredRepeatedEnum)
+   *     .addAllRequiredRepeatedString(requiredRepeatedString)
+   *     .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
+   *     .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
+   *     .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName))
+   *     .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof))
+   *     .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
+   *     .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
+   *     .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
+   *     .putAllRequiredMap(requiredMap)
+   *     .setRequiredAnyValue(requiredAnyValue)
+   *     .setRequiredStructValue(requiredStructValue)
+   *     .setRequiredValueValue(requiredValueValue)
+   *     .setRequiredListValueValue(requiredListValueValue)
+   *     .setRequiredTimeValue(requiredTimeValue)
+   *     .setRequiredDurationValue(requiredDurationValue)
+   *     .setRequiredFieldMaskValue(requiredFieldMaskValue)
+   *     .setRequiredInt32Value(requiredInt32Value)
+   *     .setRequiredUint32Value(requiredUint32Value)
+   *     .setRequiredInt64Value(requiredInt64Value)
+   *     .setRequiredUint64Value(requiredUint64Value)
+   *     .setRequiredFloatValue(requiredFloatValue)
+   *     .setRequiredDoubleValue(requiredDoubleValue)
+   *     .setRequiredStringValue(requiredStringValue)
+   *     .setRequiredBoolValue(requiredBoolValue)
+   *     .setRequiredBytesValue(requiredBytesValue)
+   *     .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue)
+   *     .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue)
+   *     .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue)
+   *     .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue)
+   *     .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue)
+   *     .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue)
+   *     .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue)
+   *     .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value)
+   *     .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value)
+   *     .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value)
+   *     .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value)
+   *     .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue)
+   *     .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue)
+   *     .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue)
+   *     .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue)
+   *     .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue)
+   *     .build();
+   *   ApiFuture<TestOptionalRequiredFlatteningParamsResponse> future = libraryClient.testOptionalRequiredFlatteningParamsCallable().futureCall(request);
+   *   // Do something
+   *   TestOptionalRequiredFlatteningParamsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable testOptionalRequiredFlatteningParamsCallable() { + return stub.testOptionalRequiredFlatteningParamsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Publisher element : libraryClient.listPublishers(additionalDestinations, parent, destination.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param additionalDestinations + * @param parent + * @param destination + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(List additionalDestinations, String parent, String destination) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .setDestination(destination) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Publisher element : libraryClient.listPublishers(additionalDestinations, parent, destination.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param additionalDestinations + * @param parent + * @param destination + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(List additionalDestinations, String parent, String destination) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .setDestination(destination) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String destination = "";
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ProjectName destination = ProjectName.of("[PROJECT]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   OrganizationName destination = OrganizationName.of("[ORGANIZATION]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String destination = "";
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   FolderName destination = FolderName.of("[FOLDER]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchivedBookName destination = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BillingAccountName destination = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String destination = "";
+   *   List<String> additionalDestinations = new ArrayList<>();
+   *   String parent = "";
+   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param destination + * @param additionalDestinations + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .setParent(parent) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String parent = "";
+   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   for (Publisher element : libraryClient.listPublishers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(ListPublishersRequest request) { + return listPublishersPagedCallable() + .call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String parent = "";
+   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   ApiFuture<ListPublishersPagedResponse> future = libraryClient.listPublishersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Publisher element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listPublishersPagedCallable() { + return stub.listPublishersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   String parent = "";
+   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   while (true) {
+   *     ListPublishersResponse response = libraryClient.listPublishersCallable().call(request);
+   *     for (Publisher element : response.getPublishersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listPublishersCallable() { + return stub.listPublishersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * This method is not exposed in the GAPIC config. It should be generated. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
+   *   Book response = libraryClient.privateListShelves(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book privateListShelves(ListShelvesRequest request) { + return privateListShelvesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * This method is not exposed in the GAPIC config. It should be generated. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
+   *   ApiFuture<Book> future = libraryClient.privateListShelvesCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable privateListShelvesCallable() { + return stub.privateListShelvesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListShelvesPagedResponse extends AbstractPagedListResponse< + ListShelvesRequest, + ListShelvesResponse, + Shelf, + ListShelvesPage, + ListShelvesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListShelvesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListShelvesPagedResponse apply(ListShelvesPage input) { + return new ListShelvesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListShelvesPagedResponse(ListShelvesPage page) { + super(page, ListShelvesFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListShelvesPage extends AbstractPage< + ListShelvesRequest, + ListShelvesResponse, + Shelf, + ListShelvesPage> { + + private ListShelvesPage( + PageContext context, + ListShelvesResponse response) { + super(context, response); + } + + private static ListShelvesPage createEmptyPage() { + return new ListShelvesPage(null, null); + } + + @Override + protected ListShelvesPage createPage( + PageContext context, + ListShelvesResponse response) { + return new ListShelvesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListShelvesFixedSizeCollection extends AbstractFixedSizeCollection< + ListShelvesRequest, + ListShelvesResponse, + Shelf, + ListShelvesPage, + ListShelvesFixedSizeCollection> { + + private ListShelvesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListShelvesFixedSizeCollection createEmptyCollection() { + return new ListShelvesFixedSizeCollection(null, 0); + } + + @Override + protected ListShelvesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListShelvesFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListBooksPagedResponse extends AbstractPagedListResponse< + ListBooksRequest, + ListBooksResponse, + Book, + ListBooksPage, + ListBooksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBooksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBooksPagedResponse apply(ListBooksPage input) { + return new ListBooksPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListBooksPagedResponse(ListBooksPage page) { + super(page, ListBooksFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListBooksPage extends AbstractPage< + ListBooksRequest, + ListBooksResponse, + Book, + ListBooksPage> { + + private ListBooksPage( + PageContext context, + ListBooksResponse response) { + super(context, response); + } + + private static ListBooksPage createEmptyPage() { + return new ListBooksPage(null, null); + } + + @Override + protected ListBooksPage createPage( + PageContext context, + ListBooksResponse response) { + return new ListBooksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListBooksFixedSizeCollection extends AbstractFixedSizeCollection< + ListBooksRequest, + ListBooksResponse, + Book, + ListBooksPage, + ListBooksFixedSizeCollection> { + + private ListBooksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBooksFixedSizeCollection createEmptyCollection() { + return new ListBooksFixedSizeCollection(null, 0); + } + + @Override + protected ListBooksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBooksFixedSizeCollection(pages, collectionSize); + } + + + } + public static class ListStringsPagedResponse extends AbstractPagedListResponse< + ListStringsRequest, + ListStringsResponse, + String, + ListStringsPage, + ListStringsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListStringsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListStringsPagedResponse apply(ListStringsPage input) { + return new ListStringsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListStringsPagedResponse(ListStringsPage page) { + super(page, ListStringsFixedSizeCollection.createEmptyCollection()); + } + public Iterable iterateAllAsResourceName() { + return Iterables.transform(iterateAll(), new Function() { + @Override + public ResourceName apply(String arg0) { + return UntypedResourceName.parse(arg0); + } + } + ); + } + + } + + public static class ListStringsPage extends AbstractPage< + ListStringsRequest, + ListStringsResponse, + String, + ListStringsPage> { + + private ListStringsPage( + PageContext context, + ListStringsResponse response) { + super(context, response); + } + + private static ListStringsPage createEmptyPage() { + return new ListStringsPage(null, null); + } + + @Override + protected ListStringsPage createPage( + PageContext context, + ListStringsResponse response) { + return new ListStringsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + public Iterable iterateAllAsResourceName() { + return Iterables.transform(iterateAll(), new Function() { + @Override + public ResourceName apply(String arg0) { + return UntypedResourceName.parse(arg0); + } + } + ); + } + + public Iterable getValuesAsResourceName() { + return Iterables.transform(getValues(), new Function() { + @Override + public ResourceName apply(String arg0) { + return UntypedResourceName.parse(arg0); + } + } + ); + } + + } + + public static class ListStringsFixedSizeCollection extends AbstractFixedSizeCollection< + ListStringsRequest, + ListStringsResponse, + String, + ListStringsPage, + ListStringsFixedSizeCollection> { + + private ListStringsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListStringsFixedSizeCollection createEmptyCollection() { + return new ListStringsFixedSizeCollection(null, 0); + } + + @Override + protected ListStringsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListStringsFixedSizeCollection(pages, collectionSize); + } + public Iterable getValuesAsResourceName() { + return Iterables.transform(getValues(), new Function() { + @Override + public ResourceName apply(String arg0) { + return UntypedResourceName.parse(arg0); + } + } + ); + } + + } + public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse< + FindRelatedBooksRequest, + FindRelatedBooksResponse, + String, + FindRelatedBooksPage, + FindRelatedBooksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + FindRelatedBooksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public FindRelatedBooksPagedResponse apply(FindRelatedBooksPage input) { + return new FindRelatedBooksPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) { + super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection()); + } + public Iterable iterateAllAsBookName() { + return Iterables.transform(iterateAll(), new Function() { + @Override + public BookName apply(String arg0) { + return BookName.parse(arg0); + } + } + ); + } + + } + + public static class FindRelatedBooksPage extends AbstractPage< + FindRelatedBooksRequest, + FindRelatedBooksResponse, + String, + FindRelatedBooksPage> { + + private FindRelatedBooksPage( + PageContext context, + FindRelatedBooksResponse response) { + super(context, response); + } + + private static FindRelatedBooksPage createEmptyPage() { + return new FindRelatedBooksPage(null, null); + } + + @Override + protected FindRelatedBooksPage createPage( + PageContext context, + FindRelatedBooksResponse response) { + return new FindRelatedBooksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + public Iterable iterateAllAsBookName() { + return Iterables.transform(iterateAll(), new Function() { + @Override + public BookName apply(String arg0) { + return BookName.parse(arg0); + } + } + ); + } + + public Iterable getValuesAsBookName() { + return Iterables.transform(getValues(), new Function() { + @Override + public BookName apply(String arg0) { + return BookName.parse(arg0); + } + } + ); + } + + } + + public static class FindRelatedBooksFixedSizeCollection extends AbstractFixedSizeCollection< + FindRelatedBooksRequest, + FindRelatedBooksResponse, + String, + FindRelatedBooksPage, + FindRelatedBooksFixedSizeCollection> { + + private FindRelatedBooksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static FindRelatedBooksFixedSizeCollection createEmptyCollection() { + return new FindRelatedBooksFixedSizeCollection(null, 0); + } + + @Override + protected FindRelatedBooksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new FindRelatedBooksFixedSizeCollection(pages, collectionSize); + } + public Iterable getValuesAsBookName() { + return Iterables.transform(getValues(), new Function() { + @Override + public BookName apply(String arg0) { + return BookName.parse(arg0); + } + } + ); + } + + } + public static class ListPublishersPagedResponse extends AbstractPagedListResponse< + ListPublishersRequest, + ListPublishersResponse, + Publisher, + ListPublishersPage, + ListPublishersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPublishersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListPublishersPagedResponse apply(ListPublishersPage input) { + return new ListPublishersPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListPublishersPagedResponse(ListPublishersPage page) { + super(page, ListPublishersFixedSizeCollection.createEmptyCollection()); + } + + + } + + public static class ListPublishersPage extends AbstractPage< + ListPublishersRequest, + ListPublishersResponse, + Publisher, + ListPublishersPage> { + + private ListPublishersPage( + PageContext context, + ListPublishersResponse response) { + super(context, response); + } + + private static ListPublishersPage createEmptyPage() { + return new ListPublishersPage(null, null); + } + + @Override + protected ListPublishersPage createPage( + PageContext context, + ListPublishersResponse response) { + return new ListPublishersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + + + + + } + + public static class ListPublishersFixedSizeCollection extends AbstractFixedSizeCollection< + ListPublishersRequest, + ListPublishersResponse, + Publisher, + ListPublishersPage, + ListPublishersFixedSizeCollection> { + + private ListPublishersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPublishersFixedSizeCollection createEmptyCollection() { + return new ListPublishersFixedSizeCollection(null, 0); + } + + @Override + protected ListPublishersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPublishersFixedSizeCollection(pages, collectionSize); + } + + + } +} +============== file: src/main/java/com/google/example/library/v1/LibrarySettings.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.batching.FlowController.LimitExceededBehavior; +import com.google.api.gax.batching.PartitionKey; +import com.google.api.gax.batching.RequestBuilder; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.BatchedRequestIssuer; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BatchingDescriptor; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; +import com.google.example.library.v1.stub.LibraryServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.tagger.v1.LabelerGrpc; +import com.google.tagger.v1.TaggerProto.AddLabelRequest; +import com.google.tagger.v1.TaggerProto.AddLabelResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LibraryClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (library-example.googleapis.com) and default port (1234) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. + * + * For example, to set the total timeout of createShelf to 30 seconds: + * + *

+ * 
+ * LibrarySettings.Builder librarySettingsBuilder =
+ *     LibrarySettings.newBuilder();
+ * librarySettingsBuilder.createShelfSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LibrarySettings librarySettings = librarySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class LibrarySettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to createShelf. + */ + public UnaryCallSettings createShelfSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).createShelfSettings(); + } + + /** + * Returns the object with the settings used for calls to getShelf. + */ + public UnaryCallSettings getShelfSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getShelfSettings(); + } + + /** + * Returns the object with the settings used for calls to listShelves. + */ + public PagedCallSettings listShelvesSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).listShelvesSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteShelf. + */ + public UnaryCallSettings deleteShelfSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).deleteShelfSettings(); + } + + /** + * Returns the object with the settings used for calls to mergeShelves. + */ + public UnaryCallSettings mergeShelvesSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).mergeShelvesSettings(); + } + + /** + * Returns the object with the settings used for calls to createBook. + */ + public UnaryCallSettings createBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).createBookSettings(); + } + + /** + * Returns the object with the settings used for calls to publishSeries. + */ + public BatchingCallSettings publishSeriesSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).publishSeriesSettings(); + } + + /** + * Returns the object with the settings used for calls to getBook. + */ + public UnaryCallSettings getBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBookSettings(); + } + + /** + * Returns the object with the settings used for calls to listBooks. + */ + public PagedCallSettings listBooksSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).listBooksSettings(); + } + + /** + * Returns the object with the settings used for calls to deleteBook. + */ + public UnaryCallSettings deleteBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).deleteBookSettings(); + } + + /** + * Returns the object with the settings used for calls to updateBook. + */ + public UnaryCallSettings updateBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).updateBookSettings(); + } + + /** + * Returns the object with the settings used for calls to moveBook. + */ + public UnaryCallSettings moveBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).moveBookSettings(); + } + + /** + * Returns the object with the settings used for calls to listStrings. + */ + public PagedCallSettings listStringsSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).listStringsSettings(); + } + + /** + * Returns the object with the settings used for calls to addComments. + */ + public BatchingCallSettings addCommentsSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).addCommentsSettings(); + } + + /** + * Returns the object with the settings used for calls to getBookFromArchive. + */ + public UnaryCallSettings getBookFromArchiveSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBookFromArchiveSettings(); + } + + /** + * Returns the object with the settings used for calls to getBookFromAnywhere. + */ + public UnaryCallSettings getBookFromAnywhereSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBookFromAnywhereSettings(); + } + + /** + * Returns the object with the settings used for calls to getBookFromAbsolutelyAnywhere. + */ + public UnaryCallSettings getBookFromAbsolutelyAnywhereSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBookFromAbsolutelyAnywhereSettings(); + } + + /** + * Returns the object with the settings used for calls to updateBookIndex. + */ + public UnaryCallSettings updateBookIndexSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).updateBookIndexSettings(); + } + + /** + * Returns the object with the settings used for calls to streamShelves. + */ + public ServerStreamingCallSettings streamShelvesSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).streamShelvesSettings(); + } + + /** + * Returns the object with the settings used for calls to streamBooks. + */ + public ServerStreamingCallSettings streamBooksSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).streamBooksSettings(); + } + + /** + * Returns the object with the settings used for calls to discussBook. + */ + public StreamingCallSettings discussBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).discussBookSettings(); + } + + /** + * Returns the object with the settings used for calls to monologAboutBook. + */ + public StreamingCallSettings monologAboutBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).monologAboutBookSettings(); + } + + /** + * Returns the object with the settings used for calls to babbleAboutBook. + */ + public StreamingCallSettings babbleAboutBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).babbleAboutBookSettings(); + } + + /** + * Returns the object with the settings used for calls to findRelatedBooks. + */ + public PagedCallSettings findRelatedBooksSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).findRelatedBooksSettings(); + } + + /** + * Returns the object with the settings used for calls to addLabel. + */ + /* package-private */ UnaryCallSettings addLabelSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).addLabelSettings(); + } + + /** + * Returns the object with the settings used for calls to getBigBook. + */ + public UnaryCallSettings getBigBookSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBigBookSettings(); + } + + /** + * Returns the object with the settings used for calls to getBigBook. + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings getBigBookOperationSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBigBookOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to getBigNothing. + */ + public UnaryCallSettings getBigNothingSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBigNothingSettings(); + } + + /** + * Returns the object with the settings used for calls to getBigNothing. + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings getBigNothingOperationSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).getBigNothingOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to testOptionalRequiredFlatteningParams. + */ + public UnaryCallSettings testOptionalRequiredFlatteningParamsSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).testOptionalRequiredFlatteningParamsSettings(); + } + + /** + * Returns the object with the settings used for calls to listPublishers. + */ + public PagedCallSettings listPublishersSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).listPublishersSettings(); + } + + /** + * Returns the object with the settings used for calls to privateListShelves. + */ + public UnaryCallSettings privateListShelvesSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).privateListShelvesSettings(); + } + + + public static final LibrarySettings create(LibraryServiceStubSettings stub) throws IOException { + return new LibrarySettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LibraryServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return LibraryServiceStubSettings.getDefaultEndpoint(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return LibraryServiceStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LibraryServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return LibraryServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LibraryServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LibraryServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LibrarySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for LibrarySettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(LibraryServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(LibraryServiceStubSettings.newBuilder()); + } + protected Builder(LibrarySettings settings) { super(settings.getStubSettings().toBuilder()); } - protected Builder(LibraryServiceStubSettings.Builder stubSettings) { - super(stubSettings); - } + protected Builder(LibraryServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public LibraryServiceStubSettings.Builder getStubSettingsBuilder() { + return ((LibraryServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to createShelf. + */ + public UnaryCallSettings.Builder createShelfSettings() { + return getStubSettingsBuilder().createShelfSettings(); + } + + /** + * Returns the builder for the settings used for calls to getShelf. + */ + public UnaryCallSettings.Builder getShelfSettings() { + return getStubSettingsBuilder().getShelfSettings(); + } + + /** + * Returns the builder for the settings used for calls to listShelves. + */ + public PagedCallSettings.Builder listShelvesSettings() { + return getStubSettingsBuilder().listShelvesSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteShelf. + */ + public UnaryCallSettings.Builder deleteShelfSettings() { + return getStubSettingsBuilder().deleteShelfSettings(); + } + + /** + * Returns the builder for the settings used for calls to mergeShelves. + */ + public UnaryCallSettings.Builder mergeShelvesSettings() { + return getStubSettingsBuilder().mergeShelvesSettings(); + } + + /** + * Returns the builder for the settings used for calls to createBook. + */ + public UnaryCallSettings.Builder createBookSettings() { + return getStubSettingsBuilder().createBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to publishSeries. + */ + public BatchingCallSettings.Builder publishSeriesSettings() { + return getStubSettingsBuilder().publishSeriesSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBook. + */ + public UnaryCallSettings.Builder getBookSettings() { + return getStubSettingsBuilder().getBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to listBooks. + */ + public PagedCallSettings.Builder listBooksSettings() { + return getStubSettingsBuilder().listBooksSettings(); + } + + /** + * Returns the builder for the settings used for calls to deleteBook. + */ + public UnaryCallSettings.Builder deleteBookSettings() { + return getStubSettingsBuilder().deleteBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateBook. + */ + public UnaryCallSettings.Builder updateBookSettings() { + return getStubSettingsBuilder().updateBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to moveBook. + */ + public UnaryCallSettings.Builder moveBookSettings() { + return getStubSettingsBuilder().moveBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to listStrings. + */ + public PagedCallSettings.Builder listStringsSettings() { + return getStubSettingsBuilder().listStringsSettings(); + } + + /** + * Returns the builder for the settings used for calls to addComments. + */ + public BatchingCallSettings.Builder addCommentsSettings() { + return getStubSettingsBuilder().addCommentsSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBookFromArchive. + */ + public UnaryCallSettings.Builder getBookFromArchiveSettings() { + return getStubSettingsBuilder().getBookFromArchiveSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBookFromAnywhere. + */ + public UnaryCallSettings.Builder getBookFromAnywhereSettings() { + return getStubSettingsBuilder().getBookFromAnywhereSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBookFromAbsolutelyAnywhere. + */ + public UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings() { + return getStubSettingsBuilder().getBookFromAbsolutelyAnywhereSettings(); + } + + /** + * Returns the builder for the settings used for calls to updateBookIndex. + */ + public UnaryCallSettings.Builder updateBookIndexSettings() { + return getStubSettingsBuilder().updateBookIndexSettings(); + } + + /** + * Returns the builder for the settings used for calls to streamShelves. + */ + public ServerStreamingCallSettings.Builder streamShelvesSettings() { + return getStubSettingsBuilder().streamShelvesSettings(); + } + + /** + * Returns the builder for the settings used for calls to streamBooks. + */ + public ServerStreamingCallSettings.Builder streamBooksSettings() { + return getStubSettingsBuilder().streamBooksSettings(); + } + + /** + * Returns the builder for the settings used for calls to discussBook. + */ + public StreamingCallSettings.Builder discussBookSettings() { + return getStubSettingsBuilder().discussBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to monologAboutBook. + */ + public StreamingCallSettings.Builder monologAboutBookSettings() { + return getStubSettingsBuilder().monologAboutBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to babbleAboutBook. + */ + public StreamingCallSettings.Builder babbleAboutBookSettings() { + return getStubSettingsBuilder().babbleAboutBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to findRelatedBooks. + */ + public PagedCallSettings.Builder findRelatedBooksSettings() { + return getStubSettingsBuilder().findRelatedBooksSettings(); + } + + /** + * Returns the builder for the settings used for calls to addLabel. + */ + /* package-private */ UnaryCallSettings.Builder addLabelSettings() { + return getStubSettingsBuilder().addLabelSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBigBook. + */ + public UnaryCallSettings.Builder getBigBookSettings() { + return getStubSettingsBuilder().getBigBookSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBigBook. + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder getBigBookOperationSettings() { + return getStubSettingsBuilder().getBigBookOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBigNothing. + */ + public UnaryCallSettings.Builder getBigNothingSettings() { + return getStubSettingsBuilder().getBigNothingSettings(); + } + + /** + * Returns the builder for the settings used for calls to getBigNothing. + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder getBigNothingOperationSettings() { + return getStubSettingsBuilder().getBigNothingOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to testOptionalRequiredFlatteningParams. + */ + public UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings() { + return getStubSettingsBuilder().testOptionalRequiredFlatteningParamsSettings(); + } + + /** + * Returns the builder for the settings used for calls to listPublishers. + */ + public PagedCallSettings.Builder listPublishersSettings() { + return getStubSettingsBuilder().listPublishersSettings(); + } + + /** + * Returns the builder for the settings used for calls to privateListShelves. + */ + public UnaryCallSettings.Builder privateListShelvesSettings() { + return getStubSettingsBuilder().privateListShelvesSettings(); + } + + @Override + public LibrarySettings build() throws IOException { + return new LibrarySettings(this); + } + } +} +============== file: src/main/java/com/google/example/library/v1/MyProtoClient.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.paging.FixedSizeCollection; +import com.google.api.gax.paging.Page; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.example.library.v1.stub.MyProtoStub; +import com.google.example.library.v1.stub.MyProtoStubSettings; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import java.io.Closeable; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
+ *   MethodRequest request = MethodRequest.newBuilder().build();
+ *   MethodResponse response = myProtoClient.myMethod(request);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the myProtoClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available + * as parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request + * object, which must be constructed before the call. Not every API method will have a request + * object method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable + * API callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist + * with these names, this class includes a format method for each type of name, and additionally + * a parse method to extract the individual identifiers contained within names that are + * returned. + * + *

This class can be customized by passing in a custom instance of MyProtoSettings to + * create(). For example: + * + * To customize credentials: + * + *

+ * 
+ * MyProtoSettings myProtoSettings =
+ *     MyProtoSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MyProtoClient myProtoClient =
+ *     MyProtoClient.create(myProtoSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * MyProtoSettings myProtoSettings =
+ *     MyProtoSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MyProtoClient myProtoClient =
+ *     MyProtoClient.create(myProtoSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class MyProtoClient implements BackgroundResource { + private final MyProtoSettings settings; + private final MyProtoStub stub; + + + + /** + * Constructs an instance of MyProtoClient with default settings. + */ + public static final MyProtoClient create() throws IOException { + return create(MyProtoSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MyProtoClient, using the given settings. + * The channels are created based on the settings passed in, or defaults for any + * settings that are not set. + */ + public static final MyProtoClient create(MyProtoSettings settings) throws IOException { + return new MyProtoClient(settings); + } + + /** + * Constructs an instance of MyProtoClient, using the given stub for making calls. This is for + * advanced usage - prefer to use MyProtoSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final MyProtoClient create(MyProtoStub stub) { + return new MyProtoClient(stub); + } + + /** + * Constructs an instance of MyProtoClient, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected MyProtoClient(MyProtoSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MyProtoStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected MyProtoClient(MyProtoStub stub) { + this.settings = null; + this.stub = stub; + } + + public final MyProtoSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public MyProtoStub getStub() { + return stub; + } + + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
+   *   MethodRequest request = MethodRequest.newBuilder().build();
+   *   MethodResponse response = myProtoClient.myMethod(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MethodResponse myMethod(MethodRequest request) { + return myMethodCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
+   *   MethodRequest request = MethodRequest.newBuilder().build();
+   *   ApiFuture<MethodResponse> future = myProtoClient.myMethodCallable().futureCall(request);
+   *   // Do something
+   *   MethodResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable myMethodCallable() { + return stub.myMethodCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + +} +============== file: src/main/java/com/google/example/library/v1/MyProtoSettings.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.example.library.v1.stub.MyProtoStubSettings; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import com.google.protos.google.example.library.v1.MyProtoGrpc; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link MyProtoClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (library-example.googleapis.com) and default port (1234) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. + * + * For example, to set the total timeout of myMethod to 30 seconds: + * + *

+ * 
+ * MyProtoSettings.Builder myProtoSettingsBuilder =
+ *     MyProtoSettings.newBuilder();
+ * myProtoSettingsBuilder.myMethodSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * MyProtoSettings myProtoSettings = myProtoSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class MyProtoSettings extends ClientSettings { + /** + * Returns the object with the settings used for calls to myMethod. + */ + public UnaryCallSettings myMethodSettings() { + return ((MyProtoStubSettings) getStubSettings()).myMethodSettings(); + } + + + public static final MyProtoSettings create(MyProtoStubSettings stub) throws IOException { + return new MyProtoSettings.Builder(stub.toBuilder()).build(); + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MyProtoStubSettings.defaultExecutorProviderBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return MyProtoStubSettings.getDefaultEndpoint(); + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return MyProtoStubSettings.getDefaultServiceScopes(); + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MyProtoStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MyProtoStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MyProtoStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MyProtoStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MyProtoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** + * Builder for MyProtoSettings. + */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(MyProtoStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(MyProtoStubSettings.newBuilder()); + } + + protected Builder(MyProtoSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MyProtoStubSettings.Builder stubSettings) { + super(stubSettings); + } + + + public MyProtoStubSettings.Builder getStubSettingsBuilder() { + return ((MyProtoStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** + * Returns the builder for the settings used for calls to myMethod. + */ + public UnaryCallSettings.Builder myMethodSettings() { + return getStubSettingsBuilder().myMethodSettings(); + } + + @Override + public MyProtoSettings build() throws IOException { + return new MyProtoSettings(this); + } + } +} +============== file: src/main/java/com/google/example/library/v1/package-info.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Google Example Library API. + * + * The interfaces provided are listed below, along with usage samples. + * + * ============= + * LibraryClient + * ============= + * + * Service Description: This API represents a simple digital library. It lets you manage Shelf + * resources and Book resources in the library. It defines the following + * resource model: + * + * - The API has a collection of [Shelf][google.example.library.v1.Shelf] + * resources, named ``bookShelves/*`` + * + * - Each Shelf has a collection of [Book][google.example.library.v1.Book] + * resources, named `bookShelves/*/books/*` + * + * Check out [cloud docs!](/library/example/link). + * This is [not a cloud link](http://www.google.com). + * + * Service comment may include special characters: <>&"`'{@literal @}. + * + * Also see this awesome doc there! and there! and everywhere! + * + * Sample for LibraryClient: + *
+ * 
+ * try (LibraryClient libraryClient = LibraryClient.create()) {
+ *   Shelf shelf = Shelf.newBuilder().build();
+ *   Shelf response = libraryClient.createShelf(shelf);
+ * }
+ * 
+ * 
+ * + * ============= + * MyProtoClient + * ============= + * + * Service Description: + * + * Sample for MyProtoClient: + *
+ * 
+ * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
+ *   MethodRequest request = MethodRequest.newBuilder().build();
+ *   MethodResponse response = myProtoClient.myMethod(request);
+ * }
+ * 
+ * 
+ * + */ +@Generated("by gapic-generator") +package com.google.example.library.v1; + +import javax.annotation.Generated; +============== file: src/main/java/com/google/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.ImmutableMap; +import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveName; +import com.google.example.library.v1.ArchivedBookName; +import com.google.example.library.v1.BillingAccountName; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromAnywhere; +import com.google.example.library.v1.BookFromArchive; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.Comment; +import com.google.example.library.v1.CreateBookRequest; +import com.google.example.library.v1.CreateShelfRequest; +import com.google.example.library.v1.DeleteBookRequest; +import com.google.example.library.v1.DeleteShelfRequest; +import com.google.example.library.v1.DiscussBookRequest; +import com.google.example.library.v1.FieldMask; +import com.google.example.library.v1.FindRelatedBooksRequest; +import com.google.example.library.v1.FindRelatedBooksResponse; +import com.google.example.library.v1.FolderName; +import com.google.example.library.v1.GetBigBookMetadata; +import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; +import com.google.example.library.v1.GetBookFromAnywhereRequest; +import com.google.example.library.v1.GetBookFromArchiveRequest; +import com.google.example.library.v1.GetBookRequest; +import com.google.example.library.v1.GetShelfRequest; +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; +import com.google.example.library.v1.LibrarySettings; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListPublishersRequest; +import com.google.example.library.v1.ListPublishersResponse; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.ListShelvesResponse; +import com.google.example.library.v1.ListStringsRequest; +import com.google.example.library.v1.ListStringsResponse; +import com.google.example.library.v1.LocationName; +import com.google.example.library.v1.MergeShelvesRequest; +import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.OrganizationName; +import com.google.example.library.v1.ProjectName; +import com.google.example.library.v1.PublishSeriesRequest; +import com.google.example.library.v1.PublishSeriesResponse; +import com.google.example.library.v1.Publisher; +import com.google.example.library.v1.PublisherName; +import com.google.example.library.v1.SeriesUuid; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; +import com.google.example.library.v1.SomeMessage; +import com.google.example.library.v1.StreamBooksRequest; +import com.google.example.library.v1.StreamShelvesRequest; +import com.google.example.library.v1.StreamShelvesResponse; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; +import com.google.example.library.v1.UpdateBookIndexRequest; +import com.google.example.library.v1.UpdateBookRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Any; +import com.google.protobuf.BoolValue; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.DoubleValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FloatValue; +import com.google.protobuf.Int32Value; +import com.google.protobuf.Int64Value; +import com.google.protobuf.ListValue; +import com.google.protobuf.StringValue; +import com.google.protobuf.Struct; +import com.google.protobuf.Timestamp; +import com.google.protobuf.UInt32Value; +import com.google.protobuf.UInt64Value; +import com.google.protobuf.Value; +import com.google.tagger.v1.TaggerProto.AddLabelRequest; +import com.google.tagger.v1.TaggerProto.AddLabelResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Google Example Library API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcLibraryServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable(grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + @Override + public OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable(grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + } +} +============== file: src/main/java/com/google/example/library/v1/stub/GrpcLibraryServiceStub.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.ImmutableMap; +import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveName; +import com.google.example.library.v1.ArchivedBookName; +import com.google.example.library.v1.BillingAccountName; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromAnywhere; +import com.google.example.library.v1.BookFromArchive; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.Comment; +import com.google.example.library.v1.CreateBookRequest; +import com.google.example.library.v1.CreateShelfRequest; +import com.google.example.library.v1.DeleteBookRequest; +import com.google.example.library.v1.DeleteShelfRequest; +import com.google.example.library.v1.DiscussBookRequest; +import com.google.example.library.v1.FieldMask; +import com.google.example.library.v1.FindRelatedBooksRequest; +import com.google.example.library.v1.FindRelatedBooksResponse; +import com.google.example.library.v1.FolderName; +import com.google.example.library.v1.GetBigBookMetadata; +import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; +import com.google.example.library.v1.GetBookFromAnywhereRequest; +import com.google.example.library.v1.GetBookFromArchiveRequest; +import com.google.example.library.v1.GetBookRequest; +import com.google.example.library.v1.GetShelfRequest; +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; +import com.google.example.library.v1.LibrarySettings; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListPublishersRequest; +import com.google.example.library.v1.ListPublishersResponse; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.ListShelvesResponse; +import com.google.example.library.v1.ListStringsRequest; +import com.google.example.library.v1.ListStringsResponse; +import com.google.example.library.v1.LocationName; +import com.google.example.library.v1.MergeShelvesRequest; +import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.OrganizationName; +import com.google.example.library.v1.ProjectName; +import com.google.example.library.v1.PublishSeriesRequest; +import com.google.example.library.v1.PublishSeriesResponse; +import com.google.example.library.v1.Publisher; +import com.google.example.library.v1.PublisherName; +import com.google.example.library.v1.SeriesUuid; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; +import com.google.example.library.v1.SomeMessage; +import com.google.example.library.v1.StreamBooksRequest; +import com.google.example.library.v1.StreamShelvesRequest; +import com.google.example.library.v1.StreamShelvesResponse; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; +import com.google.example.library.v1.UpdateBookIndexRequest; +import com.google.example.library.v1.UpdateBookRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Any; +import com.google.protobuf.BoolValue; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.DoubleValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FloatValue; +import com.google.protobuf.Int32Value; +import com.google.protobuf.Int64Value; +import com.google.protobuf.ListValue; +import com.google.protobuf.StringValue; +import com.google.protobuf.Struct; +import com.google.protobuf.Timestamp; +import com.google.protobuf.UInt32Value; +import com.google.protobuf.UInt64Value; +import com.google.protobuf.Value; +import com.google.tagger.v1.TaggerProto.AddLabelRequest; +import com.google.tagger.v1.TaggerProto.AddLabelResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Google Example Library API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcLibraryServiceStub extends LibraryServiceStub { + + private static final MethodDescriptor createShelfMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/CreateShelf") + .setRequestMarshaller(ProtoUtils.marshaller(CreateShelfRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) + .build(); + private static final MethodDescriptor getShelfMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/GetShelf") + .setRequestMarshaller(ProtoUtils.marshaller(GetShelfRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) + .build(); + private static final MethodDescriptor listShelvesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/ListShelves") + .setRequestMarshaller(ProtoUtils.marshaller(ListShelvesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListShelvesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteShelfMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/DeleteShelf") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteShelfRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor mergeShelvesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/MergeShelves") + .setRequestMarshaller(ProtoUtils.marshaller(MergeShelvesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) + .build(); + private static final MethodDescriptor createBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/CreateBook") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .build(); + private static final MethodDescriptor publishSeriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/PublishSeries") + .setRequestMarshaller(ProtoUtils.marshaller(PublishSeriesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PublishSeriesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/GetBook") + .setRequestMarshaller(ProtoUtils.marshaller(GetBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .build(); + private static final MethodDescriptor listBooksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/ListBooks") + .setRequestMarshaller(ProtoUtils.marshaller(ListBooksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListBooksResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/DeleteBook") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/UpdateBook") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .build(); + private static final MethodDescriptor moveBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/MoveBook") + .setRequestMarshaller(ProtoUtils.marshaller(MoveBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .build(); + private static final MethodDescriptor listStringsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/ListStrings") + .setRequestMarshaller(ProtoUtils.marshaller(ListStringsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListStringsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor addCommentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/AddComments") + .setRequestMarshaller(ProtoUtils.marshaller(AddCommentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBookFromArchiveMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/GetBookFromArchive") + .setRequestMarshaller(ProtoUtils.marshaller(GetBookFromArchiveRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BookFromArchive.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBookFromAnywhereMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/GetBookFromAnywhere") + .setRequestMarshaller(ProtoUtils.marshaller(GetBookFromAnywhereRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BookFromAnywhere.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBookFromAbsolutelyAnywhereMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/GetBookFromAbsolutelyAnywhere") + .setRequestMarshaller(ProtoUtils.marshaller(GetBookFromAbsolutelyAnywhereRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BookFromAnywhere.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateBookIndexMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/UpdateBookIndex") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBookIndexRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor streamShelvesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.example.library.v1.LibraryService/StreamShelves") + .setRequestMarshaller(ProtoUtils.marshaller(StreamShelvesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StreamShelvesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor streamBooksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.example.library.v1.LibraryService/StreamBooks") + .setRequestMarshaller(ProtoUtils.marshaller(StreamBooksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .build(); + private static final MethodDescriptor discussBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.example.library.v1.LibraryService/DiscussBook") + .setRequestMarshaller(ProtoUtils.marshaller(DiscussBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Comment.getDefaultInstance())) + .build(); + private static final MethodDescriptor monologAboutBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.example.library.v1.LibraryService/MonologAboutBook") + .setRequestMarshaller(ProtoUtils.marshaller(DiscussBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Comment.getDefaultInstance())) + .build(); + private static final MethodDescriptor babbleAboutBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.example.library.v1.LibraryService/BabbleAboutBook") + .setRequestMarshaller(ProtoUtils.marshaller(DiscussBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor findRelatedBooksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/FindRelatedBooks") + .setRequestMarshaller(ProtoUtils.marshaller(FindRelatedBooksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(FindRelatedBooksResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor addLabelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.tagger.v1.Labeler/AddLabel") + .setRequestMarshaller(ProtoUtils.marshaller(AddLabelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AddLabelResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBigBookMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/GetBigBook") + .setRequestMarshaller(ProtoUtils.marshaller(GetBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBigNothingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/GetBigNothing") + .setRequestMarshaller(ProtoUtils.marshaller(GetBookRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor testOptionalRequiredFlatteningParamsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/TestOptionalRequiredFlatteningParams") + .setRequestMarshaller(ProtoUtils.marshaller(TestOptionalRequiredFlatteningParamsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(TestOptionalRequiredFlatteningParamsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor listPublishersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/ListPublishers") + .setRequestMarshaller(ProtoUtils.marshaller(ListPublishersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListPublishersResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor privateListShelvesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/PrivateListShelves") + .setRequestMarshaller(ProtoUtils.marshaller(ListShelvesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .build(); + + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createShelfCallable; + private final UnaryCallable getShelfCallable; + private final UnaryCallable listShelvesCallable; + private final UnaryCallable listShelvesPagedCallable; + private final UnaryCallable deleteShelfCallable; + private final UnaryCallable mergeShelvesCallable; + private final UnaryCallable createBookCallable; + private final UnaryCallable publishSeriesCallable; + private final UnaryCallable getBookCallable; + private final UnaryCallable listBooksCallable; + private final UnaryCallable listBooksPagedCallable; + private final UnaryCallable deleteBookCallable; + private final UnaryCallable updateBookCallable; + private final UnaryCallable moveBookCallable; + private final UnaryCallable listStringsCallable; + private final UnaryCallable listStringsPagedCallable; + private final UnaryCallable addCommentsCallable; + private final UnaryCallable getBookFromArchiveCallable; + private final UnaryCallable getBookFromAnywhereCallable; + private final UnaryCallable getBookFromAbsolutelyAnywhereCallable; + private final UnaryCallable updateBookIndexCallable; + private final ServerStreamingCallable streamShelvesCallable; + private final ServerStreamingCallable streamBooksCallable; + private final BidiStreamingCallable discussBookCallable; + private final ClientStreamingCallable monologAboutBookCallable; + private final ClientStreamingCallable babbleAboutBookCallable; + private final UnaryCallable findRelatedBooksCallable; + private final UnaryCallable findRelatedBooksPagedCallable; + private final UnaryCallable addLabelCallable; + private final UnaryCallable getBigBookCallable; + private final OperationCallable getBigBookOperationCallable; + private final UnaryCallable getBigNothingCallable; + private final OperationCallable getBigNothingOperationCallable; + private final UnaryCallable testOptionalRequiredFlatteningParamsCallable; + private final UnaryCallable listPublishersCallable; + private final UnaryCallable listPublishersPagedCallable; + private final UnaryCallable privateListShelvesCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcLibraryServiceStub create(LibraryServiceStubSettings settings) throws IOException { + return new GrpcLibraryServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcLibraryServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcLibraryServiceStub(LibraryServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcLibraryServiceStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcLibraryServiceStub(LibraryServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcLibraryServiceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected GrpcLibraryServiceStub(LibraryServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcLibraryServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcLibraryServiceStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected GrpcLibraryServiceStub(LibraryServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createShelfTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createShelfMethodDescriptor) + .build(); + GrpcCallSettings getShelfTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getShelfMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetShelfRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listShelvesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listShelvesMethodDescriptor) + .build(); + GrpcCallSettings deleteShelfTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteShelfMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteShelfRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings mergeShelvesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(mergeShelvesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MergeShelvesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateBookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings publishSeriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(publishSeriesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PublishSeriesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("shelf.name", String.valueOf(request.getShelf().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listBooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBooksMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListBooksRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteBookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings moveBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(moveBookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MoveBookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listStringsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listStringsMethodDescriptor) + .build(); + GrpcCallSettings addCommentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addCommentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AddCommentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBookFromArchiveTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBookFromArchiveMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBookFromArchiveRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBookFromAnywhereTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBookFromAnywhereMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBookFromAnywhereRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBookFromAbsolutelyAnywhereTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBookFromAbsolutelyAnywhereMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBookFromAbsolutelyAnywhereRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + params.put("alt_book_name", String.valueOf(request.getAltBookName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateBookIndexTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBookIndexMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBookIndexRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings streamShelvesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamShelvesMethodDescriptor) + .build(); + GrpcCallSettings streamBooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamBooksMethodDescriptor) + .build(); + GrpcCallSettings discussBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(discussBookMethodDescriptor) + .build(); + GrpcCallSettings monologAboutBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(monologAboutBookMethodDescriptor) + .build(); + GrpcCallSettings babbleAboutBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(babbleAboutBookMethodDescriptor) + .build(); + GrpcCallSettings findRelatedBooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(findRelatedBooksMethodDescriptor) + .build(); + GrpcCallSettings addLabelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addLabelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AddLabelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBigBookTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBigBookMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBigNothingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBigNothingMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBookRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings testOptionalRequiredFlatteningParamsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testOptionalRequiredFlatteningParamsMethodDescriptor) + .build(); + GrpcCallSettings listPublishersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPublishersMethodDescriptor) + .build(); + GrpcCallSettings privateListShelvesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(privateListShelvesMethodDescriptor) + .build(); + + this.createShelfCallable = callableFactory.createUnaryCallable(createShelfTransportSettings,settings.createShelfSettings(), clientContext); + this.getShelfCallable = callableFactory.createUnaryCallable(getShelfTransportSettings,settings.getShelfSettings(), clientContext); + this.listShelvesCallable = callableFactory.createUnaryCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); + this.listShelvesPagedCallable = callableFactory.createPagedCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); + this.deleteShelfCallable = callableFactory.createUnaryCallable(deleteShelfTransportSettings,settings.deleteShelfSettings(), clientContext); + this.mergeShelvesCallable = callableFactory.createUnaryCallable(mergeShelvesTransportSettings,settings.mergeShelvesSettings(), clientContext); + this.createBookCallable = callableFactory.createUnaryCallable(createBookTransportSettings,settings.createBookSettings(), clientContext); + this.publishSeriesCallable = callableFactory.createBatchingCallable(publishSeriesTransportSettings,settings.publishSeriesSettings(), clientContext); + this.getBookCallable = callableFactory.createUnaryCallable(getBookTransportSettings,settings.getBookSettings(), clientContext); + this.listBooksCallable = callableFactory.createUnaryCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); + this.listBooksPagedCallable = callableFactory.createPagedCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); + this.deleteBookCallable = callableFactory.createUnaryCallable(deleteBookTransportSettings,settings.deleteBookSettings(), clientContext); + this.updateBookCallable = callableFactory.createUnaryCallable(updateBookTransportSettings,settings.updateBookSettings(), clientContext); + this.moveBookCallable = callableFactory.createUnaryCallable(moveBookTransportSettings,settings.moveBookSettings(), clientContext); + this.listStringsCallable = callableFactory.createUnaryCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); + this.listStringsPagedCallable = callableFactory.createPagedCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); + this.addCommentsCallable = callableFactory.createBatchingCallable(addCommentsTransportSettings,settings.addCommentsSettings(), clientContext); + this.getBookFromArchiveCallable = callableFactory.createUnaryCallable(getBookFromArchiveTransportSettings,settings.getBookFromArchiveSettings(), clientContext); + this.getBookFromAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAnywhereTransportSettings,settings.getBookFromAnywhereSettings(), clientContext); + this.getBookFromAbsolutelyAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAbsolutelyAnywhereTransportSettings,settings.getBookFromAbsolutelyAnywhereSettings(), clientContext); + this.updateBookIndexCallable = callableFactory.createUnaryCallable(updateBookIndexTransportSettings,settings.updateBookIndexSettings(), clientContext); + this.streamShelvesCallable = callableFactory.createServerStreamingCallable(streamShelvesTransportSettings,settings.streamShelvesSettings(), clientContext); + this.streamBooksCallable = callableFactory.createServerStreamingCallable(streamBooksTransportSettings,settings.streamBooksSettings(), clientContext); + this.discussBookCallable = callableFactory.createBidiStreamingCallable(discussBookTransportSettings,settings.discussBookSettings(), clientContext); + this.monologAboutBookCallable = callableFactory.createClientStreamingCallable(monologAboutBookTransportSettings,settings.monologAboutBookSettings(), clientContext); + this.babbleAboutBookCallable = callableFactory.createClientStreamingCallable(babbleAboutBookTransportSettings,settings.babbleAboutBookSettings(), clientContext); + this.findRelatedBooksCallable = callableFactory.createUnaryCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); + this.findRelatedBooksPagedCallable = callableFactory.createPagedCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); + this.addLabelCallable = callableFactory.createUnaryCallable(addLabelTransportSettings,settings.addLabelSettings(), clientContext); + this.getBigBookCallable = callableFactory.createUnaryCallable(getBigBookTransportSettings,settings.getBigBookSettings(), clientContext); + this.getBigBookOperationCallable = callableFactory.createOperationCallable( + getBigBookTransportSettings,settings.getBigBookOperationSettings(), clientContext, this.operationsStub); + this.getBigNothingCallable = callableFactory.createUnaryCallable(getBigNothingTransportSettings,settings.getBigNothingSettings(), clientContext); + this.getBigNothingOperationCallable = callableFactory.createOperationCallable( + getBigNothingTransportSettings,settings.getBigNothingOperationSettings(), clientContext, this.operationsStub); + this.testOptionalRequiredFlatteningParamsCallable = callableFactory.createUnaryCallable(testOptionalRequiredFlatteningParamsTransportSettings,settings.testOptionalRequiredFlatteningParamsSettings(), clientContext); + this.listPublishersCallable = callableFactory.createUnaryCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); + this.listPublishersPagedCallable = callableFactory.createPagedCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); + this.privateListShelvesCallable = callableFactory.createUnaryCallable(privateListShelvesTransportSettings,settings.privateListShelvesSettings(), clientContext); + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } - public LibraryServiceStubSettings.Builder getStubSettingsBuilder() { - return ((LibraryServiceStubSettings.Builder) getStubSettings()); - } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + public UnaryCallable createShelfCallable() { + return createShelfCallable; + } - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } + public UnaryCallable getShelfCallable() { + return getShelfCallable; + } - /** - * Returns the builder for the settings used for calls to createShelf. - */ - public UnaryCallSettings.Builder createShelfSettings() { - return getStubSettingsBuilder().createShelfSettings(); - } + public UnaryCallable listShelvesPagedCallable() { + return listShelvesPagedCallable; + } + + public UnaryCallable listShelvesCallable() { + return listShelvesCallable; + } + + public UnaryCallable deleteShelfCallable() { + return deleteShelfCallable; + } + + public UnaryCallable mergeShelvesCallable() { + return mergeShelvesCallable; + } + + public UnaryCallable createBookCallable() { + return createBookCallable; + } + + public UnaryCallable publishSeriesCallable() { + return publishSeriesCallable; + } + + public UnaryCallable getBookCallable() { + return getBookCallable; + } + + public UnaryCallable listBooksPagedCallable() { + return listBooksPagedCallable; + } - /** - * Returns the builder for the settings used for calls to getShelf. - */ - public UnaryCallSettings.Builder getShelfSettings() { - return getStubSettingsBuilder().getShelfSettings(); - } + public UnaryCallable listBooksCallable() { + return listBooksCallable; + } - /** - * Returns the builder for the settings used for calls to listShelves. - */ - public PagedCallSettings.Builder listShelvesSettings() { - return getStubSettingsBuilder().listShelvesSettings(); - } + public UnaryCallable deleteBookCallable() { + return deleteBookCallable; + } - /** - * Returns the builder for the settings used for calls to deleteShelf. - */ - public UnaryCallSettings.Builder deleteShelfSettings() { - return getStubSettingsBuilder().deleteShelfSettings(); - } + public UnaryCallable updateBookCallable() { + return updateBookCallable; + } - /** - * Returns the builder for the settings used for calls to mergeShelves. - */ - public UnaryCallSettings.Builder mergeShelvesSettings() { - return getStubSettingsBuilder().mergeShelvesSettings(); - } + public UnaryCallable moveBookCallable() { + return moveBookCallable; + } - /** - * Returns the builder for the settings used for calls to createBook. - */ - public UnaryCallSettings.Builder createBookSettings() { - return getStubSettingsBuilder().createBookSettings(); - } + public UnaryCallable listStringsPagedCallable() { + return listStringsPagedCallable; + } - /** - * Returns the builder for the settings used for calls to publishSeries. - */ - public BatchingCallSettings.Builder publishSeriesSettings() { - return getStubSettingsBuilder().publishSeriesSettings(); - } + public UnaryCallable listStringsCallable() { + return listStringsCallable; + } - /** - * Returns the builder for the settings used for calls to getBook. - */ - public UnaryCallSettings.Builder getBookSettings() { - return getStubSettingsBuilder().getBookSettings(); - } + public UnaryCallable addCommentsCallable() { + return addCommentsCallable; + } - /** - * Returns the builder for the settings used for calls to listBooks. - */ - public PagedCallSettings.Builder listBooksSettings() { - return getStubSettingsBuilder().listBooksSettings(); - } + public UnaryCallable getBookFromArchiveCallable() { + return getBookFromArchiveCallable; + } - /** - * Returns the builder for the settings used for calls to deleteBook. - */ - public UnaryCallSettings.Builder deleteBookSettings() { - return getStubSettingsBuilder().deleteBookSettings(); - } + public UnaryCallable getBookFromAnywhereCallable() { + return getBookFromAnywhereCallable; + } - /** - * Returns the builder for the settings used for calls to updateBook. - */ - public UnaryCallSettings.Builder updateBookSettings() { - return getStubSettingsBuilder().updateBookSettings(); - } + public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { + return getBookFromAbsolutelyAnywhereCallable; + } - /** - * Returns the builder for the settings used for calls to moveBook. - */ - public UnaryCallSettings.Builder moveBookSettings() { - return getStubSettingsBuilder().moveBookSettings(); - } + public UnaryCallable updateBookIndexCallable() { + return updateBookIndexCallable; + } - /** - * Returns the builder for the settings used for calls to listStrings. - */ - public PagedCallSettings.Builder listStringsSettings() { - return getStubSettingsBuilder().listStringsSettings(); - } + public ServerStreamingCallable streamShelvesCallable() { + return streamShelvesCallable; + } - /** - * Returns the builder for the settings used for calls to addComments. - */ - public BatchingCallSettings.Builder addCommentsSettings() { - return getStubSettingsBuilder().addCommentsSettings(); - } + public ServerStreamingCallable streamBooksCallable() { + return streamBooksCallable; + } - /** - * Returns the builder for the settings used for calls to getBookFromArchive. - */ - public UnaryCallSettings.Builder getBookFromArchiveSettings() { - return getStubSettingsBuilder().getBookFromArchiveSettings(); - } + public BidiStreamingCallable discussBookCallable() { + return discussBookCallable; + } - /** - * Returns the builder for the settings used for calls to getBookFromAnywhere. - */ - public UnaryCallSettings.Builder getBookFromAnywhereSettings() { - return getStubSettingsBuilder().getBookFromAnywhereSettings(); - } + public ClientStreamingCallable monologAboutBookCallable() { + return monologAboutBookCallable; + } - /** - * Returns the builder for the settings used for calls to getBookFromAbsolutelyAnywhere. - */ - public UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings() { - return getStubSettingsBuilder().getBookFromAbsolutelyAnywhereSettings(); - } + public ClientStreamingCallable babbleAboutBookCallable() { + return babbleAboutBookCallable; + } - /** - * Returns the builder for the settings used for calls to updateBookIndex. - */ - public UnaryCallSettings.Builder updateBookIndexSettings() { - return getStubSettingsBuilder().updateBookIndexSettings(); - } + public UnaryCallable findRelatedBooksPagedCallable() { + return findRelatedBooksPagedCallable; + } - /** - * Returns the builder for the settings used for calls to streamShelves. - */ - public ServerStreamingCallSettings.Builder streamShelvesSettings() { - return getStubSettingsBuilder().streamShelvesSettings(); - } + public UnaryCallable findRelatedBooksCallable() { + return findRelatedBooksCallable; + } - /** - * Returns the builder for the settings used for calls to streamBooks. - */ - public ServerStreamingCallSettings.Builder streamBooksSettings() { - return getStubSettingsBuilder().streamBooksSettings(); - } + @Deprecated + public UnaryCallable addLabelCallable() { + return addLabelCallable; + } - /** - * Returns the builder for the settings used for calls to discussBook. - */ - public StreamingCallSettings.Builder discussBookSettings() { - return getStubSettingsBuilder().discussBookSettings(); - } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigBookOperationCallable() { + return getBigBookOperationCallable; + } - /** - * Returns the builder for the settings used for calls to monologAboutBook. - */ - public StreamingCallSettings.Builder monologAboutBookSettings() { - return getStubSettingsBuilder().monologAboutBookSettings(); - } + public UnaryCallable getBigBookCallable() { + return getBigBookCallable; + } - /** - * Returns the builder for the settings used for calls to babbleAboutBook. - */ - public StreamingCallSettings.Builder babbleAboutBookSettings() { - return getStubSettingsBuilder().babbleAboutBookSettings(); - } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigNothingOperationCallable() { + return getBigNothingOperationCallable; + } - /** - * Returns the builder for the settings used for calls to findRelatedBooks. - */ - public PagedCallSettings.Builder findRelatedBooksSettings() { - return getStubSettingsBuilder().findRelatedBooksSettings(); - } + public UnaryCallable getBigNothingCallable() { + return getBigNothingCallable; + } - /** - * Returns the builder for the settings used for calls to addLabel. - */ - /* package-private */ UnaryCallSettings.Builder addLabelSettings() { - return getStubSettingsBuilder().addLabelSettings(); - } + public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { + return testOptionalRequiredFlatteningParamsCallable; + } - /** - * Returns the builder for the settings used for calls to getBigBook. - */ - public UnaryCallSettings.Builder getBigBookSettings() { - return getStubSettingsBuilder().getBigBookSettings(); - } + public UnaryCallable listPublishersPagedCallable() { + return listPublishersPagedCallable; + } - /** - * Returns the builder for the settings used for calls to getBigBook. - */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder getBigBookOperationSettings() { - return getStubSettingsBuilder().getBigBookOperationSettings(); - } + public UnaryCallable listPublishersCallable() { + return listPublishersCallable; + } - /** - * Returns the builder for the settings used for calls to getBigNothing. - */ - public UnaryCallSettings.Builder getBigNothingSettings() { - return getStubSettingsBuilder().getBigNothingSettings(); - } + public UnaryCallable privateListShelvesCallable() { + return privateListShelvesCallable; + } - /** - * Returns the builder for the settings used for calls to getBigNothing. - */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder getBigNothingOperationSettings() { - return getStubSettingsBuilder().getBigNothingOperationSettings(); - } + @Override + public final void close() { + shutdown(); + } - /** - * Returns the builder for the settings used for calls to testOptionalRequiredFlatteningParams. - */ - public UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings() { - return getStubSettingsBuilder().testOptionalRequiredFlatteningParamsSettings(); - } + @Override + public void shutdown() { + backgroundResources.shutdown(); + } - /** - * Returns the builder for the settings used for calls to privateListShelves. - */ - public UnaryCallSettings.Builder privateListShelvesSettings() { - return getStubSettingsBuilder().privateListShelvesSettings(); - } + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } - @Override - public LibrarySettings build() throws IOException { - return new LibrarySettings(this); - } + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + } -============== file: src/main/java/com/google/example/library/v1/MyProtoClient.java ============== +============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoCallableFactory.java ============== /* * Copyright 2020 Google LLC * @@ -9733,231 +13177,107 @@ public class LibrarySettings extends ClientSettings { * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.example.library.v1; +package com.google.example.library.v1.stub; -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.paging.FixedSizeCollection; -import com.google.api.gax.paging.Page; -import com.google.api.gax.rpc.ApiExceptions; -import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.example.library.v1.stub.MyProtoStub; -import com.google.example.library.v1.stub.MyProtoStubSettings; +import com.google.common.collect.ImmutableMap; +import com.google.example.library.v1.MyProtoSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import java.io.Closeable; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Iterator; +import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS /** - * Service Description: - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

- * 
- * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
- *   MethodRequest request = MethodRequest.newBuilder().build();
- *   MethodResponse response = myProtoClient.myMethod(request);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the myProtoClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). - * - *

The surface of this class includes several types of Java methods for each of the API's methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable - * API callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. - * - *

This class can be customized by passing in a custom instance of MyProtoSettings to - * create(). For example: - * - * To customize credentials: - * - *

- * 
- * MyProtoSettings myProtoSettings =
- *     MyProtoSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * MyProtoClient myProtoClient =
- *     MyProtoClient.create(myProtoSettings);
- * 
- * 
- * - * To customize the endpoint: + * gRPC callable factory implementation for Google Example Library API. * - *
- * 
- * MyProtoSettings myProtoSettings =
- *     MyProtoSettings.newBuilder().setEndpoint(myEndpoint).build();
- * MyProtoClient myProtoClient =
- *     MyProtoClient.create(myProtoSettings);
- * 
- * 
+ *

This class is for advanced usage. */ @Generated("by gapic-generator") -public class MyProtoClient implements BackgroundResource { - private final MyProtoSettings settings; - private final MyProtoStub stub; - - - - /** - * Constructs an instance of MyProtoClient with default settings. - */ - public static final MyProtoClient create() throws IOException { - return create(MyProtoSettings.newBuilder().build()); - } - - /** - * Constructs an instance of MyProtoClient, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. - */ - public static final MyProtoClient create(MyProtoSettings settings) throws IOException { - return new MyProtoClient(settings); - } - - /** - * Constructs an instance of MyProtoClient, using the given stub for making calls. This is for - * advanced usage - prefer to use MyProtoSettings}. - */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public static final MyProtoClient create(MyProtoStub stub) { - return new MyProtoClient(stub); - } - - /** - * Constructs an instance of MyProtoClient, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected MyProtoClient(MyProtoSettings settings) throws IOException { - this.settings = settings; - this.stub = ((MyProtoStubSettings) settings.getStubSettings()).createStub(); - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - protected MyProtoClient(MyProtoStub stub) { - this.settings = null; - this.stub = stub; - } - - public final MyProtoSettings getSettings() { - return settings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public MyProtoStub getStub() { - return stub; - } - - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *


-   * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
-   *   MethodRequest request = MethodRequest.newBuilder().build();
-   *   MethodResponse response = myProtoClient.myMethod(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final MethodResponse myMethod(MethodRequest request) { - return myMethodCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
-   *   MethodRequest request = MethodRequest.newBuilder().build();
-   *   ApiFuture<MethodResponse> future = myProtoClient.myMethodCallable().futureCall(request);
-   *   // Do something
-   *   MethodResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable myMethodCallable() { - return stub.myMethodCallable(); +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcMyProtoCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); } @Override - public final void close() { - stub.close(); + public UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, pagedCallSettings, clientContext); } @Override - public void shutdown() { - stub.shutdown(); + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable(grpcCallSettings, batchingCallSettings, clientContext); } + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") @Override - public boolean isShutdown() { - return stub.isShutdown(); + public OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable(grpcCallSettings, operationCallSettings, clientContext, operationsStub); } @Override - public boolean isTerminated() { - return stub.isTerminated(); + public BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); } @Override - public void shutdownNow() { - stub.shutdownNow(); + public ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); } @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); + public ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); } - - } -============== file: src/main/java/com/google/example/library/v1/MyProtoSettings.java ============== +============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoStub.java ============== /* * Copyright 2020 Google LLC * @@ -9973,283 +13293,131 @@ public class MyProtoClient implements BackgroundResource { * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.example.library.v1; +package com.google.example.library.v1.stub; -import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; -import com.google.common.collect.ImmutableList; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.example.library.v1.stub.MyProtoStubSettings; +import com.google.example.library.v1.MyProtoSettings; import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import com.google.protos.google.example.library.v1.MyProtoGrpc; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; import java.io.IOException; +import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ScheduledExecutorService; +import java.util.Map; +import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS /** - * Settings class to configure an instance of {@link MyProtoClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (library-example.googleapis.com) and default port (1234) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. - * - * For example, to set the total timeout of myMethod to 30 seconds: + * gRPC stub implementation for Google Example Library API. * - *

- * 
- * MyProtoSettings.Builder myProtoSettingsBuilder =
- *     MyProtoSettings.newBuilder();
- * myProtoSettingsBuilder.myMethodSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * MyProtoSettings myProtoSettings = myProtoSettingsBuilder.build();
- * 
- * 
+ *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -public class MyProtoSettings extends ClientSettings { - /** - * Returns the object with the settings used for calls to myMethod. - */ - public UnaryCallSettings myMethodSettings() { - return ((MyProtoStubSettings) getStubSettings()).myMethodSettings(); - } - - - public static final MyProtoSettings create(MyProtoStubSettings stub) throws IOException { - return new MyProtoSettings.Builder(stub.toBuilder()).build(); - } - - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return MyProtoStubSettings.defaultExecutorProviderBuilder(); - } - - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return MyProtoStubSettings.getDefaultEndpoint(); - } - +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcMyProtoStub extends MyProtoStub { - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return MyProtoStubSettings.getDefaultServiceScopes(); - } + private static final MethodDescriptor myMethodMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.MyProto/MyMethod") + .setRequestMarshaller(ProtoUtils.marshaller(MethodRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(MethodResponse.getDefaultInstance())) + .build(); - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return MyProtoStubSettings.defaultCredentialsProviderBuilder(); - } + private final BackgroundResource backgroundResources; - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return MyProtoStubSettings.defaultGrpcTransportProviderBuilder(); - } + private final UnaryCallable myMethodCallable; - public static TransportChannelProvider defaultTransportChannelProvider() { - return MyProtoStubSettings.defaultTransportChannelProvider(); - } + private final GrpcStubCallableFactory callableFactory; - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return MyProtoStubSettings.defaultApiClientHeaderProviderBuilder(); + public static final GrpcMyProtoStub create(MyProtoStubSettings settings) throws IOException { + return new GrpcMyProtoStub(settings, ClientContext.create(settings)); } - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); + public static final GrpcMyProtoStub create(ClientContext clientContext) throws IOException { + return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext); } - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); + public static final GrpcMyProtoStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext, callableFactory); } /** - * Returns a builder containing all the values of this settings class. + * Constructs an instance of GrpcMyProtoStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected MyProtoSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); + protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcMyProtoCallableFactory()); } /** - * Builder for MyProtoSettings. + * Constructs an instance of GrpcMyProtoStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. */ - public static class Builder extends ClientSettings.Builder { - protected Builder() throws IOException { - this((ClientContext) null); - } + protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; - protected Builder(ClientContext clientContext) { - super(MyProtoStubSettings.newBuilder(clientContext)); - } + GrpcCallSettings myMethodTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(myMethodMethodDescriptor) + .build(); - private static Builder createDefault() { - return new Builder(MyProtoStubSettings.newBuilder()); - } + this.myMethodCallable = callableFactory.createUnaryCallable(myMethodTransportSettings,settings.myMethodSettings(), clientContext); - protected Builder(MyProtoSettings settings) { - super(settings.getStubSettings().toBuilder()); - } + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } - protected Builder(MyProtoStubSettings.Builder stubSettings) { - super(stubSettings); - } + public UnaryCallable myMethodCallable() { + return myMethodCallable; + } - public MyProtoStubSettings.Builder getStubSettingsBuilder() { - return ((MyProtoStubSettings.Builder) getStubSettings()); - } + @Override + public final void close() { + shutdown(); + } - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } + @Override + public void shutdown() { + backgroundResources.shutdown(); + } - /** - * Returns the builder for the settings used for calls to myMethod. - */ - public UnaryCallSettings.Builder myMethodSettings() { - return getStubSettingsBuilder().myMethodSettings(); - } + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } - @Override - public MyProtoSettings build() throws IOException { - return new MyProtoSettings(this); - } + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); } -} -============== file: src/main/java/com/google/example/library/v1/package-info.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * A client to Google Example Library API. - * - * The interfaces provided are listed below, along with usage samples. - * - * ============= - * LibraryClient - * ============= - * - * Service Description: This API represents a simple digital library. It lets you manage Shelf - * resources and Book resources in the library. It defines the following - * resource model: - * - * - The API has a collection of [Shelf][google.example.library.v1.Shelf] - * resources, named ``bookShelves/*`` - * - * - Each Shelf has a collection of [Book][google.example.library.v1.Book] - * resources, named `bookShelves/*/books/*` - * - * Check out [cloud docs!](/library/example/link). - * This is [not a cloud link](http://www.google.com). - * - * Service comment may include special characters: <>&"`'{@literal @}. - * - * Also see this awesome doc there! and there! and everywhere! - * - * Sample for LibraryClient: - *

- * 
- * try (LibraryClient libraryClient = LibraryClient.create()) {
- *   Shelf shelf = Shelf.newBuilder().build();
- *   Shelf response = libraryClient.createShelf(shelf);
- * }
- * 
- * 
- * - * ============= - * MyProtoClient - * ============= - * - * Service Description: - * - * Sample for MyProtoClient: - *
- * 
- * try (MyProtoClient myProtoClient = MyProtoClient.create()) {
- *   MethodRequest request = MethodRequest.newBuilder().build();
- *   MethodResponse response = myProtoClient.myMethod(request);
- * }
- * 
- * 
- * - */ -@Generated("by gapic-generator") -package com.google.example.library.v1; + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } -import javax.annotation.Generated; -============== file: src/main/java/com/google/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java ============== + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } + +} +============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStub.java ============== /* * Copyright 2020 Google LLC * @@ -10269,29 +13437,17 @@ package com.google.example.library.v1.stub; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.BatchingCallSettings; import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; -import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; +import com.google.example.library.v1.BillingAccountName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; import com.google.example.library.v1.BookFromArchive; @@ -10302,6 +13458,7 @@ import com.google.example.library.v1.CreateShelfRequest; import com.google.example.library.v1.DeleteBookRequest; import com.google.example.library.v1.DeleteShelfRequest; import com.google.example.library.v1.DiscussBookRequest; +import com.google.example.library.v1.FieldMask; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.FolderName; @@ -10313,11 +13470,13 @@ import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.GetShelfRequest; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.LibrarySettings; import com.google.example.library.v1.ListBooksRequest; import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListPublishersRequest; +import com.google.example.library.v1.ListPublishersResponse; import com.google.example.library.v1.ListShelvesRequest; import com.google.example.library.v1.ListShelvesResponse; import com.google.example.library.v1.ListStringsRequest; @@ -10325,9 +13484,11 @@ import com.google.example.library.v1.ListStringsResponse; import com.google.example.library.v1.LocationName; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.OrganizationName; import com.google.example.library.v1.ProjectName; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; +import com.google.example.library.v1.Publisher; import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; @@ -10342,7 +13503,6 @@ import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRespons import com.google.example.library.v1.UpdateBookIndexRequest; import com.google.example.library.v1.UpdateBookRequest; import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Any; import com.google.protobuf.BoolValue; @@ -10351,7 +13511,6 @@ import com.google.protobuf.BytesValue; import com.google.protobuf.DoubleValue; import com.google.protobuf.Duration; import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; import com.google.protobuf.FloatValue; import com.google.protobuf.Int32Value; import com.google.protobuf.Int64Value; @@ -10364,80 +13523,180 @@ import com.google.protobuf.UInt64Value; import com.google.protobuf.Value; import com.google.tagger.v1.TaggerProto.AddLabelRequest; import com.google.tagger.v1.TaggerProto.AddLabelResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC callable factory implementation for Google Example Library API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") -public class GrpcLibraryServiceCallableFactory implements GrpcStubCallableFactory { - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Google Example Library API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class LibraryServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createShelfCallable() { + throw new UnsupportedOperationException("Not implemented: createShelfCallable()"); + } + + public UnaryCallable getShelfCallable() { + throw new UnsupportedOperationException("Not implemented: getShelfCallable()"); + } + + public UnaryCallable listShelvesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listShelvesPagedCallable()"); + } + + public UnaryCallable listShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: listShelvesCallable()"); + } + + public UnaryCallable deleteShelfCallable() { + throw new UnsupportedOperationException("Not implemented: deleteShelfCallable()"); + } + + public UnaryCallable mergeShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: mergeShelvesCallable()"); + } + + public UnaryCallable createBookCallable() { + throw new UnsupportedOperationException("Not implemented: createBookCallable()"); + } + + public UnaryCallable publishSeriesCallable() { + throw new UnsupportedOperationException("Not implemented: publishSeriesCallable()"); + } + + public UnaryCallable getBookCallable() { + throw new UnsupportedOperationException("Not implemented: getBookCallable()"); + } + + public UnaryCallable listBooksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBooksPagedCallable()"); + } + + public UnaryCallable listBooksCallable() { + throw new UnsupportedOperationException("Not implemented: listBooksCallable()"); + } + + public UnaryCallable deleteBookCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBookCallable()"); + } + + public UnaryCallable updateBookCallable() { + throw new UnsupportedOperationException("Not implemented: updateBookCallable()"); + } + + public UnaryCallable moveBookCallable() { + throw new UnsupportedOperationException("Not implemented: moveBookCallable()"); + } + + public UnaryCallable listStringsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listStringsPagedCallable()"); + } + + public UnaryCallable listStringsCallable() { + throw new UnsupportedOperationException("Not implemented: listStringsCallable()"); + } + + public UnaryCallable addCommentsCallable() { + throw new UnsupportedOperationException("Not implemented: addCommentsCallable()"); + } + + public UnaryCallable getBookFromArchiveCallable() { + throw new UnsupportedOperationException("Not implemented: getBookFromArchiveCallable()"); + } + + public UnaryCallable getBookFromAnywhereCallable() { + throw new UnsupportedOperationException("Not implemented: getBookFromAnywhereCallable()"); + } + + public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { + throw new UnsupportedOperationException("Not implemented: getBookFromAbsolutelyAnywhereCallable()"); + } + + public UnaryCallable updateBookIndexCallable() { + throw new UnsupportedOperationException("Not implemented: updateBookIndexCallable()"); + } + + public ServerStreamingCallable streamShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: streamShelvesCallable()"); + } + + public ServerStreamingCallable streamBooksCallable() { + throw new UnsupportedOperationException("Not implemented: streamBooksCallable()"); + } + + public BidiStreamingCallable discussBookCallable() { + throw new UnsupportedOperationException("Not implemented: discussBookCallable()"); + } + + public ClientStreamingCallable monologAboutBookCallable() { + throw new UnsupportedOperationException("Not implemented: monologAboutBookCallable()"); + } + + public ClientStreamingCallable babbleAboutBookCallable() { + throw new UnsupportedOperationException("Not implemented: babbleAboutBookCallable()"); + } + + public UnaryCallable findRelatedBooksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: findRelatedBooksPagedCallable()"); + } + + public UnaryCallable findRelatedBooksCallable() { + throw new UnsupportedOperationException("Not implemented: findRelatedBooksCallable()"); + } + + @Deprecated + public UnaryCallable addLabelCallable() { + throw new UnsupportedOperationException("Not implemented: addLabelCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigBookOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getBigBookOperationCallable()"); + } + + public UnaryCallable getBigBookCallable() { + throw new UnsupportedOperationException("Not implemented: getBigBookCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigNothingOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getBigNothingOperationCallable()"); } - @Override - public UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, pagedCallSettings, clientContext); + public UnaryCallable getBigNothingCallable() { + throw new UnsupportedOperationException("Not implemented: getBigNothingCallable()"); } - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable(grpcCallSettings, batchingCallSettings, clientContext); + public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { + throw new UnsupportedOperationException("Not implemented: testOptionalRequiredFlatteningParamsCallable()"); } - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - @Override - public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, - ClientContext clientContext, OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable(grpcCallSettings, operationCallSettings, clientContext, operationsStub); + public UnaryCallable listPublishersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPublishersPagedCallable()"); } - @Override - public BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + public UnaryCallable listPublishersCallable() { + throw new UnsupportedOperationException("Not implemented: listPublishersCallable()"); } - @Override - public ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + public UnaryCallable privateListShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: privateListShelvesCallable()"); } @Override - public ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); - } + public abstract void close(); } -============== file: src/main/java/com/google/example/library/v1/stub/GrpcLibraryServiceStub.java ============== +============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStubSettings.java ============== /* * Copyright 2020 Google LLC * @@ -10455,29 +13714,58 @@ public class GrpcLibraryServiceCallableFactory implements GrpcStubCallableFactor */ package com.google.example.library.v1.stub; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.batching.FlowController.LimitExceededBehavior; +import com.google.api.gax.batching.PartitionKey; +import com.google.api.gax.batching.RequestBuilder; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.BatchedRequestIssuer; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BatchingDescriptor; import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.resourcenames.ResourceName; +import com.google.auth.Credentials; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; import com.google.example.library.v1.BookFromArchive; -import com.google.example.library.v1.BookName; import com.google.example.library.v1.Comment; import com.google.example.library.v1.CreateBookRequest; import com.google.example.library.v1.CreateShelfRequest; @@ -10486,7 +13774,6 @@ import com.google.example.library.v1.DeleteShelfRequest; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; -import com.google.example.library.v1.FolderName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; import com.google.example.library.v1.GetBookFromAnywhereRequest; @@ -10495,3359 +13782,4798 @@ import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.GetShelfRequest; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.LibrarySettings; +import com.google.example.library.v1.LibraryServiceGrpc; import com.google.example.library.v1.ListBooksRequest; import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListPublishersRequest; +import com.google.example.library.v1.ListPublishersResponse; import com.google.example.library.v1.ListShelvesRequest; import com.google.example.library.v1.ListShelvesResponse; import com.google.example.library.v1.ListStringsRequest; import com.google.example.library.v1.ListStringsResponse; -import com.google.example.library.v1.LocationName; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; -import com.google.example.library.v1.ProjectName; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.PublisherName; -import com.google.example.library.v1.SeriesUuid; +import com.google.example.library.v1.Publisher; import com.google.example.library.v1.Shelf; -import com.google.example.library.v1.ShelfName; -import com.google.example.library.v1.SomeMessage; import com.google.example.library.v1.StreamBooksRequest; import com.google.example.library.v1.StreamShelvesRequest; import com.google.example.library.v1.StreamShelvesResponse; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; import com.google.example.library.v1.UpdateBookIndexRequest; import com.google.example.library.v1.UpdateBookRequest; import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Any; -import com.google.protobuf.BoolValue; -import com.google.protobuf.ByteString; -import com.google.protobuf.BytesValue; -import com.google.protobuf.DoubleValue; -import com.google.protobuf.Duration; import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.FloatValue; -import com.google.protobuf.Int32Value; -import com.google.protobuf.Int64Value; -import com.google.protobuf.ListValue; -import com.google.protobuf.StringValue; -import com.google.protobuf.Struct; -import com.google.protobuf.Timestamp; -import com.google.protobuf.UInt32Value; -import com.google.protobuf.UInt64Value; -import com.google.protobuf.Value; +import com.google.tagger.v1.LabelerGrpc; import com.google.tagger.v1.TaggerProto.AddLabelRequest; import com.google.tagger.v1.TaggerProto.AddLabelResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LibraryServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (library-example.googleapis.com) and default port (1234) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. + * + * For example, to set the total timeout of createShelf to 30 seconds: + * + *

+ * 
+ * LibraryServiceStubSettings.Builder librarySettingsBuilder =
+ *     LibraryServiceStubSettings.newBuilder();
+ * librarySettingsBuilder.createShelfSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LibraryServiceStubSettings librarySettings = librarySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class LibraryServiceStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/library") + .build(); + + private final UnaryCallSettings createShelfSettings; + private final UnaryCallSettings getShelfSettings; + private final PagedCallSettings listShelvesSettings; + private final UnaryCallSettings deleteShelfSettings; + private final UnaryCallSettings mergeShelvesSettings; + private final UnaryCallSettings createBookSettings; + private final BatchingCallSettings publishSeriesSettings; + private final UnaryCallSettings getBookSettings; + private final PagedCallSettings listBooksSettings; + private final UnaryCallSettings deleteBookSettings; + private final UnaryCallSettings updateBookSettings; + private final UnaryCallSettings moveBookSettings; + private final PagedCallSettings listStringsSettings; + private final BatchingCallSettings addCommentsSettings; + private final UnaryCallSettings getBookFromArchiveSettings; + private final UnaryCallSettings getBookFromAnywhereSettings; + private final UnaryCallSettings getBookFromAbsolutelyAnywhereSettings; + private final UnaryCallSettings updateBookIndexSettings; + private final ServerStreamingCallSettings streamShelvesSettings; + private final ServerStreamingCallSettings streamBooksSettings; + private final StreamingCallSettings discussBookSettings; + private final StreamingCallSettings monologAboutBookSettings; + private final StreamingCallSettings babbleAboutBookSettings; + private final PagedCallSettings findRelatedBooksSettings; + private final UnaryCallSettings addLabelSettings; + private final UnaryCallSettings getBigBookSettings; + private final OperationCallSettings getBigBookOperationSettings; + private final UnaryCallSettings getBigNothingSettings; + private final OperationCallSettings getBigNothingOperationSettings; + private final UnaryCallSettings testOptionalRequiredFlatteningParamsSettings; + private final PagedCallSettings listPublishersSettings; + private final UnaryCallSettings privateListShelvesSettings; + + /** + * Returns the object with the settings used for calls to createShelf. + */ + public UnaryCallSettings createShelfSettings() { + return createShelfSettings; + } + + /** + * Returns the object with the settings used for calls to getShelf. + */ + public UnaryCallSettings getShelfSettings() { + return getShelfSettings; + } + + /** + * Returns the object with the settings used for calls to listShelves. + */ + public PagedCallSettings listShelvesSettings() { + return listShelvesSettings; + } + + /** + * Returns the object with the settings used for calls to deleteShelf. + */ + public UnaryCallSettings deleteShelfSettings() { + return deleteShelfSettings; + } + + /** + * Returns the object with the settings used for calls to mergeShelves. + */ + public UnaryCallSettings mergeShelvesSettings() { + return mergeShelvesSettings; + } -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC stub implementation for Google Example Library API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public class GrpcLibraryServiceStub extends LibraryServiceStub { + /** + * Returns the object with the settings used for calls to createBook. + */ + public UnaryCallSettings createBookSettings() { + return createBookSettings; + } - private static final MethodDescriptor createShelfMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/CreateShelf") - .setRequestMarshaller(ProtoUtils.marshaller(CreateShelfRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) - .build(); - private static final MethodDescriptor getShelfMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/GetShelf") - .setRequestMarshaller(ProtoUtils.marshaller(GetShelfRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) - .build(); - private static final MethodDescriptor listShelvesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/ListShelves") - .setRequestMarshaller(ProtoUtils.marshaller(ListShelvesRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListShelvesResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor deleteShelfMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/DeleteShelf") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteShelfRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor mergeShelvesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/MergeShelves") - .setRequestMarshaller(ProtoUtils.marshaller(MergeShelvesRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) - .build(); - private static final MethodDescriptor createBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/CreateBook") - .setRequestMarshaller(ProtoUtils.marshaller(CreateBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) - .build(); - private static final MethodDescriptor publishSeriesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/PublishSeries") - .setRequestMarshaller(ProtoUtils.marshaller(PublishSeriesRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PublishSeriesResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor getBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/GetBook") - .setRequestMarshaller(ProtoUtils.marshaller(GetBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) - .build(); - private static final MethodDescriptor listBooksMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/ListBooks") - .setRequestMarshaller(ProtoUtils.marshaller(ListBooksRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListBooksResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor deleteBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/DeleteBook") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor updateBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/UpdateBook") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) - .build(); - private static final MethodDescriptor moveBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/MoveBook") - .setRequestMarshaller(ProtoUtils.marshaller(MoveBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) - .build(); - private static final MethodDescriptor listStringsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/ListStrings") - .setRequestMarshaller(ProtoUtils.marshaller(ListStringsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListStringsResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor addCommentsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/AddComments") - .setRequestMarshaller(ProtoUtils.marshaller(AddCommentsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor getBookFromArchiveMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/GetBookFromArchive") - .setRequestMarshaller(ProtoUtils.marshaller(GetBookFromArchiveRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(BookFromArchive.getDefaultInstance())) - .build(); - private static final MethodDescriptor getBookFromAnywhereMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/GetBookFromAnywhere") - .setRequestMarshaller(ProtoUtils.marshaller(GetBookFromAnywhereRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(BookFromAnywhere.getDefaultInstance())) - .build(); - private static final MethodDescriptor getBookFromAbsolutelyAnywhereMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/GetBookFromAbsolutelyAnywhere") - .setRequestMarshaller(ProtoUtils.marshaller(GetBookFromAbsolutelyAnywhereRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(BookFromAnywhere.getDefaultInstance())) - .build(); - private static final MethodDescriptor updateBookIndexMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/UpdateBookIndex") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateBookIndexRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor streamShelvesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName("google.example.library.v1.LibraryService/StreamShelves") - .setRequestMarshaller(ProtoUtils.marshaller(StreamShelvesRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(StreamShelvesResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor streamBooksMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName("google.example.library.v1.LibraryService/StreamBooks") - .setRequestMarshaller(ProtoUtils.marshaller(StreamBooksRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) - .build(); - private static final MethodDescriptor discussBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.example.library.v1.LibraryService/DiscussBook") - .setRequestMarshaller(ProtoUtils.marshaller(DiscussBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Comment.getDefaultInstance())) - .build(); - private static final MethodDescriptor monologAboutBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName("google.example.library.v1.LibraryService/MonologAboutBook") - .setRequestMarshaller(ProtoUtils.marshaller(DiscussBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Comment.getDefaultInstance())) - .build(); - private static final MethodDescriptor babbleAboutBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName("google.example.library.v1.LibraryService/BabbleAboutBook") - .setRequestMarshaller(ProtoUtils.marshaller(DiscussBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - private static final MethodDescriptor findRelatedBooksMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/FindRelatedBooks") - .setRequestMarshaller(ProtoUtils.marshaller(FindRelatedBooksRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(FindRelatedBooksResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor addLabelMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.tagger.v1.Labeler/AddLabel") - .setRequestMarshaller(ProtoUtils.marshaller(AddLabelRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(AddLabelResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor getBigBookMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/GetBigBook") - .setRequestMarshaller(ProtoUtils.marshaller(GetBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor getBigNothingMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/GetBigNothing") - .setRequestMarshaller(ProtoUtils.marshaller(GetBookRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor testOptionalRequiredFlatteningParamsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/TestOptionalRequiredFlatteningParams") - .setRequestMarshaller(ProtoUtils.marshaller(TestOptionalRequiredFlatteningParamsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(TestOptionalRequiredFlatteningParamsResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor privateListShelvesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/PrivateListShelves") - .setRequestMarshaller(ProtoUtils.marshaller(ListShelvesRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) - .build(); + /** + * Returns the object with the settings used for calls to publishSeries. + */ + public BatchingCallSettings publishSeriesSettings() { + return publishSeriesSettings; + } + + /** + * Returns the object with the settings used for calls to getBook. + */ + public UnaryCallSettings getBookSettings() { + return getBookSettings; + } + + /** + * Returns the object with the settings used for calls to listBooks. + */ + public PagedCallSettings listBooksSettings() { + return listBooksSettings; + } + + /** + * Returns the object with the settings used for calls to deleteBook. + */ + public UnaryCallSettings deleteBookSettings() { + return deleteBookSettings; + } + + /** + * Returns the object with the settings used for calls to updateBook. + */ + public UnaryCallSettings updateBookSettings() { + return updateBookSettings; + } + /** + * Returns the object with the settings used for calls to moveBook. + */ + public UnaryCallSettings moveBookSettings() { + return moveBookSettings; + } - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; + /** + * Returns the object with the settings used for calls to listStrings. + */ + public PagedCallSettings listStringsSettings() { + return listStringsSettings; + } - private final UnaryCallable createShelfCallable; - private final UnaryCallable getShelfCallable; - private final UnaryCallable listShelvesCallable; - private final UnaryCallable listShelvesPagedCallable; - private final UnaryCallable deleteShelfCallable; - private final UnaryCallable mergeShelvesCallable; - private final UnaryCallable createBookCallable; - private final UnaryCallable publishSeriesCallable; - private final UnaryCallable getBookCallable; - private final UnaryCallable listBooksCallable; - private final UnaryCallable listBooksPagedCallable; - private final UnaryCallable deleteBookCallable; - private final UnaryCallable updateBookCallable; - private final UnaryCallable moveBookCallable; - private final UnaryCallable listStringsCallable; - private final UnaryCallable listStringsPagedCallable; - private final UnaryCallable addCommentsCallable; - private final UnaryCallable getBookFromArchiveCallable; - private final UnaryCallable getBookFromAnywhereCallable; - private final UnaryCallable getBookFromAbsolutelyAnywhereCallable; - private final UnaryCallable updateBookIndexCallable; - private final ServerStreamingCallable streamShelvesCallable; - private final ServerStreamingCallable streamBooksCallable; - private final BidiStreamingCallable discussBookCallable; - private final ClientStreamingCallable monologAboutBookCallable; - private final ClientStreamingCallable babbleAboutBookCallable; - private final UnaryCallable findRelatedBooksCallable; - private final UnaryCallable findRelatedBooksPagedCallable; - private final UnaryCallable addLabelCallable; - private final UnaryCallable getBigBookCallable; - private final OperationCallable getBigBookOperationCallable; - private final UnaryCallable getBigNothingCallable; - private final OperationCallable getBigNothingOperationCallable; - private final UnaryCallable testOptionalRequiredFlatteningParamsCallable; - private final UnaryCallable privateListShelvesCallable; + /** + * Returns the object with the settings used for calls to addComments. + */ + public BatchingCallSettings addCommentsSettings() { + return addCommentsSettings; + } - private final GrpcStubCallableFactory callableFactory; + /** + * Returns the object with the settings used for calls to getBookFromArchive. + */ + public UnaryCallSettings getBookFromArchiveSettings() { + return getBookFromArchiveSettings; + } - public static final GrpcLibraryServiceStub create(LibraryServiceStubSettings settings) throws IOException { - return new GrpcLibraryServiceStub(settings, ClientContext.create(settings)); + /** + * Returns the object with the settings used for calls to getBookFromAnywhere. + */ + public UnaryCallSettings getBookFromAnywhereSettings() { + return getBookFromAnywhereSettings; } - public static final GrpcLibraryServiceStub create(ClientContext clientContext) throws IOException { - return new GrpcLibraryServiceStub(LibraryServiceStubSettings.newBuilder().build(), clientContext); + /** + * Returns the object with the settings used for calls to getBookFromAbsolutelyAnywhere. + */ + public UnaryCallSettings getBookFromAbsolutelyAnywhereSettings() { + return getBookFromAbsolutelyAnywhereSettings; } - public static final GrpcLibraryServiceStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcLibraryServiceStub(LibraryServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + /** + * Returns the object with the settings used for calls to updateBookIndex. + */ + public UnaryCallSettings updateBookIndexSettings() { + return updateBookIndexSettings; } /** - * Constructs an instance of GrpcLibraryServiceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Returns the object with the settings used for calls to streamShelves. */ - protected GrpcLibraryServiceStub(LibraryServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new GrpcLibraryServiceCallableFactory()); + public ServerStreamingCallSettings streamShelvesSettings() { + return streamShelvesSettings; + } + + /** + * Returns the object with the settings used for calls to streamBooks. + */ + public ServerStreamingCallSettings streamBooksSettings() { + return streamBooksSettings; + } + + /** + * Returns the object with the settings used for calls to discussBook. + */ + public StreamingCallSettings discussBookSettings() { + return discussBookSettings; + } + + /** + * Returns the object with the settings used for calls to monologAboutBook. + */ + public StreamingCallSettings monologAboutBookSettings() { + return monologAboutBookSettings; + } + + /** + * Returns the object with the settings used for calls to babbleAboutBook. + */ + public StreamingCallSettings babbleAboutBookSettings() { + return babbleAboutBookSettings; + } + + /** + * Returns the object with the settings used for calls to findRelatedBooks. + */ + public PagedCallSettings findRelatedBooksSettings() { + return findRelatedBooksSettings; + } + + /** + * Returns the object with the settings used for calls to addLabel. + */ + public UnaryCallSettings addLabelSettings() { + return addLabelSettings; + } + + /** + * Returns the object with the settings used for calls to getBigBook. + */ + public UnaryCallSettings getBigBookSettings() { + return getBigBookSettings; + } + + /** + * Returns the object with the settings used for calls to getBigBook. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings getBigBookOperationSettings() { + return getBigBookOperationSettings; + } + + /** + * Returns the object with the settings used for calls to getBigNothing. + */ + public UnaryCallSettings getBigNothingSettings() { + return getBigNothingSettings; + } + + /** + * Returns the object with the settings used for calls to getBigNothing. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings getBigNothingOperationSettings() { + return getBigNothingOperationSettings; + } + + /** + * Returns the object with the settings used for calls to testOptionalRequiredFlatteningParams. + */ + public UnaryCallSettings testOptionalRequiredFlatteningParamsSettings() { + return testOptionalRequiredFlatteningParamsSettings; + } + + /** + * Returns the object with the settings used for calls to listPublishers. + */ + public PagedCallSettings listPublishersSettings() { + return listPublishersSettings; + } + + /** + * Returns the object with the settings used for calls to privateListShelves. + */ + public UnaryCallSettings privateListShelvesSettings() { + return privateListShelvesSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LibraryServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcLibraryServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "library-example.googleapis.com:1234"; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LibraryServiceStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); } /** - * Constructs an instance of GrpcLibraryServiceStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Returns a builder containing all the values of this settings class. */ - protected GrpcLibraryServiceStub(LibraryServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + public Builder toBuilder() { + return new Builder(this); + } - GrpcCallSettings createShelfTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createShelfMethodDescriptor) - .build(); - GrpcCallSettings getShelfTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getShelfMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetShelfRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings listShelvesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listShelvesMethodDescriptor) - .build(); - GrpcCallSettings deleteShelfTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteShelfMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteShelfRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings mergeShelvesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(mergeShelvesMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(MergeShelvesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings createBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createBookMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateBookRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings publishSeriesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(publishSeriesMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(PublishSeriesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("shelf.name", String.valueOf(request.getShelf().getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings getBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBookMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetBookRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings listBooksTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listBooksMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListBooksRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings deleteBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteBookMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteBookRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings updateBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateBookMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateBookRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings moveBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(moveBookMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(MoveBookRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings listStringsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listStringsMethodDescriptor) - .build(); - GrpcCallSettings addCommentsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(addCommentsMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(AddCommentsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings getBookFromArchiveTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBookFromArchiveMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetBookFromArchiveRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings getBookFromAnywhereTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBookFromAnywhereMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetBookFromAnywhereRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings getBookFromAbsolutelyAnywhereTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBookFromAbsolutelyAnywhereMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetBookFromAbsolutelyAnywhereRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - params.put("alt_book_name", String.valueOf(request.getAltBookName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings updateBookIndexTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateBookIndexMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateBookIndexRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings streamShelvesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamShelvesMethodDescriptor) - .build(); - GrpcCallSettings streamBooksTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamBooksMethodDescriptor) - .build(); - GrpcCallSettings discussBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(discussBookMethodDescriptor) + protected LibraryServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createShelfSettings = settingsBuilder.createShelfSettings().build(); + getShelfSettings = settingsBuilder.getShelfSettings().build(); + listShelvesSettings = settingsBuilder.listShelvesSettings().build(); + deleteShelfSettings = settingsBuilder.deleteShelfSettings().build(); + mergeShelvesSettings = settingsBuilder.mergeShelvesSettings().build(); + createBookSettings = settingsBuilder.createBookSettings().build(); + publishSeriesSettings = settingsBuilder.publishSeriesSettings().build(); + getBookSettings = settingsBuilder.getBookSettings().build(); + listBooksSettings = settingsBuilder.listBooksSettings().build(); + deleteBookSettings = settingsBuilder.deleteBookSettings().build(); + updateBookSettings = settingsBuilder.updateBookSettings().build(); + moveBookSettings = settingsBuilder.moveBookSettings().build(); + listStringsSettings = settingsBuilder.listStringsSettings().build(); + addCommentsSettings = settingsBuilder.addCommentsSettings().build(); + getBookFromArchiveSettings = settingsBuilder.getBookFromArchiveSettings().build(); + getBookFromAnywhereSettings = settingsBuilder.getBookFromAnywhereSettings().build(); + getBookFromAbsolutelyAnywhereSettings = settingsBuilder.getBookFromAbsolutelyAnywhereSettings().build(); + updateBookIndexSettings = settingsBuilder.updateBookIndexSettings().build(); + streamShelvesSettings = settingsBuilder.streamShelvesSettings().build(); + streamBooksSettings = settingsBuilder.streamBooksSettings().build(); + discussBookSettings = settingsBuilder.discussBookSettings().build(); + monologAboutBookSettings = settingsBuilder.monologAboutBookSettings().build(); + babbleAboutBookSettings = settingsBuilder.babbleAboutBookSettings().build(); + findRelatedBooksSettings = settingsBuilder.findRelatedBooksSettings().build(); + addLabelSettings = settingsBuilder.addLabelSettings().build(); + getBigBookSettings = settingsBuilder.getBigBookSettings().build(); + getBigBookOperationSettings = settingsBuilder.getBigBookOperationSettings().build(); + getBigNothingSettings = settingsBuilder.getBigNothingSettings().build(); + getBigNothingOperationSettings = settingsBuilder.getBigNothingOperationSettings().build(); + testOptionalRequiredFlatteningParamsSettings = settingsBuilder.testOptionalRequiredFlatteningParamsSettings().build(); + listPublishersSettings = settingsBuilder.listPublishersSettings().build(); + privateListShelvesSettings = settingsBuilder.privateListShelvesSettings().build(); + } + + private static final PagedListDescriptor LIST_SHELVES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListShelvesRequest injectToken(ListShelvesRequest payload, String token) { + return ListShelvesRequest + .newBuilder(payload) + .setPageToken(token) .build(); - GrpcCallSettings monologAboutBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(monologAboutBookMethodDescriptor) + } + @Override + public ListShelvesRequest injectPageSize(ListShelvesRequest payload, int pageSize) { + throw new UnsupportedOperationException("page size is not supported by this API method"); + } + @Override + public Integer extractPageSize(ListShelvesRequest payload) { + throw new UnsupportedOperationException("page size is not supported by this API method"); + } + @Override + public String extractNextToken(ListShelvesResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListShelvesResponse payload) { + return payload.getShelvesList() != null ? payload.getShelvesList() : + ImmutableList.of(); + } + }; + + private static final PagedListDescriptor LIST_BOOKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListBooksRequest injectToken(ListBooksRequest payload, String token) { + return ListBooksRequest + .newBuilder(payload) + .setPageToken(token) .build(); - GrpcCallSettings babbleAboutBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(babbleAboutBookMethodDescriptor) + } + @Override + public ListBooksRequest injectPageSize(ListBooksRequest payload, int pageSize) { + return ListBooksRequest + .newBuilder(payload) + .setPageSize(pageSize) .build(); - GrpcCallSettings findRelatedBooksTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(findRelatedBooksMethodDescriptor) + } + @Override + public Integer extractPageSize(ListBooksRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(ListBooksResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListBooksResponse payload) { + return payload.getBooksList() != null ? payload.getBooksList() : + ImmutableList.of(); + } + }; + + private static final PagedListDescriptor LIST_STRINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListStringsRequest injectToken(ListStringsRequest payload, String token) { + return ListStringsRequest + .newBuilder(payload) + .setPageToken(token) .build(); - GrpcCallSettings addLabelTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(addLabelMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(AddLabelRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } - }) + } + @Override + public ListStringsRequest injectPageSize(ListStringsRequest payload, int pageSize) { + return ListStringsRequest + .newBuilder(payload) + .setPageSize(pageSize) .build(); - GrpcCallSettings getBigBookTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBigBookMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetBookRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) + } + @Override + public Integer extractPageSize(ListStringsRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(ListStringsResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListStringsResponse payload) { + return payload.getStringsList() != null ? payload.getStringsList() : + ImmutableList.of(); + } + }; + + private static final PagedListDescriptor FIND_RELATED_BOOKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public FindRelatedBooksRequest injectToken(FindRelatedBooksRequest payload, String token) { + return FindRelatedBooksRequest + .newBuilder(payload) + .setPageToken(token) .build(); - GrpcCallSettings getBigNothingTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBigNothingMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetBookRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) + } + @Override + public FindRelatedBooksRequest injectPageSize(FindRelatedBooksRequest payload, int pageSize) { + return FindRelatedBooksRequest + .newBuilder(payload) + .setPageSize(pageSize) .build(); - GrpcCallSettings testOptionalRequiredFlatteningParamsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(testOptionalRequiredFlatteningParamsMethodDescriptor) + } + @Override + public Integer extractPageSize(FindRelatedBooksRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(FindRelatedBooksResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(FindRelatedBooksResponse payload) { + return payload.getNamesList() != null ? payload.getNamesList() : + ImmutableList.of(); + } + }; + + private static final PagedListDescriptor LIST_PUBLISHERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListPublishersRequest injectToken(ListPublishersRequest payload, String token) { + return ListPublishersRequest + .newBuilder(payload) + .setPageToken(token) .build(); - GrpcCallSettings privateListShelvesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(privateListShelvesMethodDescriptor) + } + @Override + public ListPublishersRequest injectPageSize(ListPublishersRequest payload, int pageSize) { + return ListPublishersRequest + .newBuilder(payload) + .setPageSize(pageSize) .build(); + } + @Override + public Integer extractPageSize(ListPublishersRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(ListPublishersResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListPublishersResponse payload) { + return payload.getPublishersList() != null ? payload.getPublishersList() : + ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory LIST_SHELVES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListShelvesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SHELVES_PAGE_STR_DESC, request, context); + return ListShelvesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_BOOKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBooksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BOOKS_PAGE_STR_DESC, request, context); + return ListBooksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_STRINGS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListStringsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_STRINGS_PAGE_STR_DESC, request, context); + return ListStringsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory FIND_RELATED_BOOKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + FindRelatedBooksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, FIND_RELATED_BOOKS_PAGE_STR_DESC, request, context); + return FindRelatedBooksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory LIST_PUBLISHERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPublishersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PUBLISHERS_PAGE_STR_DESC, request, context); + return ListPublishersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final BatchingDescriptor PUBLISH_SERIES_BATCHING_DESC = + new BatchingDescriptor() { + @Override + public PartitionKey getBatchPartitionKey(PublishSeriesRequest request) { + return new PartitionKey(request.getEdition(), request.getName()); + } + + @Override + public RequestBuilder getRequestBuilder() { + return new RequestBuilder() { + private PublishSeriesRequest.Builder builder; + @Override + public void appendRequest(PublishSeriesRequest request) { + if (builder == null) { + builder = request.toBuilder(); + } else { + builder.addAllBooks(request.getBooksList()); + } + } + @Override + public PublishSeriesRequest build() { + return builder.build(); + } + }; + } + + @Override + public void splitResponse( + PublishSeriesResponse batchResponse, + Collection> batch) { + int batchMessageIndex = 0; + for (BatchedRequestIssuer responder : batch) { + List subresponseElements = new ArrayList<>(); + long subresponseCount = responder.getMessageCount(); + for (int i = 0; i < subresponseCount; i++) { + subresponseElements.add(batchResponse.getBookNames(batchMessageIndex)); + batchMessageIndex += 1; + } + PublishSeriesResponse response = + PublishSeriesResponse.newBuilder().addAllBookNames(subresponseElements).build(); + responder.setResponse(response); + } + } + + @Override + public void splitException( + Throwable throwable, + Collection> batch) { + for (BatchedRequestIssuer responder : batch) { + responder.setException(throwable); + } + } + + @Override + public long countElements(PublishSeriesRequest request) { + return request.getBooksCount(); + } + + @Override + public long countBytes(PublishSeriesRequest request) { + return request.getSerializedSize(); + } + }; + + private static final BatchingDescriptor ADD_COMMENTS_BATCHING_DESC = + new BatchingDescriptor() { + @Override + public PartitionKey getBatchPartitionKey(AddCommentsRequest request) { + return new PartitionKey(request.getName()); + } + + @Override + public RequestBuilder getRequestBuilder() { + return new RequestBuilder() { + private AddCommentsRequest.Builder builder; + @Override + public void appendRequest(AddCommentsRequest request) { + if (builder == null) { + builder = request.toBuilder(); + } else { + builder.addAllComments(request.getCommentsList()); + } + } + @Override + public AddCommentsRequest build() { + return builder.build(); + } + }; + } + + @Override + public void splitResponse( + Empty batchResponse, + Collection> batch) { + int batchMessageIndex = 0; + for (BatchedRequestIssuer responder : batch) { + Empty response = + Empty.newBuilder().build(); + responder.setResponse(response); + } + } + + @Override + public void splitException( + Throwable throwable, + Collection> batch) { + for (BatchedRequestIssuer responder : batch) { + responder.setException(throwable); + } + } + + @Override + public long countElements(AddCommentsRequest request) { + return request.getCommentsCount(); + } + + @Override + public long countBytes(AddCommentsRequest request) { + return request.getSerializedSize(); + } + }; + + /** + * Builder for LibraryServiceStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createShelfSettings; + private final UnaryCallSettings.Builder getShelfSettings; + private final PagedCallSettings.Builder listShelvesSettings; + private final UnaryCallSettings.Builder deleteShelfSettings; + private final UnaryCallSettings.Builder mergeShelvesSettings; + private final UnaryCallSettings.Builder createBookSettings; + private final BatchingCallSettings.Builder publishSeriesSettings; + private final UnaryCallSettings.Builder getBookSettings; + private final PagedCallSettings.Builder listBooksSettings; + private final UnaryCallSettings.Builder deleteBookSettings; + private final UnaryCallSettings.Builder updateBookSettings; + private final UnaryCallSettings.Builder moveBookSettings; + private final PagedCallSettings.Builder listStringsSettings; + private final BatchingCallSettings.Builder addCommentsSettings; + private final UnaryCallSettings.Builder getBookFromArchiveSettings; + private final UnaryCallSettings.Builder getBookFromAnywhereSettings; + private final UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings; + private final UnaryCallSettings.Builder updateBookIndexSettings; + private final ServerStreamingCallSettings.Builder streamShelvesSettings; + private final ServerStreamingCallSettings.Builder streamBooksSettings; + private final StreamingCallSettings.Builder discussBookSettings; + private final StreamingCallSettings.Builder monologAboutBookSettings; + private final StreamingCallSettings.Builder babbleAboutBookSettings; + private final PagedCallSettings.Builder findRelatedBooksSettings; + private final UnaryCallSettings.Builder addLabelSettings; + private final UnaryCallSettings.Builder getBigBookSettings; + private final OperationCallSettings.Builder getBigBookOperationSettings; + private final UnaryCallSettings.Builder getBigNothingSettings; + private final OperationCallSettings.Builder getBigNothingOperationSettings; + private final UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings; + private final PagedCallSettings.Builder listPublishersSettings; + private final UnaryCallSettings.Builder privateListShelvesSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.2) + .setMaxRetryDelay(Duration.ofMillis(1000L)) + .setInitialRpcTimeout(Duration.ofMillis(300L)) + .setRpcTimeoutMultiplier(1.3) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listShelvesSettings = PagedCallSettings.newBuilder( + LIST_SHELVES_PAGE_STR_FACT); + + deleteShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + mergeShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + publishSeriesSettings = BatchingCallSettings.newBuilder( + PUBLISH_SERIES_BATCHING_DESC) + .setBatchingSettings(BatchingSettings.newBuilder().build()); + + getBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listBooksSettings = PagedCallSettings.newBuilder( + LIST_BOOKS_PAGE_STR_FACT); + + deleteBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + moveBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listStringsSettings = PagedCallSettings.newBuilder( + LIST_STRINGS_PAGE_STR_FACT); + + addCommentsSettings = BatchingCallSettings.newBuilder( + ADD_COMMENTS_BATCHING_DESC) + .setBatchingSettings(BatchingSettings.newBuilder().build()); + + getBookFromArchiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBookFromAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBookFromAbsolutelyAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateBookIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + streamShelvesSettings = ServerStreamingCallSettings.newBuilder(); + + streamBooksSettings = ServerStreamingCallSettings.newBuilder(); + + discussBookSettings = StreamingCallSettings.newBuilder(); + + monologAboutBookSettings = StreamingCallSettings.newBuilder(); + + babbleAboutBookSettings = StreamingCallSettings.newBuilder(); + + findRelatedBooksSettings = PagedCallSettings.newBuilder( + FIND_RELATED_BOOKS_PAGE_STR_FACT); + + addLabelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBigBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBigBookOperationSettings = OperationCallSettings.newBuilder(); + + getBigNothingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBigNothingOperationSettings = OperationCallSettings.newBuilder(); + + testOptionalRequiredFlatteningParamsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listPublishersSettings = PagedCallSettings.newBuilder( + LIST_PUBLISHERS_PAGE_STR_FACT); + + privateListShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + createShelfSettings, + getShelfSettings, + listShelvesSettings, + deleteShelfSettings, + mergeShelvesSettings, + createBookSettings, + publishSeriesSettings, + getBookSettings, + listBooksSettings, + deleteBookSettings, + updateBookSettings, + moveBookSettings, + listStringsSettings, + addCommentsSettings, + getBookFromArchiveSettings, + getBookFromAnywhereSettings, + getBookFromAbsolutelyAnywhereSettings, + updateBookIndexSettings, + findRelatedBooksSettings, + addLabelSettings, + getBigBookSettings, + getBigNothingSettings, + testOptionalRequiredFlatteningParamsSettings, + listPublishersSettings, + privateListShelvesSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.createShelfSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getShelfSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteShelfSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.mergeShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.createBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.publishSeriesSettings().setBatchingSettings( + BatchingSettings.newBuilder() + .setElementCountThreshold(6L) + .setRequestByteThreshold(100000L) + .setDelayThreshold(Duration.ofMillis(500)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setLimitExceededBehavior(LimitExceededBehavior.Ignore) + .build()) + .build()); + builder.publishSeriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listBooksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.deleteBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.moveBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listStringsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.addCommentsSettings().setBatchingSettings( + BatchingSettings.newBuilder() + .setElementCountThreshold(6L) + .setRequestByteThreshold(100000L) + .setDelayThreshold(Duration.ofMillis(500)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setLimitExceededBehavior(LimitExceededBehavior.Ignore) + .build()) + .build()); + builder.addCommentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBookFromArchiveSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBookFromAnywhereSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBookFromAbsolutelyAnywhereSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.updateBookIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.streamShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.streamBooksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.findRelatedBooksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.addLabelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBigBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.getBigNothingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.testOptionalRequiredFlatteningParamsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.listPublishersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.privateListShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getBigBookOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Book.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + builder + .getBigNothingOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(600000L)) + .build())); + + return builder; + } + + protected Builder(LibraryServiceStubSettings settings) { + super(settings); + + createShelfSettings = settings.createShelfSettings.toBuilder(); + getShelfSettings = settings.getShelfSettings.toBuilder(); + listShelvesSettings = settings.listShelvesSettings.toBuilder(); + deleteShelfSettings = settings.deleteShelfSettings.toBuilder(); + mergeShelvesSettings = settings.mergeShelvesSettings.toBuilder(); + createBookSettings = settings.createBookSettings.toBuilder(); + publishSeriesSettings = settings.publishSeriesSettings.toBuilder(); + getBookSettings = settings.getBookSettings.toBuilder(); + listBooksSettings = settings.listBooksSettings.toBuilder(); + deleteBookSettings = settings.deleteBookSettings.toBuilder(); + updateBookSettings = settings.updateBookSettings.toBuilder(); + moveBookSettings = settings.moveBookSettings.toBuilder(); + listStringsSettings = settings.listStringsSettings.toBuilder(); + addCommentsSettings = settings.addCommentsSettings.toBuilder(); + getBookFromArchiveSettings = settings.getBookFromArchiveSettings.toBuilder(); + getBookFromAnywhereSettings = settings.getBookFromAnywhereSettings.toBuilder(); + getBookFromAbsolutelyAnywhereSettings = settings.getBookFromAbsolutelyAnywhereSettings.toBuilder(); + updateBookIndexSettings = settings.updateBookIndexSettings.toBuilder(); + streamShelvesSettings = settings.streamShelvesSettings.toBuilder(); + streamBooksSettings = settings.streamBooksSettings.toBuilder(); + discussBookSettings = settings.discussBookSettings.toBuilder(); + monologAboutBookSettings = settings.monologAboutBookSettings.toBuilder(); + babbleAboutBookSettings = settings.babbleAboutBookSettings.toBuilder(); + findRelatedBooksSettings = settings.findRelatedBooksSettings.toBuilder(); + addLabelSettings = settings.addLabelSettings.toBuilder(); + getBigBookSettings = settings.getBigBookSettings.toBuilder(); + getBigBookOperationSettings = settings.getBigBookOperationSettings.toBuilder(); + getBigNothingSettings = settings.getBigNothingSettings.toBuilder(); + getBigNothingOperationSettings = settings.getBigNothingOperationSettings.toBuilder(); + testOptionalRequiredFlatteningParamsSettings = settings.testOptionalRequiredFlatteningParamsSettings.toBuilder(); + listPublishersSettings = settings.listPublishersSettings.toBuilder(); + privateListShelvesSettings = settings.privateListShelvesSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + createShelfSettings, + getShelfSettings, + listShelvesSettings, + deleteShelfSettings, + mergeShelvesSettings, + createBookSettings, + publishSeriesSettings, + getBookSettings, + listBooksSettings, + deleteBookSettings, + updateBookSettings, + moveBookSettings, + listStringsSettings, + addCommentsSettings, + getBookFromArchiveSettings, + getBookFromAnywhereSettings, + getBookFromAbsolutelyAnywhereSettings, + updateBookIndexSettings, + findRelatedBooksSettings, + addLabelSettings, + getBigBookSettings, + getBigNothingSettings, + testOptionalRequiredFlatteningParamsSettings, + listPublishersSettings, + privateListShelvesSettings + ); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to createShelf. + */ + public UnaryCallSettings.Builder createShelfSettings() { + return createShelfSettings; + } + + /** + * Returns the builder for the settings used for calls to getShelf. + */ + public UnaryCallSettings.Builder getShelfSettings() { + return getShelfSettings; + } + + /** + * Returns the builder for the settings used for calls to listShelves. + */ + public PagedCallSettings.Builder listShelvesSettings() { + return listShelvesSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteShelf. + */ + public UnaryCallSettings.Builder deleteShelfSettings() { + return deleteShelfSettings; + } + + /** + * Returns the builder for the settings used for calls to mergeShelves. + */ + public UnaryCallSettings.Builder mergeShelvesSettings() { + return mergeShelvesSettings; + } + + /** + * Returns the builder for the settings used for calls to createBook. + */ + public UnaryCallSettings.Builder createBookSettings() { + return createBookSettings; + } + + /** + * Returns the builder for the settings used for calls to publishSeries. + */ + public BatchingCallSettings.Builder publishSeriesSettings() { + return publishSeriesSettings; + } + + /** + * Returns the builder for the settings used for calls to getBook. + */ + public UnaryCallSettings.Builder getBookSettings() { + return getBookSettings; + } + + /** + * Returns the builder for the settings used for calls to listBooks. + */ + public PagedCallSettings.Builder listBooksSettings() { + return listBooksSettings; + } + + /** + * Returns the builder for the settings used for calls to deleteBook. + */ + public UnaryCallSettings.Builder deleteBookSettings() { + return deleteBookSettings; + } + + /** + * Returns the builder for the settings used for calls to updateBook. + */ + public UnaryCallSettings.Builder updateBookSettings() { + return updateBookSettings; + } + + /** + * Returns the builder for the settings used for calls to moveBook. + */ + public UnaryCallSettings.Builder moveBookSettings() { + return moveBookSettings; + } + + /** + * Returns the builder for the settings used for calls to listStrings. + */ + public PagedCallSettings.Builder listStringsSettings() { + return listStringsSettings; + } + + /** + * Returns the builder for the settings used for calls to addComments. + */ + public BatchingCallSettings.Builder addCommentsSettings() { + return addCommentsSettings; + } + + /** + * Returns the builder for the settings used for calls to getBookFromArchive. + */ + public UnaryCallSettings.Builder getBookFromArchiveSettings() { + return getBookFromArchiveSettings; + } + + /** + * Returns the builder for the settings used for calls to getBookFromAnywhere. + */ + public UnaryCallSettings.Builder getBookFromAnywhereSettings() { + return getBookFromAnywhereSettings; + } + + /** + * Returns the builder for the settings used for calls to getBookFromAbsolutelyAnywhere. + */ + public UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings() { + return getBookFromAbsolutelyAnywhereSettings; + } + + /** + * Returns the builder for the settings used for calls to updateBookIndex. + */ + public UnaryCallSettings.Builder updateBookIndexSettings() { + return updateBookIndexSettings; + } + + /** + * Returns the builder for the settings used for calls to streamShelves. + */ + public ServerStreamingCallSettings.Builder streamShelvesSettings() { + return streamShelvesSettings; + } + + /** + * Returns the builder for the settings used for calls to streamBooks. + */ + public ServerStreamingCallSettings.Builder streamBooksSettings() { + return streamBooksSettings; + } + + /** + * Returns the builder for the settings used for calls to discussBook. + */ + public StreamingCallSettings.Builder discussBookSettings() { + return discussBookSettings; + } + + /** + * Returns the builder for the settings used for calls to monologAboutBook. + */ + public StreamingCallSettings.Builder monologAboutBookSettings() { + return monologAboutBookSettings; + } + + /** + * Returns the builder for the settings used for calls to babbleAboutBook. + */ + public StreamingCallSettings.Builder babbleAboutBookSettings() { + return babbleAboutBookSettings; + } + + /** + * Returns the builder for the settings used for calls to findRelatedBooks. + */ + public PagedCallSettings.Builder findRelatedBooksSettings() { + return findRelatedBooksSettings; + } + + /** + * Returns the builder for the settings used for calls to addLabel. + */ + public UnaryCallSettings.Builder addLabelSettings() { + return addLabelSettings; + } + + /** + * Returns the builder for the settings used for calls to getBigBook. + */ + public UnaryCallSettings.Builder getBigBookSettings() { + return getBigBookSettings; + } + + /** + * Returns the builder for the settings used for calls to getBigBook. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder getBigBookOperationSettings() { + return getBigBookOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to getBigNothing. + */ + public UnaryCallSettings.Builder getBigNothingSettings() { + return getBigNothingSettings; + } + + /** + * Returns the builder for the settings used for calls to getBigNothing. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder getBigNothingOperationSettings() { + return getBigNothingOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to testOptionalRequiredFlatteningParams. + */ + public UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings() { + return testOptionalRequiredFlatteningParamsSettings; + } + + /** + * Returns the builder for the settings used for calls to listPublishers. + */ + public PagedCallSettings.Builder listPublishersSettings() { + return listPublishersSettings; + } + + /** + * Returns the builder for the settings used for calls to privateListShelves. + */ + public UnaryCallSettings.Builder privateListShelvesSettings() { + return privateListShelvesSettings; + } + + @Override + public LibraryServiceStubSettings build() throws IOException { + return new LibraryServiceStubSettings(this); + } + } +} +============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStub.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Google Example Library API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class MyProtoStub implements BackgroundResource { + + + public UnaryCallable myMethodCallable() { + throw new UnsupportedOperationException("Not implemented: myMethodCallable()"); + } + + @Override + public abstract void close(); +} +============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStubSettings.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import com.google.protos.google.example.library.v1.MyProtoGrpc; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link MyProtoStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (library-example.googleapis.com) and default port (1234) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. + * + * For example, to set the total timeout of myMethod to 30 seconds: + * + *

+ * 
+ * MyProtoStubSettings.Builder myProtoSettingsBuilder =
+ *     MyProtoStubSettings.newBuilder();
+ * myProtoSettingsBuilder.myMethodSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * MyProtoStubSettings myProtoSettings = myProtoSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class MyProtoStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/library") + .build(); + + private final UnaryCallSettings myMethodSettings; + + /** + * Returns the object with the settings used for calls to myMethod. + */ + public UnaryCallSettings myMethodSettings() { + return myMethodSettings; + } + + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public MyProtoStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMyProtoStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "library-example.googleapis.com:1234"; + } + + + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MyProtoStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MyProtoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + myMethodSettings = settingsBuilder.myMethodSettings().build(); + } + + + + + /** + * Builder for MyProtoStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder myMethodSettings; + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + myMethodSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + myMethodSettings + ); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder.myMethodSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(MyProtoStubSettings settings) { + super(settings); + + myMethodSettings = settings.myMethodSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of( + myMethodSettings + ); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to myMethod. + */ + public UnaryCallSettings.Builder myMethodSettings() { + return myMethodSettings; + } + + @Override + public MyProtoStubSettings build() throws IOException { + return new MyProtoStubSettings(this); + } + } +} +============== file: src/test/java/com/google/example/library/v1/LibraryClientTest.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.example.library.v1.Comment; +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; +import com.google.example.library.v1.SomeMessage2; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.BoolValue; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.DoubleValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FloatValue; +import com.google.protobuf.Int32Value; +import com.google.protobuf.Int64Value; +import com.google.protobuf.ListValue; +import com.google.protobuf.StringValue; +import com.google.protobuf.Struct; +import com.google.protobuf.Timestamp; +import com.google.protobuf.UInt32Value; +import com.google.protobuf.UInt64Value; +import com.google.protobuf.Value; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class LibraryClientTest { + private static MockLibraryService mockLibraryService; + private static MockLabeler mockLabeler; + private static MockMyProto mockMyProto; + private static MockServiceHelper serviceHelper; + private LibraryClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockLibraryService = new MockLibraryService(); + mockLabeler = new MockLabeler(); + mockMyProto = new MockMyProto(); + serviceHelper = new MockServiceHelper(UUID.randomUUID().toString(), Arrays.asList(mockLibraryService, mockLabeler, mockMyProto)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + LibrarySettings settings = LibrarySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LibraryClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createShelfTest() { + ShelfName name = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); - this.createShelfCallable = callableFactory.createUnaryCallable(createShelfTransportSettings,settings.createShelfSettings(), clientContext); - this.getShelfCallable = callableFactory.createUnaryCallable(getShelfTransportSettings,settings.getShelfSettings(), clientContext); - this.listShelvesCallable = callableFactory.createUnaryCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); - this.listShelvesPagedCallable = callableFactory.createPagedCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); - this.deleteShelfCallable = callableFactory.createUnaryCallable(deleteShelfTransportSettings,settings.deleteShelfSettings(), clientContext); - this.mergeShelvesCallable = callableFactory.createUnaryCallable(mergeShelvesTransportSettings,settings.mergeShelvesSettings(), clientContext); - this.createBookCallable = callableFactory.createUnaryCallable(createBookTransportSettings,settings.createBookSettings(), clientContext); - this.publishSeriesCallable = callableFactory.createBatchingCallable(publishSeriesTransportSettings,settings.publishSeriesSettings(), clientContext); - this.getBookCallable = callableFactory.createUnaryCallable(getBookTransportSettings,settings.getBookSettings(), clientContext); - this.listBooksCallable = callableFactory.createUnaryCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); - this.listBooksPagedCallable = callableFactory.createPagedCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); - this.deleteBookCallable = callableFactory.createUnaryCallable(deleteBookTransportSettings,settings.deleteBookSettings(), clientContext); - this.updateBookCallable = callableFactory.createUnaryCallable(updateBookTransportSettings,settings.updateBookSettings(), clientContext); - this.moveBookCallable = callableFactory.createUnaryCallable(moveBookTransportSettings,settings.moveBookSettings(), clientContext); - this.listStringsCallable = callableFactory.createUnaryCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); - this.listStringsPagedCallable = callableFactory.createPagedCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); - this.addCommentsCallable = callableFactory.createBatchingCallable(addCommentsTransportSettings,settings.addCommentsSettings(), clientContext); - this.getBookFromArchiveCallable = callableFactory.createUnaryCallable(getBookFromArchiveTransportSettings,settings.getBookFromArchiveSettings(), clientContext); - this.getBookFromAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAnywhereTransportSettings,settings.getBookFromAnywhereSettings(), clientContext); - this.getBookFromAbsolutelyAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAbsolutelyAnywhereTransportSettings,settings.getBookFromAbsolutelyAnywhereSettings(), clientContext); - this.updateBookIndexCallable = callableFactory.createUnaryCallable(updateBookIndexTransportSettings,settings.updateBookIndexSettings(), clientContext); - this.streamShelvesCallable = callableFactory.createServerStreamingCallable(streamShelvesTransportSettings,settings.streamShelvesSettings(), clientContext); - this.streamBooksCallable = callableFactory.createServerStreamingCallable(streamBooksTransportSettings,settings.streamBooksSettings(), clientContext); - this.discussBookCallable = callableFactory.createBidiStreamingCallable(discussBookTransportSettings,settings.discussBookSettings(), clientContext); - this.monologAboutBookCallable = callableFactory.createClientStreamingCallable(monologAboutBookTransportSettings,settings.monologAboutBookSettings(), clientContext); - this.babbleAboutBookCallable = callableFactory.createClientStreamingCallable(babbleAboutBookTransportSettings,settings.babbleAboutBookSettings(), clientContext); - this.findRelatedBooksCallable = callableFactory.createUnaryCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); - this.findRelatedBooksPagedCallable = callableFactory.createPagedCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); - this.addLabelCallable = callableFactory.createUnaryCallable(addLabelTransportSettings,settings.addLabelSettings(), clientContext); - this.getBigBookCallable = callableFactory.createUnaryCallable(getBigBookTransportSettings,settings.getBigBookSettings(), clientContext); - this.getBigBookOperationCallable = callableFactory.createOperationCallable( - getBigBookTransportSettings,settings.getBigBookOperationSettings(), clientContext, this.operationsStub); - this.getBigNothingCallable = callableFactory.createUnaryCallable(getBigNothingTransportSettings,settings.getBigNothingSettings(), clientContext); - this.getBigNothingOperationCallable = callableFactory.createOperationCallable( - getBigNothingTransportSettings,settings.getBigNothingOperationSettings(), clientContext, this.operationsStub); - this.testOptionalRequiredFlatteningParamsCallable = callableFactory.createUnaryCallable(testOptionalRequiredFlatteningParamsTransportSettings,settings.testOptionalRequiredFlatteningParamsSettings(), clientContext); - this.privateListShelvesCallable = callableFactory.createUnaryCallable(privateListShelvesTransportSettings,settings.privateListShelvesSettings(), clientContext); + Shelf shelf = Shelf.newBuilder().build(); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + Shelf actualResponse = + client.createShelf(shelf); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateShelfRequest actualRequest = (CreateShelfRequest)actualRequests.get(0); + + Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public GrpcOperationsStub getOperationsStub() { - return operationsStub; + @Test + @SuppressWarnings("all") + public void createShelfExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + Shelf shelf = Shelf.newBuilder().build(); + + client.createShelf(shelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable createShelfCallable() { - return createShelfCallable; + + @Test + @SuppressWarnings("all") + public void getShelfTest() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + + Shelf actualResponse = + client.getShelf(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable getShelfCallable() { - return getShelfCallable; + @Test + @SuppressWarnings("all") + public void getShelfExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + + client.getShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getShelfTest2() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + + Shelf actualResponse = + client.getShelf(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getShelfExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + + client.getShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getShelfTest3() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + + Shelf actualResponse = + client.getShelf(name, message); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getShelfExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + + client.getShelf(name, message); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getShelfTest4() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + + Shelf actualResponse = + client.getShelf(name, message); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getShelfExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + + client.getShelf(name, message); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable listShelvesPagedCallable() { - return listShelvesPagedCallable; - } + @Test + @SuppressWarnings("all") + public void getShelfTest5() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); - public UnaryCallable listShelvesCallable() { - return listShelvesCallable; - } + ShelfName name = ShelfName.of("[SHELF_ID]"); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + SomeMessage message = SomeMessage.newBuilder().build(); - public UnaryCallable deleteShelfCallable() { - return deleteShelfCallable; - } + Shelf actualResponse = + client.getShelf(name, stringBuilder, message); + Assert.assertEquals(expectedResponse, actualResponse); - public UnaryCallable mergeShelvesCallable() { - return mergeShelvesCallable; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - public UnaryCallable createBookCallable() { - return createBookCallable; + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable publishSeriesCallable() { - return publishSeriesCallable; - } + @Test + @SuppressWarnings("all") + public void getShelfExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - public UnaryCallable getBookCallable() { - return getBookCallable; - } + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + SomeMessage message = SomeMessage.newBuilder().build(); - public UnaryCallable listBooksPagedCallable() { - return listBooksPagedCallable; + client.getShelf(name, stringBuilder, message); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable listBooksCallable() { - return listBooksCallable; - } + @Test + @SuppressWarnings("all") + public void getShelfTest6() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); - public UnaryCallable deleteBookCallable() { - return deleteBookCallable; - } + ShelfName name = ShelfName.of("[SHELF_ID]"); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + SomeMessage message = SomeMessage.newBuilder().build(); - public UnaryCallable updateBookCallable() { - return updateBookCallable; - } + Shelf actualResponse = + client.getShelf(name, stringBuilder, message); + Assert.assertEquals(expectedResponse, actualResponse); - public UnaryCallable moveBookCallable() { - return moveBookCallable; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - public UnaryCallable listStringsPagedCallable() { - return listStringsPagedCallable; + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable listStringsCallable() { - return listStringsCallable; - } + @Test + @SuppressWarnings("all") + public void getShelfExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - public UnaryCallable addCommentsCallable() { - return addCommentsCallable; - } + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + SomeMessage message = SomeMessage.newBuilder().build(); - public UnaryCallable getBookFromArchiveCallable() { - return getBookFromArchiveCallable; + client.getShelf(name, stringBuilder, message); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable getBookFromAnywhereCallable() { - return getBookFromAnywhereCallable; - } + @Test + @SuppressWarnings("all") + public void deleteShelfTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); - public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { - return getBookFromAbsolutelyAnywhereCallable; - } + ShelfName name = ShelfName.of("[SHELF_ID]"); - public UnaryCallable updateBookIndexCallable() { - return updateBookIndexCallable; - } + client.deleteShelf(name); - public ServerStreamingCallable streamShelvesCallable() { - return streamShelvesCallable; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); - public ServerStreamingCallable streamBooksCallable() { - return streamBooksCallable; + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public BidiStreamingCallable discussBookCallable() { - return discussBookCallable; - } + @Test + @SuppressWarnings("all") + public void deleteShelfExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - public ClientStreamingCallable monologAboutBookCallable() { - return monologAboutBookCallable; - } + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); - public ClientStreamingCallable babbleAboutBookCallable() { - return babbleAboutBookCallable; + client.deleteShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable findRelatedBooksPagedCallable() { - return findRelatedBooksPagedCallable; - } + @Test + @SuppressWarnings("all") + public void deleteShelfTest2() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); - public UnaryCallable findRelatedBooksCallable() { - return findRelatedBooksCallable; - } + ShelfName name = ShelfName.of("[SHELF_ID]"); - @Deprecated - public UnaryCallable addLabelCallable() { - return addLabelCallable; - } + client.deleteShelf(name); - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigBookOperationCallable() { - return getBigBookOperationCallable; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); - public UnaryCallable getBigBookCallable() { - return getBigBookCallable; + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigNothingOperationCallable() { - return getBigNothingOperationCallable; - } + @Test + @SuppressWarnings("all") + public void deleteShelfExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - public UnaryCallable getBigNothingCallable() { - return getBigNothingCallable; - } + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); - public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { - return testOptionalRequiredFlatteningParamsCallable; + client.deleteShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable privateListShelvesCallable() { - return privateListShelvesCallable; - } + @Test + @SuppressWarnings("all") + public void mergeShelvesTest() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); - @Override - public final void close() { - shutdown(); - } + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - @Override - public void shutdown() { - backgroundResources.shutdown(); - } + Shelf actualResponse = + client.mergeShelves(otherShelfName, name); + Assert.assertEquals(expectedResponse, actualResponse); - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); + + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } + @Test + @SuppressWarnings("all") + public void mergeShelvesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } + try { + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); + client.mergeShelves(otherShelfName, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } -} -============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoCallableFactory.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; + @Test + @SuppressWarnings("all") + public void mergeShelvesTest2() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); + mockLibraryService.addResponse(expectedResponse); -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.example.library.v1.MyProtoSettings; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC callable factory implementation for Google Example Library API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") -public class GrpcMyProtoCallableFactory implements GrpcStubCallableFactory { - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } + Shelf actualResponse = + client.mergeShelves(otherShelfName, name); + Assert.assertEquals(expectedResponse, actualResponse); - @Override - public UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, pagedCallSettings, clientContext); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable(grpcCallSettings, batchingCallSettings, clientContext); + Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - @Override - public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, - ClientContext clientContext, OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable(grpcCallSettings, operationCallSettings, clientContext, operationsStub); - } + @Test + @SuppressWarnings("all") + public void mergeShelvesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @Override - public BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); - } + try { + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - @Override - public ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + client.mergeShelves(otherShelfName, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - @Override - public ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); - } -} -============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoStub.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; + @Test + @SuppressWarnings("all") + public void createBookTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.example.library.v1.MyProtoSettings; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; + Book book = Book.newBuilder().build(); + ShelfName name = ShelfName.of("[SHELF_ID]"); -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC stub implementation for Google Example Library API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public class GrpcMyProtoStub extends MyProtoStub { + Book actualResponse = + client.createBook(book, name); + Assert.assertEquals(expectedResponse, actualResponse); - private static final MethodDescriptor myMethodMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.MyProto/MyMethod") - .setRequestMarshaller(ProtoUtils.marshaller(MethodRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(MethodResponse.getDefaultInstance())) - .build(); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + @SuppressWarnings("all") + public void createBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - private final BackgroundResource backgroundResources; + try { + Book book = Book.newBuilder().build(); + ShelfName name = ShelfName.of("[SHELF_ID]"); - private final UnaryCallable myMethodCallable; + client.createBook(book, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - private final GrpcStubCallableFactory callableFactory; + @Test + @SuppressWarnings("all") + public void createBookTest2() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - public static final GrpcMyProtoStub create(MyProtoStubSettings settings) throws IOException { - return new GrpcMyProtoStub(settings, ClientContext.create(settings)); - } + Book book = Book.newBuilder().build(); + ShelfName name = ShelfName.of("[SHELF_ID]"); - public static final GrpcMyProtoStub create(ClientContext clientContext) throws IOException { - return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext); - } + Book actualResponse = + client.createBook(book, name); + Assert.assertEquals(expectedResponse, actualResponse); - public static final GrpcMyProtoStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext, callableFactory); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); - /** - * Constructs an instance of GrpcMyProtoStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new GrpcMyProtoCallableFactory()); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Constructs an instance of GrpcMyProtoStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - this.callableFactory = callableFactory; - - GrpcCallSettings myMethodTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(myMethodMethodDescriptor) - .build(); + @Test + @SuppressWarnings("all") + public void createBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - this.myMethodCallable = callableFactory.createUnaryCallable(myMethodTransportSettings,settings.myMethodSettings(), clientContext); + try { + Book book = Book.newBuilder().build(); + ShelfName name = ShelfName.of("[SHELF_ID]"); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + client.createBook(book, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } + @Test + @SuppressWarnings("all") + public void publishSeriesTest() { + String bookNamesElement = "bookNamesElement1491670575"; + List bookNames = Arrays.asList(bookNamesElement); + PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() + .addAllBookNames(bookNames) + .build(); + mockLibraryService.addResponse(expectedResponse); - public UnaryCallable myMethodCallable() { - return myMethodCallable; - } + List books = new ArrayList<>(); + int edition = 1887963714; + String publisher = "publisher1447404028"; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + Shelf shelf = Shelf.newBuilder().build(); - @Override - public final void close() { - shutdown(); - } + PublishSeriesResponse actualResponse = + client.publishSeries(books, edition, publisher, seriesUuid, shelf); + Assert.assertEquals(expectedResponse, actualResponse); - @Override - public void shutdown() { - backgroundResources.shutdown(); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); + Assert.assertEquals(books, actualRequest.getBooksList()); + Assert.assertEquals(edition, actualRequest.getEdition()); + Assert.assertEquals(publisher, PublisherNames.parse(actualRequest.getPublisher())); + Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); + Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } + @Test + @SuppressWarnings("all") + public void publishSeriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } + try { + List books = new ArrayList<>(); + int edition = 1887963714; + String publisher = "publisher1447404028"; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + Shelf shelf = Shelf.newBuilder().build(); - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); + client.publishSeries(books, edition, publisher, seriesUuid, shelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } -} -============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStub.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; + @Test + @SuppressWarnings("all") + public void publishSeriesTest2() { + String bookNamesElement = "bookNamesElement1491670575"; + List bookNames = Arrays.asList(bookNamesElement); + PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() + .addAllBookNames(bookNames) + .build(); + mockLibraryService.addResponse(expectedResponse); -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.resourcenames.ResourceName; -import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.ArchivedBookName; -import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromAnywhere; -import com.google.example.library.v1.BookFromArchive; -import com.google.example.library.v1.BookName; -import com.google.example.library.v1.Comment; -import com.google.example.library.v1.CreateBookRequest; -import com.google.example.library.v1.CreateShelfRequest; -import com.google.example.library.v1.DeleteBookRequest; -import com.google.example.library.v1.DeleteShelfRequest; -import com.google.example.library.v1.DiscussBookRequest; -import com.google.example.library.v1.FindRelatedBooksRequest; -import com.google.example.library.v1.FindRelatedBooksResponse; -import com.google.example.library.v1.FolderName; -import com.google.example.library.v1.GetBigBookMetadata; -import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; -import com.google.example.library.v1.GetBookFromAnywhereRequest; -import com.google.example.library.v1.GetBookFromArchiveRequest; -import com.google.example.library.v1.GetBookRequest; -import com.google.example.library.v1.GetShelfRequest; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.ListBooksRequest; -import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListShelvesRequest; -import com.google.example.library.v1.ListShelvesResponse; -import com.google.example.library.v1.ListStringsRequest; -import com.google.example.library.v1.ListStringsResponse; -import com.google.example.library.v1.LocationName; -import com.google.example.library.v1.MergeShelvesRequest; -import com.google.example.library.v1.MoveBookRequest; -import com.google.example.library.v1.ProjectName; -import com.google.example.library.v1.PublishSeriesRequest; -import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.PublisherName; -import com.google.example.library.v1.SeriesUuid; -import com.google.example.library.v1.Shelf; -import com.google.example.library.v1.ShelfName; -import com.google.example.library.v1.SomeMessage; -import com.google.example.library.v1.StreamBooksRequest; -import com.google.example.library.v1.StreamShelvesRequest; -import com.google.example.library.v1.StreamShelvesResponse; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; -import com.google.example.library.v1.UpdateBookIndexRequest; -import com.google.example.library.v1.UpdateBookRequest; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.protobuf.Any; -import com.google.protobuf.BoolValue; -import com.google.protobuf.ByteString; -import com.google.protobuf.BytesValue; -import com.google.protobuf.DoubleValue; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.FloatValue; -import com.google.protobuf.Int32Value; -import com.google.protobuf.Int64Value; -import com.google.protobuf.ListValue; -import com.google.protobuf.StringValue; -import com.google.protobuf.Struct; -import com.google.protobuf.Timestamp; -import com.google.protobuf.UInt32Value; -import com.google.protobuf.UInt64Value; -import com.google.protobuf.Value; -import com.google.tagger.v1.TaggerProto.AddLabelRequest; -import com.google.tagger.v1.TaggerProto.AddLabelResponse; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; + List books = new ArrayList<>(); + int edition = 1887963714; + String publisher = "publisher1447404028"; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + Shelf shelf = Shelf.newBuilder().build(); -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Base stub class for Google Example Library API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public abstract class LibraryServiceStub implements BackgroundResource { + PublishSeriesResponse actualResponse = + client.publishSeries(books, edition, publisher, seriesUuid, shelf); + Assert.assertEquals(expectedResponse, actualResponse); - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); - public UnaryCallable createShelfCallable() { - throw new UnsupportedOperationException("Not implemented: createShelfCallable()"); + Assert.assertEquals(books, actualRequest.getBooksList()); + Assert.assertEquals(edition, actualRequest.getEdition()); + Assert.assertEquals(publisher, actualRequest.getPublisher()); + Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); + Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable getShelfCallable() { - throw new UnsupportedOperationException("Not implemented: getShelfCallable()"); - } + @Test + @SuppressWarnings("all") + public void publishSeriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - public UnaryCallable listShelvesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listShelvesPagedCallable()"); - } + try { + List books = new ArrayList<>(); + int edition = 1887963714; + String publisher = "publisher1447404028"; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + Shelf shelf = Shelf.newBuilder().build(); - public UnaryCallable listShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: listShelvesCallable()"); + client.publishSeries(books, edition, publisher, seriesUuid, shelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable deleteShelfCallable() { - throw new UnsupportedOperationException("Not implemented: deleteShelfCallable()"); - } + @Test + @SuppressWarnings("all") + public void getBookTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - public UnaryCallable mergeShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: mergeShelvesCallable()"); - } + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - public UnaryCallable createBookCallable() { - throw new UnsupportedOperationException("Not implemented: createBookCallable()"); - } + Book actualResponse = + client.getBook(name); + Assert.assertEquals(expectedResponse, actualResponse); - public UnaryCallable publishSeriesCallable() { - throw new UnsupportedOperationException("Not implemented: publishSeriesCallable()"); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable getBookCallable() { - throw new UnsupportedOperationException("Not implemented: getBookCallable()"); + @Test + @SuppressWarnings("all") + public void getBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable listBooksPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listBooksPagedCallable()"); + @Test + @SuppressWarnings("all") + public void getBookTest2() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + Book actualResponse = + client.getBook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable listBooksCallable() { - throw new UnsupportedOperationException("Not implemented: listBooksCallable()"); + @Test + @SuppressWarnings("all") + public void getBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable deleteBookCallable() { - throw new UnsupportedOperationException("Not implemented: deleteBookCallable()"); + @Test + @SuppressWarnings("all") + public void listBooksTest() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + String filter = "book-filter-string"; + String name = "name3373707"; + + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, PublisherNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable updateBookCallable() { - throw new UnsupportedOperationException("Not implemented: updateBookCallable()"); + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + String filter = "book-filter-string"; + String name = "name3373707"; + + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable moveBookCallable() { - throw new UnsupportedOperationException("Not implemented: moveBookCallable()"); + @Test + @SuppressWarnings("all") + public void listBooksTest2() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + String filter = "book-filter-string"; + ProjectName name = ProjectName.of("[PROJECT]"); + + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, ProjectName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable listStringsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listStringsPagedCallable()"); + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + String filter = "book-filter-string"; + ProjectName name = ProjectName.of("[PROJECT]"); + + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable listStringsCallable() { - throw new UnsupportedOperationException("Not implemented: listStringsCallable()"); - } + @Test + @SuppressWarnings("all") + public void listBooksTest3() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + String filter = "book-filter-string"; + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - public UnaryCallable addCommentsCallable() { - throw new UnsupportedOperationException("Not implemented: addCommentsCallable()"); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable getBookFromArchiveCallable() { - throw new UnsupportedOperationException("Not implemented: getBookFromArchiveCallable()"); - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - public UnaryCallable getBookFromAnywhereCallable() { - throw new UnsupportedOperationException("Not implemented: getBookFromAnywhereCallable()"); - } + try { + String filter = "book-filter-string"; + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { - throw new UnsupportedOperationException("Not implemented: getBookFromAbsolutelyAnywhereCallable()"); + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public UnaryCallable updateBookIndexCallable() { - throw new UnsupportedOperationException("Not implemented: updateBookIndexCallable()"); - } + @Test + @SuppressWarnings("all") + public void listBooksTest4() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - public ServerStreamingCallable streamShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: streamShelvesCallable()"); - } + String filter = "book-filter-string"; + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); - public ServerStreamingCallable streamBooksCallable() { - throw new UnsupportedOperationException("Not implemented: streamBooksCallable()"); - } + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - public BidiStreamingCallable discussBookCallable() { - throw new UnsupportedOperationException("Not implemented: discussBookCallable()"); - } + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - public ClientStreamingCallable monologAboutBookCallable() { - throw new UnsupportedOperationException("Not implemented: monologAboutBookCallable()"); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - public ClientStreamingCallable babbleAboutBookCallable() { - throw new UnsupportedOperationException("Not implemented: babbleAboutBookCallable()"); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, OrganizationName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - public UnaryCallable findRelatedBooksPagedCallable() { - throw new UnsupportedOperationException("Not implemented: findRelatedBooksPagedCallable()"); - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - public UnaryCallable findRelatedBooksCallable() { - throw new UnsupportedOperationException("Not implemented: findRelatedBooksCallable()"); - } + try { + String filter = "book-filter-string"; + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); - @Deprecated - public UnaryCallable addLabelCallable() { - throw new UnsupportedOperationException("Not implemented: addLabelCallable()"); + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigBookOperationCallable() { - throw new UnsupportedOperationException("Not implemented: getBigBookOperationCallable()"); - } + @Test + @SuppressWarnings("all") + public void listBooksTest5() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - public UnaryCallable getBigBookCallable() { - throw new UnsupportedOperationException("Not implemented: getBigBookCallable()"); - } + String filter = "book-filter-string"; + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigNothingOperationCallable() { - throw new UnsupportedOperationException("Not implemented: getBigNothingOperationCallable()"); - } + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - public UnaryCallable getBigNothingCallable() { - throw new UnsupportedOperationException("Not implemented: getBigNothingCallable()"); - } + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { - throw new UnsupportedOperationException("Not implemented: testOptionalRequiredFlatteningParamsCallable()"); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - public UnaryCallable privateListShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: privateListShelvesCallable()"); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @Override - public abstract void close(); -} -============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStubSettings.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.batching.BatchingSettings; -import com.google.api.gax.batching.FlowControlSettings; -import com.google.api.gax.batching.FlowController; -import com.google.api.gax.batching.FlowController.LimitExceededBehavior; -import com.google.api.gax.batching.PartitionKey; -import com.google.api.gax.batching.RequestBuilder; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.BatchedRequestIssuer; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BatchingDescriptor; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromAnywhere; -import com.google.example.library.v1.BookFromArchive; -import com.google.example.library.v1.Comment; -import com.google.example.library.v1.CreateBookRequest; -import com.google.example.library.v1.CreateShelfRequest; -import com.google.example.library.v1.DeleteBookRequest; -import com.google.example.library.v1.DeleteShelfRequest; -import com.google.example.library.v1.DiscussBookRequest; -import com.google.example.library.v1.FindRelatedBooksRequest; -import com.google.example.library.v1.FindRelatedBooksResponse; -import com.google.example.library.v1.GetBigBookMetadata; -import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; -import com.google.example.library.v1.GetBookFromAnywhereRequest; -import com.google.example.library.v1.GetBookFromArchiveRequest; -import com.google.example.library.v1.GetBookRequest; -import com.google.example.library.v1.GetShelfRequest; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.LibraryServiceGrpc; -import com.google.example.library.v1.ListBooksRequest; -import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListShelvesRequest; -import com.google.example.library.v1.ListShelvesResponse; -import com.google.example.library.v1.ListStringsRequest; -import com.google.example.library.v1.ListStringsResponse; -import com.google.example.library.v1.MergeShelvesRequest; -import com.google.example.library.v1.MoveBookRequest; -import com.google.example.library.v1.PublishSeriesRequest; -import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.Shelf; -import com.google.example.library.v1.StreamBooksRequest; -import com.google.example.library.v1.StreamShelvesRequest; -import com.google.example.library.v1.StreamShelvesResponse; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; -import com.google.example.library.v1.UpdateBookIndexRequest; -import com.google.example.library.v1.UpdateBookRequest; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.tagger.v1.LabelerGrpc; -import com.google.tagger.v1.TaggerProto.AddLabelRequest; -import com.google.tagger.v1.TaggerProto.AddLabelResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import javax.annotation.Generated; -import org.threeten.bp.Duration; + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link LibraryServiceStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (library-example.googleapis.com) and default port (1234) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. - * - * For example, to set the total timeout of createShelf to 30 seconds: - * - *

- * 
- * LibraryServiceStubSettings.Builder librarySettingsBuilder =
- *     LibraryServiceStubSettings.newBuilder();
- * librarySettingsBuilder.createShelfSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * LibraryServiceStubSettings librarySettings = librarySettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -public class LibraryServiceStubSettings extends StubSettings { - /** - * The default scopes of the service. - */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-platform") - .add("https://www.googleapis.com/auth/library") + try { + String filter = "book-filter-string"; + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBooksTest6() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) .build(); + mockLibraryService.addResponse(expectedResponse); - private final UnaryCallSettings createShelfSettings; - private final UnaryCallSettings getShelfSettings; - private final PagedCallSettings listShelvesSettings; - private final UnaryCallSettings deleteShelfSettings; - private final UnaryCallSettings mergeShelvesSettings; - private final UnaryCallSettings createBookSettings; - private final BatchingCallSettings publishSeriesSettings; - private final UnaryCallSettings getBookSettings; - private final PagedCallSettings listBooksSettings; - private final UnaryCallSettings deleteBookSettings; - private final UnaryCallSettings updateBookSettings; - private final UnaryCallSettings moveBookSettings; - private final PagedCallSettings listStringsSettings; - private final BatchingCallSettings addCommentsSettings; - private final UnaryCallSettings getBookFromArchiveSettings; - private final UnaryCallSettings getBookFromAnywhereSettings; - private final UnaryCallSettings getBookFromAbsolutelyAnywhereSettings; - private final UnaryCallSettings updateBookIndexSettings; - private final ServerStreamingCallSettings streamShelvesSettings; - private final ServerStreamingCallSettings streamBooksSettings; - private final StreamingCallSettings discussBookSettings; - private final StreamingCallSettings monologAboutBookSettings; - private final StreamingCallSettings babbleAboutBookSettings; - private final PagedCallSettings findRelatedBooksSettings; - private final UnaryCallSettings addLabelSettings; - private final UnaryCallSettings getBigBookSettings; - private final OperationCallSettings getBigBookOperationSettings; - private final UnaryCallSettings getBigNothingSettings; - private final OperationCallSettings getBigNothingOperationSettings; - private final UnaryCallSettings testOptionalRequiredFlatteningParamsSettings; - private final UnaryCallSettings privateListShelvesSettings; + String filter = "book-filter-string"; + String name = "name3373707"; - /** - * Returns the object with the settings used for calls to createShelf. - */ - public UnaryCallSettings createShelfSettings() { - return createShelfSettings; + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, PublisherNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Returns the object with the settings used for calls to getShelf. - */ - public UnaryCallSettings getShelfSettings() { - return getShelfSettings; + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + String filter = "book-filter-string"; + String name = "name3373707"; + + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - /** - * Returns the object with the settings used for calls to listShelves. - */ - public PagedCallSettings listShelvesSettings() { - return listShelvesSettings; + @Test + @SuppressWarnings("all") + public void listBooksTest7() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + String filter = "book-filter-string"; + FolderName name = FolderName.of("[FOLDER]"); + + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, FolderName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Returns the object with the settings used for calls to deleteShelf. - */ - public UnaryCallSettings deleteShelfSettings() { - return deleteShelfSettings; + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest7() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + String filter = "book-filter-string"; + FolderName name = FolderName.of("[FOLDER]"); + + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - /** - * Returns the object with the settings used for calls to mergeShelves. - */ - public UnaryCallSettings mergeShelvesSettings() { - return mergeShelvesSettings; + @Test + @SuppressWarnings("all") + public void listBooksTest8() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + String filter = "book-filter-string"; + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Returns the object with the settings used for calls to createBook. - */ - public UnaryCallSettings createBookSettings() { - return createBookSettings; + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest8() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + String filter = "book-filter-string"; + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBooksTest9() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + String filter = "book-filter-string"; + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Returns the object with the settings used for calls to publishSeries. - */ - public BatchingCallSettings publishSeriesSettings() { - return publishSeriesSettings; - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest9() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns the object with the settings used for calls to getBook. - */ - public UnaryCallSettings getBookSettings() { - return getBookSettings; - } + try { + String filter = "book-filter-string"; + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the object with the settings used for calls to listBooks. - */ - public PagedCallSettings listBooksSettings() { - return listBooksSettings; + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - /** - * Returns the object with the settings used for calls to deleteBook. - */ - public UnaryCallSettings deleteBookSettings() { - return deleteBookSettings; - } + @Test + @SuppressWarnings("all") + public void listBooksTest10() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the object with the settings used for calls to updateBook. - */ - public UnaryCallSettings updateBookSettings() { - return updateBookSettings; - } + String filter = "book-filter-string"; + ArchiveName name = ArchiveName.of("[ARCHIVE]"); - /** - * Returns the object with the settings used for calls to moveBook. - */ - public UnaryCallSettings moveBookSettings() { - return moveBookSettings; - } + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - /** - * Returns the object with the settings used for calls to listStrings. - */ - public PagedCallSettings listStringsSettings() { - return listStringsSettings; - } + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - /** - * Returns the object with the settings used for calls to addComments. - */ - public BatchingCallSettings addCommentsSettings() { - return addCommentsSettings; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - /** - * Returns the object with the settings used for calls to getBookFromArchive. - */ - public UnaryCallSettings getBookFromArchiveSettings() { - return getBookFromArchiveSettings; + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, ArchiveName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Returns the object with the settings used for calls to getBookFromAnywhere. - */ - public UnaryCallSettings getBookFromAnywhereSettings() { - return getBookFromAnywhereSettings; - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest10() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns the object with the settings used for calls to getBookFromAbsolutelyAnywhere. - */ - public UnaryCallSettings getBookFromAbsolutelyAnywhereSettings() { - return getBookFromAbsolutelyAnywhereSettings; - } + try { + String filter = "book-filter-string"; + ArchiveName name = ArchiveName.of("[ARCHIVE]"); - /** - * Returns the object with the settings used for calls to updateBookIndex. - */ - public UnaryCallSettings updateBookIndexSettings() { - return updateBookIndexSettings; + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - /** - * Returns the object with the settings used for calls to streamShelves. - */ - public ServerStreamingCallSettings streamShelvesSettings() { - return streamShelvesSettings; - } + @Test + @SuppressWarnings("all") + public void listBooksTest11() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the object with the settings used for calls to streamBooks. - */ - public ServerStreamingCallSettings streamBooksSettings() { - return streamBooksSettings; - } + String filter = "book-filter-string"; + ShelfName name = ShelfName.of("[SHELF_ID]"); - /** - * Returns the object with the settings used for calls to discussBook. - */ - public StreamingCallSettings discussBookSettings() { - return discussBookSettings; - } + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - /** - * Returns the object with the settings used for calls to monologAboutBook. - */ - public StreamingCallSettings monologAboutBookSettings() { - return monologAboutBookSettings; - } + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - /** - * Returns the object with the settings used for calls to babbleAboutBook. - */ - public StreamingCallSettings babbleAboutBookSettings() { - return babbleAboutBookSettings; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - /** - * Returns the object with the settings used for calls to findRelatedBooks. - */ - public PagedCallSettings findRelatedBooksSettings() { - return findRelatedBooksSettings; + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Returns the object with the settings used for calls to addLabel. - */ - public UnaryCallSettings addLabelSettings() { - return addLabelSettings; - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest11() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns the object with the settings used for calls to getBigBook. - */ - public UnaryCallSettings getBigBookSettings() { - return getBigBookSettings; - } + try { + String filter = "book-filter-string"; + ShelfName name = ShelfName.of("[SHELF_ID]"); - /** - * Returns the object with the settings used for calls to getBigBook. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings getBigBookOperationSettings() { - return getBigBookOperationSettings; + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - /** - * Returns the object with the settings used for calls to getBigNothing. - */ - public UnaryCallSettings getBigNothingSettings() { - return getBigNothingSettings; - } + @Test + @SuppressWarnings("all") + public void listBooksTest12() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the object with the settings used for calls to getBigNothing. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings getBigNothingOperationSettings() { - return getBigNothingOperationSettings; - } + String filter = "book-filter-string"; + BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]"); - /** - * Returns the object with the settings used for calls to testOptionalRequiredFlatteningParams. - */ - public UnaryCallSettings testOptionalRequiredFlatteningParamsSettings() { - return testOptionalRequiredFlatteningParamsSettings; - } + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - /** - * Returns the object with the settings used for calls to privateListShelves. - */ - public UnaryCallSettings privateListShelvesSettings() { - return privateListShelvesSettings; - } + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public LibraryServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcLibraryServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); - } + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, BillingAccountName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest12() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return "library-example.googleapis.com:1234"; + try { + String filter = "book-filter-string"; + BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]"); + + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } + @Test + @SuppressWarnings("all") + public void listBooksTest13() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } + String filter = "book-filter-string"; + String name = "name3373707"; + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - ; - } + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, PublisherNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LibraryServiceStubSettings.class)) - .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest13() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); - } + try { + String filter = "book-filter-string"; + String name = "name3373707"; - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - /** - * Returns a builder containing all the values of this settings class. - */ - public Builder toBuilder() { - return new Builder(this); - } + @Test + @SuppressWarnings("all") + public void listBooksTest14() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - protected LibraryServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); + String filter = "book-filter-string"; + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); - createShelfSettings = settingsBuilder.createShelfSettings().build(); - getShelfSettings = settingsBuilder.getShelfSettings().build(); - listShelvesSettings = settingsBuilder.listShelvesSettings().build(); - deleteShelfSettings = settingsBuilder.deleteShelfSettings().build(); - mergeShelvesSettings = settingsBuilder.mergeShelvesSettings().build(); - createBookSettings = settingsBuilder.createBookSettings().build(); - publishSeriesSettings = settingsBuilder.publishSeriesSettings().build(); - getBookSettings = settingsBuilder.getBookSettings().build(); - listBooksSettings = settingsBuilder.listBooksSettings().build(); - deleteBookSettings = settingsBuilder.deleteBookSettings().build(); - updateBookSettings = settingsBuilder.updateBookSettings().build(); - moveBookSettings = settingsBuilder.moveBookSettings().build(); - listStringsSettings = settingsBuilder.listStringsSettings().build(); - addCommentsSettings = settingsBuilder.addCommentsSettings().build(); - getBookFromArchiveSettings = settingsBuilder.getBookFromArchiveSettings().build(); - getBookFromAnywhereSettings = settingsBuilder.getBookFromAnywhereSettings().build(); - getBookFromAbsolutelyAnywhereSettings = settingsBuilder.getBookFromAbsolutelyAnywhereSettings().build(); - updateBookIndexSettings = settingsBuilder.updateBookIndexSettings().build(); - streamShelvesSettings = settingsBuilder.streamShelvesSettings().build(); - streamBooksSettings = settingsBuilder.streamBooksSettings().build(); - discussBookSettings = settingsBuilder.discussBookSettings().build(); - monologAboutBookSettings = settingsBuilder.monologAboutBookSettings().build(); - babbleAboutBookSettings = settingsBuilder.babbleAboutBookSettings().build(); - findRelatedBooksSettings = settingsBuilder.findRelatedBooksSettings().build(); - addLabelSettings = settingsBuilder.addLabelSettings().build(); - getBigBookSettings = settingsBuilder.getBigBookSettings().build(); - getBigBookOperationSettings = settingsBuilder.getBigBookOperationSettings().build(); - getBigNothingSettings = settingsBuilder.getBigNothingSettings().build(); - getBigNothingOperationSettings = settingsBuilder.getBigNothingOperationSettings().build(); - testOptionalRequiredFlatteningParamsSettings = settingsBuilder.testOptionalRequiredFlatteningParamsSettings().build(); - privateListShelvesSettings = settingsBuilder.privateListShelvesSettings().build(); - } + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - private static final PagedListDescriptor LIST_SHELVES_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListShelvesRequest injectToken(ListShelvesRequest payload, String token) { - return ListShelvesRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListShelvesRequest injectPageSize(ListShelvesRequest payload, int pageSize) { - throw new UnsupportedOperationException("page size is not supported by this API method"); - } - @Override - public Integer extractPageSize(ListShelvesRequest payload) { - throw new UnsupportedOperationException("page size is not supported by this API method"); - } - @Override - public String extractNextToken(ListShelvesResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListShelvesResponse payload) { - return payload.getShelvesList() != null ? payload.getShelvesList() : - ImmutableList.of(); - } - }; + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - private static final PagedListDescriptor LIST_BOOKS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListBooksRequest injectToken(ListBooksRequest payload, String token) { - return ListBooksRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListBooksRequest injectPageSize(ListBooksRequest payload, int pageSize) { - return ListBooksRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(ListBooksRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(ListBooksResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListBooksResponse payload) { - return payload.getBooksList() != null ? payload.getBooksList() : - ImmutableList.of(); - } - }; + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - private static final PagedListDescriptor LIST_STRINGS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListStringsRequest injectToken(ListStringsRequest payload, String token) { - return ListStringsRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListStringsRequest injectPageSize(ListStringsRequest payload, int pageSize) { - return ListStringsRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(ListStringsRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(ListStringsResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListStringsResponse payload) { - return payload.getStringsList() != null ? payload.getStringsList() : - ImmutableList.of(); - } - }; + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, LocationName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - private static final PagedListDescriptor FIND_RELATED_BOOKS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public FindRelatedBooksRequest injectToken(FindRelatedBooksRequest payload, String token) { - return FindRelatedBooksRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public FindRelatedBooksRequest injectPageSize(FindRelatedBooksRequest payload, int pageSize) { - return FindRelatedBooksRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(FindRelatedBooksRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(FindRelatedBooksResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(FindRelatedBooksResponse payload) { - return payload.getNamesList() != null ? payload.getNamesList() : - ImmutableList.of(); - } - }; + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest14() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - private static final PagedListResponseFactory LIST_SHELVES_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListShelvesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_SHELVES_PAGE_STR_DESC, request, context); - return ListShelvesPagedResponse.createAsync(pageContext, futureResponse); - } - }; + try { + String filter = "book-filter-string"; + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); - private static final PagedListResponseFactory LIST_BOOKS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListBooksRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_BOOKS_PAGE_STR_DESC, request, context); - return ListBooksPagedResponse.createAsync(pageContext, futureResponse); - } - }; + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - private static final PagedListResponseFactory LIST_STRINGS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListStringsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_STRINGS_PAGE_STR_DESC, request, context); - return ListStringsPagedResponse.createAsync(pageContext, futureResponse); - } - }; + @Test + @SuppressWarnings("all") + public void listBooksTest15() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); - private static final PagedListResponseFactory FIND_RELATED_BOOKS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - FindRelatedBooksRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, FIND_RELATED_BOOKS_PAGE_STR_DESC, request, context); - return FindRelatedBooksPagedResponse.createAsync(pageContext, futureResponse); - } - }; + String filter = "book-filter-string"; + String name = "name3373707"; - private static final BatchingDescriptor PUBLISH_SERIES_BATCHING_DESC = - new BatchingDescriptor() { - @Override - public PartitionKey getBatchPartitionKey(PublishSeriesRequest request) { - return new PartitionKey(request.getEdition(), request.getName()); - } + ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - @Override - public RequestBuilder getRequestBuilder() { - return new RequestBuilder() { - private PublishSeriesRequest.Builder builder; - @Override - public void appendRequest(PublishSeriesRequest request) { - if (builder == null) { - builder = request.toBuilder(); - } else { - builder.addAllBooks(request.getBooksList()); - } - } - @Override - public PublishSeriesRequest build() { - return builder.build(); - } - }; - } + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - @Override - public void splitResponse( - PublishSeriesResponse batchResponse, - Collection> batch) { - int batchMessageIndex = 0; - for (BatchedRequestIssuer responder : batch) { - List subresponseElements = new ArrayList<>(); - long subresponseCount = responder.getMessageCount(); - for (int i = 0; i < subresponseCount; i++) { - subresponseElements.add(batchResponse.getBookNames(batchMessageIndex)); - batchMessageIndex += 1; - } - PublishSeriesResponse response = - PublishSeriesResponse.newBuilder().addAllBookNames(subresponseElements).build(); - responder.setResponse(response); - } - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - @Override - public void splitException( - Throwable throwable, - Collection> batch) { - for (BatchedRequestIssuer responder : batch) { - responder.setException(throwable); - } - } + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - @Override - public long countElements(PublishSeriesRequest request) { - return request.getBooksCount(); - } + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest15() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @Override - public long countBytes(PublishSeriesRequest request) { - return request.getSerializedSize(); - } - }; + try { + String filter = "book-filter-string"; + String name = "name3373707"; - private static final BatchingDescriptor ADD_COMMENTS_BATCHING_DESC = - new BatchingDescriptor() { - @Override - public PartitionKey getBatchPartitionKey(AddCommentsRequest request) { - return new PartitionKey(request.getName()); - } + client.listBooks(filter, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - @Override - public RequestBuilder getRequestBuilder() { - return new RequestBuilder() { - private AddCommentsRequest.Builder builder; - @Override - public void appendRequest(AddCommentsRequest request) { - if (builder == null) { - builder = request.toBuilder(); - } else { - builder.addAllComments(request.getCommentsList()); - } - } - @Override - public AddCommentsRequest build() { - return builder.build(); - } - }; - } + @Test + @SuppressWarnings("all") + public void deleteBookTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); - @Override - public void splitResponse( - Empty batchResponse, - Collection> batch) { - int batchMessageIndex = 0; - for (BatchedRequestIssuer responder : batch) { - Empty response = - Empty.newBuilder().build(); - responder.setResponse(response); - } - } + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.deleteBook(name); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.deleteBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - @Override - public void splitException( - Throwable throwable, - Collection> batch) { - for (BatchedRequestIssuer responder : batch) { - responder.setException(throwable); - } - } + @Test + @SuppressWarnings("all") + public void deleteBookTest2() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); - @Override - public long countElements(AddCommentsRequest request) { - return request.getCommentsCount(); - } + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - @Override - public long countBytes(AddCommentsRequest request) { - return request.getSerializedSize(); - } - }; + client.deleteBook(name); - /** - * Builder for LibraryServiceStubSettings. - */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); - private final UnaryCallSettings.Builder createShelfSettings; - private final UnaryCallSettings.Builder getShelfSettings; - private final PagedCallSettings.Builder listShelvesSettings; - private final UnaryCallSettings.Builder deleteShelfSettings; - private final UnaryCallSettings.Builder mergeShelvesSettings; - private final UnaryCallSettings.Builder createBookSettings; - private final BatchingCallSettings.Builder publishSeriesSettings; - private final UnaryCallSettings.Builder getBookSettings; - private final PagedCallSettings.Builder listBooksSettings; - private final UnaryCallSettings.Builder deleteBookSettings; - private final UnaryCallSettings.Builder updateBookSettings; - private final UnaryCallSettings.Builder moveBookSettings; - private final PagedCallSettings.Builder listStringsSettings; - private final BatchingCallSettings.Builder addCommentsSettings; - private final UnaryCallSettings.Builder getBookFromArchiveSettings; - private final UnaryCallSettings.Builder getBookFromAnywhereSettings; - private final UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings; - private final UnaryCallSettings.Builder updateBookIndexSettings; - private final ServerStreamingCallSettings.Builder streamShelvesSettings; - private final ServerStreamingCallSettings.Builder streamBooksSettings; - private final StreamingCallSettings.Builder discussBookSettings; - private final StreamingCallSettings.Builder monologAboutBookSettings; - private final StreamingCallSettings.Builder babbleAboutBookSettings; - private final PagedCallSettings.Builder findRelatedBooksSettings; - private final UnaryCallSettings.Builder addLabelSettings; - private final UnaryCallSettings.Builder getBigBookSettings; - private final OperationCallSettings.Builder getBigBookOperationSettings; - private final UnaryCallSettings.Builder getBigNothingSettings; - private final OperationCallSettings.Builder getBigNothingOperationSettings; - private final UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings; - private final UnaryCallSettings.Builder privateListShelvesSettings; + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + @Test + @SuppressWarnings("all") + public void deleteBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - static { - ImmutableMap.Builder> definitions = ImmutableMap.builder(); - definitions.put( - "idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.deleteBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + @Test + @SuppressWarnings("all") + public void updateBookTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.2) - .setMaxRetryDelay(Duration.ofMillis(1000L)) - .setInitialRpcTimeout(Duration.ofMillis(300L)) - .setRpcTimeoutMultiplier(1.3) - .setMaxRpcTimeout(Duration.ofMillis(3000L)) - .setTotalTimeout(Duration.ofMillis(30000L)) - .build(); - definitions.put("default", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - protected Builder() { - this((ClientContext) null); - } + Book actualResponse = + client.updateBook(book, name); + Assert.assertEquals(expectedResponse, actualResponse); - protected Builder(ClientContext clientContext) { - super(clientContext); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - createShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - getShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + @Test + @SuppressWarnings("all") + public void updateBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - listShelvesSettings = PagedCallSettings.newBuilder( - LIST_SHELVES_PAGE_STR_FACT); + try { + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - deleteShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + client.updateBook(book, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - mergeShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + @Test + @SuppressWarnings("all") + public void updateBookTest2() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - createBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - publishSeriesSettings = BatchingCallSettings.newBuilder( - PUBLISH_SERIES_BATCHING_DESC) - .setBatchingSettings(BatchingSettings.newBuilder().build()); + Book actualResponse = + client.updateBook(book, name); + Assert.assertEquals(expectedResponse, actualResponse); - getBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - listBooksSettings = PagedCallSettings.newBuilder( - LIST_BOOKS_PAGE_STR_FACT); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - deleteBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + @Test + @SuppressWarnings("all") + public void updateBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - updateBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + try { + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - moveBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + client.updateBook(book, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - listStringsSettings = PagedCallSettings.newBuilder( - LIST_STRINGS_PAGE_STR_FACT); + @Test + @SuppressWarnings("all") + public void updateBookTest3() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - addCommentsSettings = BatchingCallSettings.newBuilder( - ADD_COMMENTS_BATCHING_DESC) - .setBatchingSettings(BatchingSettings.newBuilder().build()); + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + FieldMask physicalMask = FieldMask.newBuilder().build(); + com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); - getBookFromArchiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + Book actualResponse = + client.updateBook(optionalFoo, book, name, physicalMask, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); - getBookFromAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - getBookFromAbsolutelyAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - updateBookIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + @Test + @SuppressWarnings("all") + public void updateBookExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - streamShelvesSettings = ServerStreamingCallSettings.newBuilder(); + try { + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + FieldMask physicalMask = FieldMask.newBuilder().build(); + com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); + + client.updateBook(optionalFoo, book, name, physicalMask, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookTest4() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - streamBooksSettings = ServerStreamingCallSettings.newBuilder(); + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + FieldMask physicalMask = FieldMask.newBuilder().build(); + com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); - discussBookSettings = StreamingCallSettings.newBuilder(); + Book actualResponse = + client.updateBook(optionalFoo, book, name, physicalMask, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); - monologAboutBookSettings = StreamingCallSettings.newBuilder(); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - babbleAboutBookSettings = StreamingCallSettings.newBuilder(); + Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - findRelatedBooksSettings = PagedCallSettings.newBuilder( - FIND_RELATED_BOOKS_PAGE_STR_FACT); + @Test + @SuppressWarnings("all") + public void updateBookExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - addLabelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + try { + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + FieldMask physicalMask = FieldMask.newBuilder().build(); + com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); - getBigBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + client.updateBook(optionalFoo, book, name, physicalMask, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - getBigBookOperationSettings = OperationCallSettings.newBuilder(); + @Test + @SuppressWarnings("all") + public void moveBookTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - getBigNothingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - getBigNothingOperationSettings = OperationCallSettings.newBuilder(); + Book actualResponse = + client.moveBook(otherShelfName, name); + Assert.assertEquals(expectedResponse, actualResponse); - testOptionalRequiredFlatteningParamsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - privateListShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - unaryMethodSettingsBuilders = ImmutableList.>of( - createShelfSettings, - getShelfSettings, - listShelvesSettings, - deleteShelfSettings, - mergeShelvesSettings, - createBookSettings, - publishSeriesSettings, - getBookSettings, - listBooksSettings, - deleteBookSettings, - updateBookSettings, - moveBookSettings, - listStringsSettings, - addCommentsSettings, - getBookFromArchiveSettings, - getBookFromAnywhereSettings, - getBookFromAbsolutelyAnywhereSettings, - updateBookIndexSettings, - findRelatedBooksSettings, - addLabelSettings, - getBigBookSettings, - getBigNothingSettings, - testOptionalRequiredFlatteningParamsSettings, - privateListShelvesSettings - ); + @Test + @SuppressWarnings("all") + public void moveBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - initDefaults(this); - } + try { + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - return initDefaults(builder); + client.moveBook(otherShelfName, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - private static Builder initDefaults(Builder builder) { - - builder.createShelfSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getShelfSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + @Test + @SuppressWarnings("all") + public void moveBookTest2() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - builder.listShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - builder.deleteShelfSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + Book actualResponse = + client.moveBook(otherShelfName, name); + Assert.assertEquals(expectedResponse, actualResponse); - builder.mergeShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - builder.createBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - builder.publishSeriesSettings().setBatchingSettings( - BatchingSettings.newBuilder() - .setElementCountThreshold(6L) - .setRequestByteThreshold(100000L) - .setDelayThreshold(Duration.ofMillis(500)) - .setFlowControlSettings( - FlowControlSettings.newBuilder() - .setLimitExceededBehavior(LimitExceededBehavior.Ignore) - .build()) - .build()); - builder.publishSeriesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + @Test + @SuppressWarnings("all") + public void moveBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - builder.getBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + try { + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - builder.listBooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + client.moveBook(otherShelfName, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - builder.deleteBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + @Test + @SuppressWarnings("all") + public void listStringsTest() { + String nextPageToken = ""; + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); + List strings = Arrays.asList(stringsElement); + ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllStrings(UntypedResourceName.toStringList(strings)) + .build(); + mockLibraryService.addResponse(expectedResponse); - builder.updateBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + ResourceName name = ArchiveName.of("[ARCHIVE]"); - builder.moveBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + ListStringsPagedResponse pagedListResponse = client.listStrings(name); - builder.listStringsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), + resourceNames.get(0)); - builder.addCommentsSettings().setBatchingSettings( - BatchingSettings.newBuilder() - .setElementCountThreshold(6L) - .setRequestByteThreshold(100000L) - .setDelayThreshold(Duration.ofMillis(500)) - .setFlowControlSettings( - FlowControlSettings.newBuilder() - .setLimitExceededBehavior(LimitExceededBehavior.Ignore) - .build()) - .build()); - builder.addCommentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - builder.getBookFromArchiveSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - builder.getBookFromAnywhereSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + @Test + @SuppressWarnings("all") + public void listStringsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - builder.getBookFromAbsolutelyAnywhereSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + try { + ResourceName name = ArchiveName.of("[ARCHIVE]"); - builder.updateBookIndexSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + client.listStrings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } - builder.streamShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + @Test + @SuppressWarnings("all") + public void listStringsTest2() { + String nextPageToken = ""; + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); + List strings = Arrays.asList(stringsElement); + ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllStrings(UntypedResourceName.toStringList(strings)) + .build(); + mockLibraryService.addResponse(expectedResponse); - builder.streamBooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + ResourceName name = ArchiveName.of("[ARCHIVE]"); - builder.findRelatedBooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + ListStringsPagedResponse pagedListResponse = client.listStrings(name); - builder.addLabelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), + resourceNames.get(0)); - builder.getBigBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - builder.getBigNothingSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - builder.testOptionalRequiredFlatteningParamsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + @Test + @SuppressWarnings("all") + public void listStringsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - builder.privateListShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder - .getBigBookOperationSettings() - .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) - .build()) - .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Book.class)) - .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(3000L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(30000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(86400000L)) - .build())); - builder - .getBigNothingOperationSettings() - .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) - .build()) - .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) - .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(3000L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(600000L)) - .build())); + try { + ResourceName name = ArchiveName.of("[ARCHIVE]"); - return builder; + client.listStrings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - protected Builder(LibraryServiceStubSettings settings) { - super(settings); - - createShelfSettings = settings.createShelfSettings.toBuilder(); - getShelfSettings = settings.getShelfSettings.toBuilder(); - listShelvesSettings = settings.listShelvesSettings.toBuilder(); - deleteShelfSettings = settings.deleteShelfSettings.toBuilder(); - mergeShelvesSettings = settings.mergeShelvesSettings.toBuilder(); - createBookSettings = settings.createBookSettings.toBuilder(); - publishSeriesSettings = settings.publishSeriesSettings.toBuilder(); - getBookSettings = settings.getBookSettings.toBuilder(); - listBooksSettings = settings.listBooksSettings.toBuilder(); - deleteBookSettings = settings.deleteBookSettings.toBuilder(); - updateBookSettings = settings.updateBookSettings.toBuilder(); - moveBookSettings = settings.moveBookSettings.toBuilder(); - listStringsSettings = settings.listStringsSettings.toBuilder(); - addCommentsSettings = settings.addCommentsSettings.toBuilder(); - getBookFromArchiveSettings = settings.getBookFromArchiveSettings.toBuilder(); - getBookFromAnywhereSettings = settings.getBookFromAnywhereSettings.toBuilder(); - getBookFromAbsolutelyAnywhereSettings = settings.getBookFromAbsolutelyAnywhereSettings.toBuilder(); - updateBookIndexSettings = settings.updateBookIndexSettings.toBuilder(); - streamShelvesSettings = settings.streamShelvesSettings.toBuilder(); - streamBooksSettings = settings.streamBooksSettings.toBuilder(); - discussBookSettings = settings.discussBookSettings.toBuilder(); - monologAboutBookSettings = settings.monologAboutBookSettings.toBuilder(); - babbleAboutBookSettings = settings.babbleAboutBookSettings.toBuilder(); - findRelatedBooksSettings = settings.findRelatedBooksSettings.toBuilder(); - addLabelSettings = settings.addLabelSettings.toBuilder(); - getBigBookSettings = settings.getBigBookSettings.toBuilder(); - getBigBookOperationSettings = settings.getBigBookOperationSettings.toBuilder(); - getBigNothingSettings = settings.getBigNothingSettings.toBuilder(); - getBigNothingOperationSettings = settings.getBigNothingOperationSettings.toBuilder(); - testOptionalRequiredFlatteningParamsSettings = settings.testOptionalRequiredFlatteningParamsSettings.toBuilder(); - privateListShelvesSettings = settings.privateListShelvesSettings.toBuilder(); + @Test + @SuppressWarnings("all") + public void addCommentsTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); - unaryMethodSettingsBuilders = ImmutableList.>of( - createShelfSettings, - getShelfSettings, - listShelvesSettings, - deleteShelfSettings, - mergeShelvesSettings, - createBookSettings, - publishSeriesSettings, - getBookSettings, - listBooksSettings, - deleteBookSettings, - updateBookSettings, - moveBookSettings, - listStringsSettings, - addCommentsSettings, - getBookFromArchiveSettings, - getBookFromAnywhereSettings, - getBookFromAbsolutelyAnywhereSettings, - updateBookIndexSettings, - findRelatedBooksSettings, - addLabelSettings, - getBigBookSettings, - getBigNothingSettings, - testOptionalRequiredFlatteningParamsSettings, - privateListShelvesSettings - ); - } + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } + client.addComments(comments, name); - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - /** - * Returns the builder for the settings used for calls to createShelf. - */ - public UnaryCallSettings.Builder createShelfSettings() { - return createShelfSettings; - } + Assert.assertEquals(comments, actualRequest.getCommentsList()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - /** - * Returns the builder for the settings used for calls to getShelf. - */ - public UnaryCallSettings.Builder getShelfSettings() { - return getShelfSettings; - } + @Test + @SuppressWarnings("all") + public void addCommentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns the builder for the settings used for calls to listShelves. - */ - public PagedCallSettings.Builder listShelvesSettings() { - return listShelvesSettings; - } + try { + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the builder for the settings used for calls to deleteShelf. - */ - public UnaryCallSettings.Builder deleteShelfSettings() { - return deleteShelfSettings; + client.addComments(comments, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - /** - * Returns the builder for the settings used for calls to mergeShelves. - */ - public UnaryCallSettings.Builder mergeShelvesSettings() { - return mergeShelvesSettings; - } + @Test + @SuppressWarnings("all") + public void addCommentsTest2() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the builder for the settings used for calls to createBook. - */ - public UnaryCallSettings.Builder createBookSettings() { - return createBookSettings; - } + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the builder for the settings used for calls to publishSeries. - */ - public BatchingCallSettings.Builder publishSeriesSettings() { - return publishSeriesSettings; - } + client.addComments(comments, name); - /** - * Returns the builder for the settings used for calls to getBook. - */ - public UnaryCallSettings.Builder getBookSettings() { - return getBookSettings; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - /** - * Returns the builder for the settings used for calls to listBooks. - */ - public PagedCallSettings.Builder listBooksSettings() { - return listBooksSettings; - } + Assert.assertEquals(comments, actualRequest.getCommentsList()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - /** - * Returns the builder for the settings used for calls to deleteBook. - */ - public UnaryCallSettings.Builder deleteBookSettings() { - return deleteBookSettings; - } + @Test + @SuppressWarnings("all") + public void addCommentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns the builder for the settings used for calls to updateBook. - */ - public UnaryCallSettings.Builder updateBookSettings() { - return updateBookSettings; - } + try { + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the builder for the settings used for calls to moveBook. - */ - public UnaryCallSettings.Builder moveBookSettings() { - return moveBookSettings; + client.addComments(comments, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - /** - * Returns the builder for the settings used for calls to listStrings. - */ - public PagedCallSettings.Builder listStringsSettings() { - return listStringsSettings; - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the builder for the settings used for calls to addComments. - */ - public BatchingCallSettings.Builder addCommentsSettings() { - return addCommentsSettings; - } + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the builder for the settings used for calls to getBookFromArchive. - */ - public UnaryCallSettings.Builder getBookFromArchiveSettings() { - return getBookFromArchiveSettings; - } + BookFromArchive actualResponse = + client.getBookFromArchive(parent, name); + Assert.assertEquals(expectedResponse, actualResponse); - /** - * Returns the builder for the settings used for calls to getBookFromAnywhere. - */ - public UnaryCallSettings.Builder getBookFromAnywhereSettings() { - return getBookFromAnywhereSettings; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - /** - * Returns the builder for the settings used for calls to getBookFromAbsolutelyAnywhere. - */ - public UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings() { - return getBookFromAbsolutelyAnywhereSettings; - } + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - /** - * Returns the builder for the settings used for calls to updateBookIndex. - */ - public UnaryCallSettings.Builder updateBookIndexSettings() { - return updateBookIndexSettings; - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns the builder for the settings used for calls to streamShelves. - */ - public ServerStreamingCallSettings.Builder streamShelvesSettings() { - return streamShelvesSettings; - } + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the builder for the settings used for calls to streamBooks. - */ - public ServerStreamingCallSettings.Builder streamBooksSettings() { - return streamBooksSettings; + client.getBookFromArchive(parent, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - /** - * Returns the builder for the settings used for calls to discussBook. - */ - public StreamingCallSettings.Builder discussBookSettings() { - return discussBookSettings; - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest2() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the builder for the settings used for calls to monologAboutBook. - */ - public StreamingCallSettings.Builder monologAboutBookSettings() { - return monologAboutBookSettings; - } + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the builder for the settings used for calls to babbleAboutBook. - */ - public StreamingCallSettings.Builder babbleAboutBookSettings() { - return babbleAboutBookSettings; - } + BookFromArchive actualResponse = + client.getBookFromArchive(parent, name); + Assert.assertEquals(expectedResponse, actualResponse); - /** - * Returns the builder for the settings used for calls to findRelatedBooks. - */ - public PagedCallSettings.Builder findRelatedBooksSettings() { - return findRelatedBooksSettings; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - /** - * Returns the builder for the settings used for calls to addLabel. - */ - public UnaryCallSettings.Builder addLabelSettings() { - return addLabelSettings; - } + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - /** - * Returns the builder for the settings used for calls to getBigBook. - */ - public UnaryCallSettings.Builder getBigBookSettings() { - return getBigBookSettings; + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + + client.getBookFromArchive(parent, name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } + + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest3() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the builder for the settings used for calls to getBigBook. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder getBigBookOperationSettings() { - return getBigBookOperationSettings; - } + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String parent = "parent-995424086"; - /** - * Returns the builder for the settings used for calls to getBigNothing. - */ - public UnaryCallSettings.Builder getBigNothingSettings() { - return getBigNothingSettings; - } + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); - /** - * Returns the builder for the settings used for calls to getBigNothing. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder getBigNothingOperationSettings() { - return getBigNothingOperationSettings; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - /** - * Returns the builder for the settings used for calls to testOptionalRequiredFlatteningParams. - */ - public UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings() { - return testOptionalRequiredFlatteningParamsSettings; - } + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, PublisherNames.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - /** - * Returns the builder for the settings used for calls to privateListShelves. - */ - public UnaryCallSettings.Builder privateListShelvesSettings() { - return privateListShelvesSettings; - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @Override - public LibraryServiceStubSettings build() throws IOException { - return new LibraryServiceStubSettings(this); + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String parent = "parent-995424086"; + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } } -} -============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStub.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import javax.annotation.Generated; + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest4() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Base stub class for Google Example Library API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public abstract class MyProtoStub implements BackgroundResource { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); + + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - public UnaryCallable myMethodCallable() { - throw new UnsupportedOperationException("Not implemented: myMethodCallable()"); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @Override - public abstract void close(); -} -============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStubSettings.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import com.google.protos.google.example.library.v1.MyProtoGrpc; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import javax.annotation.Generated; -import org.threeten.bp.Duration; + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link MyProtoStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (library-example.googleapis.com) and default port (1234) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. - * - * For example, to set the total timeout of myMethod to 30 seconds: - * - *

- * 
- * MyProtoStubSettings.Builder myProtoSettingsBuilder =
- *     MyProtoStubSettings.newBuilder();
- * myProtoSettingsBuilder.myMethodSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * MyProtoStubSettings myProtoSettings = myProtoSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -public class MyProtoStubSettings extends StubSettings { - /** - * The default scopes of the service. - */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-platform") - .add("https://www.googleapis.com/auth/library") + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest5() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); + mockLibraryService.addResponse(expectedResponse); - private final UnaryCallSettings myMethodSettings; + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns the object with the settings used for calls to myMethod. - */ - public UnaryCallSettings myMethodSettings() { - return myMethodSettings; + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, BookNames.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public MyProtoStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcMyProtoStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } } - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest6() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return "library-example.googleapis.com:1234"; - } + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - ; - } + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest7() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MyProtoStubSettings.class)) - .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); - } + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - /** - * Returns a builder containing all the values of this settings class. - */ - public Builder toBuilder() { - return new Builder(this); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, BookNames.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - protected MyProtoStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest7() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - myMethodSettings = settingsBuilder.myMethodSettings().build(); + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest8() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String parent = "parent-995424086"; + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); - /** - * Builder for MyProtoStubSettings. - */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - private final UnaryCallSettings.Builder myMethodSettings; + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, PublisherNames.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest8() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - static { - ImmutableMap.Builder> definitions = ImmutableMap.builder(); - definitions.put( - "idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String parent = "parent-995424086"; + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest9() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); - definitions.put("default", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + FolderName parent = FolderName.of("[FOLDER]"); + + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, FolderName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - protected Builder() { - this((ClientContext) null); + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest9() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + FolderName parent = FolderName.of("[FOLDER]"); + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - protected Builder(ClientContext clientContext) { - super(clientContext); + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest10() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - myMethodSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - unaryMethodSettingsBuilders = ImmutableList.>of( - myMethodSettings - ); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); - initDefaults(this); - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - return initDefaults(builder); - } + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, BookNames.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - private static Builder initDefaults(Builder builder) { + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest10() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - builder.myMethodSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - return builder; + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } + } - protected Builder(MyProtoStubSettings settings) { - super(settings); + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest11() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); - myMethodSettings = settings.myMethodSettings.toBuilder(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - unaryMethodSettingsBuilders = ImmutableList.>of( - myMethodSettings - ); - } + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, ArchivedBookName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } - /** - * Returns the builder for the settings used for calls to myMethod. - */ - public UnaryCallSettings.Builder myMethodSettings() { - return myMethodSettings; - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest11() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @Override - public MyProtoStubSettings build() throws IOException { - return new MyProtoStubSettings(this); + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } } -} -============== file: src/test/java/com/google/example/library/v1/LibraryClientTest.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcStatusCode; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.resourcenames.ResourceName; -import com.google.common.collect.Lists; -import com.google.example.library.v1.Comment; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.SomeMessage2; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.BoolValue; -import com.google.protobuf.ByteString; -import com.google.protobuf.BytesValue; -import com.google.protobuf.DoubleValue; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.FloatValue; -import com.google.protobuf.Int32Value; -import com.google.protobuf.Int64Value; -import com.google.protobuf.ListValue; -import com.google.protobuf.StringValue; -import com.google.protobuf.Struct; -import com.google.protobuf.Timestamp; -import com.google.protobuf.UInt32Value; -import com.google.protobuf.UInt64Value; -import com.google.protobuf.Value; -import io.grpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest12() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); -@javax.annotation.Generated("by GAPIC") -public class LibraryClientTest { - private static MockLibraryService mockLibraryService; - private static MockLabeler mockLabeler; - private static MockMyProto mockMyProto; - private static MockServiceHelper serviceHelper; - private LibraryClient client; - private LocalChannelProvider channelProvider; + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ArchiveName parent = ArchiveName.of("[ARCHIVE]"); - @BeforeClass - public static void startStaticServer() { - mockLibraryService = new MockLibraryService(); - mockLabeler = new MockLabeler(); - mockMyProto = new MockMyProto(); - serviceHelper = new MockServiceHelper(UUID.randomUUID().toString(), Arrays.asList(mockLibraryService, mockLabeler, mockMyProto)); - serviceHelper.start(); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, ArchiveName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } - @AfterClass - public static void stopServer() { - serviceHelper.stop(); - } + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest12() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); - @Before - public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); - LibrarySettings settings = LibrarySettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = LibraryClient.create(settings); - } + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ArchiveName parent = ArchiveName.of("[ARCHIVE]"); - @After - public void tearDown() throws Exception { - client.close(); + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } } @Test @SuppressWarnings("all") - public void createShelfTest() { - ShelfName name = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) + public void getBookFromArchiveTest13() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - Shelf shelf = Shelf.newBuilder().build(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ShelfName parent = ShelfName.of("[SHELF_ID]"); - Shelf actualResponse = - client.createShelf(shelf); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateShelfRequest actualRequest = (CreateShelfRequest)actualRequests.get(0); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, ShelfName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -13856,14 +18582,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createShelfExceptionTest() throws Exception { + public void getBookFromArchiveExceptionTest13() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - Shelf shelf = Shelf.newBuilder().build(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ShelfName parent = ShelfName.of("[SHELF_ID]"); - client.createShelf(shelf); + client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -13872,28 +18599,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfTest() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() + public void getBookFromArchiveTest14() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); - Shelf actualResponse = - client.getShelf(name); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, BillingAccountName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -13902,14 +18633,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfExceptionTest() throws Exception { + public void getBookFromArchiveExceptionTest14() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); - client.getShelf(name); + client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -13918,30 +18650,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfTest2() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() + public void getBookFromArchiveTest15() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String parent = "parent-995424086"; - Shelf actualResponse = - client.getShelf(name, message); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, PublisherNames.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -13950,15 +18684,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfExceptionTest2() throws Exception { + public void getBookFromArchiveExceptionTest15() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String parent = "parent-995424086"; - client.getShelf(name, message); + client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -13967,32 +18701,36 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfTest3() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() + public void getBookFromAnywhereTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + FolderName folder = FolderName.of("[FOLDER]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Shelf actualResponse = - client.getShelf(name, message, stringBuilder); + BookFromAnywhere actualResponse = + client.getBookFromAnywhere(folder, name, place, altBookName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); + Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); + Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14001,16 +18739,17 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfExceptionTest3() throws Exception { + public void getBookFromAnywhereExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + FolderName folder = FolderName.of("[FOLDER]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.getShelf(name, message, stringBuilder); + client.getBookFromAnywhere(folder, name, place, altBookName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14019,26 +18758,36 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listShelvesTest() { - String nextPageToken = ""; - Shelf shelvesElement = Shelf.newBuilder().build(); - List shelves = Arrays.asList(shelvesElement); - ListShelvesResponse expectedResponse = ListShelvesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllShelves(shelves) + public void getBookFromAnywhereTest2() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ListShelvesPagedResponse pagedListResponse = client.listShelves(); + FolderName folder = FolderName.of("[FOLDER]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getShelvesList().get(0), resources.get(0)); + BookFromAnywhere actualResponse = + client.getBookFromAnywhere(folder, name, place, altBookName); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListShelvesRequest actualRequest = (ListShelvesRequest)actualRequests.get(0); + GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); + Assert.assertEquals(folder, actualRequest.getFolder()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(place, actualRequest.getPlace()); + Assert.assertEquals(altBookName, actualRequest.getAltBookName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14047,12 +18796,17 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listShelvesExceptionTest() throws Exception { + public void getBookFromAnywhereExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - client.listShelves(); + FolderName folder = FolderName.of("[FOLDER]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBookFromAnywhere(folder, name, place, altBookName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14061,19 +18815,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void getBookFromAbsolutelyAnywhereTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.deleteShelf(name); + BookFromAnywhere actualResponse = + client.getBookFromAbsolutelyAnywhere(name); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); + GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14082,14 +18847,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfExceptionTest() throws Exception { + public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.deleteShelf(name); + client.getBookFromAbsolutelyAnywhere(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14098,30 +18863,73 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesTest() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() + public void getBookFromAbsolutelyAnywhereTest2() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + BookFromAnywhere actualResponse = + client.getBookFromAbsolutelyAnywhere(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookFromAbsolutelyAnywhereExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBookFromAbsolutelyAnywhere(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookIndexTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + String indexName = "default index"; - Shelf actualResponse = - client.mergeShelves(name, otherShelfName); - Assert.assertEquals(expectedResponse, actualResponse); + client.updateBookIndex(name, indexMap, indexName); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); + UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); + Assert.assertEquals(indexName, actualRequest.getIndexName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14130,15 +18938,18 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesExceptionTest() throws Exception { + public void updateBookIndexExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + String indexName = "default index"; - client.mergeShelves(name, otherShelfName); + client.updateBookIndex(name, indexMap, indexName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14147,32 +18958,25 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookTest() { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); + public void updateBookIndexTest2() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + String indexName = "default index"; - Book actualResponse = - client.createBook(name, book); - Assert.assertEquals(expectedResponse, actualResponse); + client.updateBookIndex(name, indexMap, indexName); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); + Assert.assertEquals(indexName, actualRequest.getIndexName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14181,15 +18985,18 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookExceptionTest() throws Exception { + public void updateBookIndexExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + String indexName = "default index"; - client.createBook(name, book); + client.updateBookIndex(name, indexMap, indexName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14198,69 +19005,59 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void publishSeriesTest() { - String bookNamesElement = "bookNamesElement1491670575"; - List bookNames = Arrays.asList(bookNamesElement); - PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() - .addAllBookNames(bookNames) + public void streamShelvesTest() throws Exception { + Shelf shelvesElement = Shelf.newBuilder().build(); + List shelves = Arrays.asList(shelvesElement); + StreamShelvesResponse expectedResponse = StreamShelvesResponse.newBuilder() + .addAllShelves(shelves) .build(); mockLibraryService.addResponse(expectedResponse); - - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) + ShelfName name = ShelfName.of("[SHELF_ID]"); + StreamShelvesRequest request = StreamShelvesRequest.newBuilder() + .setName(name.toString()) .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse actualResponse = - client.publishSeries(shelf, books, edition, seriesUuid, publisher); - Assert.assertEquals(expectedResponse, actualResponse); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + ServerStreamingCallable callable = + client.streamShelvesCallable(); + callable.serverStreamingCall(request, responseObserver); - Assert.assertEquals(shelf, actualRequest.getShelf()); - Assert.assertEquals(books, actualRequest.getBooksList()); - Assert.assertEquals(edition, actualRequest.getEdition()); - Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(publisher, PublisherName.parse(actualRequest.getPublisher())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); } @Test @SuppressWarnings("all") - public void publishSeriesExceptionTest() throws Exception { + public void streamShelvesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); + ShelfName name = ShelfName.of("[SHELF_ID]"); + StreamShelvesRequest request = StreamShelvesRequest.newBuilder() + .setName(name.toString()) + .build(); - try { - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - client.publishSeries(shelf, books, edition, seriesUuid, publisher); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + ServerStreamingCallable callable = + client.streamShelvesCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void getBookTest() { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + public void streamBooksTest() throws Exception { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -14271,67 +19068,139 @@ public class LibraryClientTest { .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); + String name = "name3373707"; + StreamBooksRequest request = StreamBooksRequest.newBuilder() + .setName(name) + .build(); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - - Book actualResponse = - client.getBook(name); - Assert.assertEquals(expectedResponse, actualResponse); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + ServerStreamingCallable callable = + client.streamBooksCallable(); + callable.serverStreamingCall(request, responseObserver); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); } @Test @SuppressWarnings("all") - public void getBookExceptionTest() throws Exception { + public void streamBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); + String name = "name3373707"; + StreamBooksRequest request = StreamBooksRequest.newBuilder() + .setName(name) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBooksCallable(); + callable.serverStreamingCall(request, responseObserver); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } - client.getBook(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + @Test + @SuppressWarnings("all") + public void discussBookTest() throws Exception { + String userName = "userName339340927"; + ByteString comment = ByteString.copyFromUtf8("95"); + Comment expectedResponse = Comment.newBuilder() + .setUserName(userName) + .setComment(comment) + .build(); + mockLibraryService.addResponse(expectedResponse); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + DiscussBookRequest request = DiscussBookRequest.newBuilder() + .setName(name.toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.discussBookCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void discussBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + DiscussBookRequest request = DiscussBookRequest.newBuilder() + .setName(name.toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.discussBookCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void listBooksTest() { + public void findRelatedBooksTest() { String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + BookName namesElement2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List names2 = Arrays.asList(namesElement2); + FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() .setNextPageToken(nextPageToken) - .addAllBooks(books) + .addAllNames(BookName.toStringList(names2)) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; + String namesElement = "namesElement-249113339"; + List names = Arrays.asList(namesElement); + List formattedShelves = new ArrayList<>(); - ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); + FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(names, formattedShelves); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), + resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(names, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14340,15 +19209,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest() throws Exception { + public void findRelatedBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; + String namesElement = "namesElement-249113339"; + List names = Arrays.asList(namesElement); + List formattedShelves = new ArrayList<>(); - client.listBooks(name, filter); + client.findRelatedBooks(names, formattedShelves); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14357,19 +19227,36 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void findRelatedBooksTest2() { + String nextPageToken = ""; + BookName namesElement2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List names2 = Arrays.asList(namesElement2); + FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllNames(BookName.toStringList(names2)) + .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + String namesElement = "namesElement-249113339"; + List names = Arrays.asList(namesElement); + List formattedShelves = new ArrayList<>(); + + FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(names, formattedShelves); - client.deleteBook(name); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), + resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(names, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14378,14 +19265,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookExceptionTest() throws Exception { + public void findRelatedBooksExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + String namesElement = "namesElement-249113339"; + List names = Arrays.asList(namesElement); + List formattedShelves = new ArrayList<>(); - client.deleteBook(name); + client.findRelatedBooks(names, formattedShelves); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14394,8 +19283,8 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookTest() { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + public void getBigBookTest() throws Exception { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -14405,21 +19294,25 @@ public class LibraryClientTest { .setTitle(title) .setRead(read) .build(); - mockLibraryService.addResponse(expectedResponse); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigBookTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); Book actualResponse = - client.updateBook(name, book); + client.getBigBookAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14428,25 +19321,27 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookExceptionTest() throws Exception { + public void getBigBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - Book book = Book.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.updateBook(name, book); + client.getBigBookAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + @Test @SuppressWarnings("all") - public void updateBookTest2() { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + public void getBigBookTest2() throws Exception { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -14456,27 +19351,25 @@ public class LibraryClientTest { .setTitle(title) .setRead(read) .build(); - mockLibraryService.addResponse(expectedResponse); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigBookTest2") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); Book actualResponse = - client.updateBook(name, optionalFoo, book, updateMask, physicalMask); + client.getBigBookAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14485,52 +19378,46 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookExceptionTest2() throws Exception { + public void getBigBookExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.updateBook(name, optionalFoo, book, updateMask, physicalMask); + client.getBigBookAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + @Test @SuppressWarnings("all") - public void moveBookTest() { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + public void getBigNothingTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigNothingTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Book actualResponse = - client.moveBook(name, otherShelfName); + Empty actualResponse = + client.getBigNothingAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14539,47 +19426,46 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void moveBookExceptionTest() throws Exception { + public void getBigNothingExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.moveBook(name, otherShelfName); + client.getBigNothingAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + @Test @SuppressWarnings("all") - public void listStringsTest() { - String nextPageToken = ""; - ResourceName stringsElement = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - List strings = Arrays.asList(stringsElement); - ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllStrings(UntypedResourceName.toStringList(strings)) - .build(); - mockLibraryService.addResponse(expectedResponse); + public void getBigNothingTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigNothingTest2") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); - ListStringsPagedResponse pagedListResponse = client.listStrings(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); + Empty actualResponse = + client.getBigNothingAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14588,47 +19474,282 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listStringsExceptionTest() throws Exception { + public void getBigNothingExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - client.listStrings(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBigNothingAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + @Test @SuppressWarnings("all") - public void listStringsTest2() { - String nextPageToken = ""; - ResourceName stringsElement = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - List strings = Arrays.asList(stringsElement); - ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllStrings(UntypedResourceName.toStringList(strings)) - .build(); + public void testOptionalRequiredFlatteningParamsTest() { + TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - - ListStringsPagedResponse pagedListResponse = client.listStrings(name); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedBytesValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + boolean optionalSingularBool = false; + List repeatedListValueValue = new ArrayList<>(); + int optionalSingularFixed32 = 1648847958; + List optionalRepeatedMessage = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + Any anyValue = Any.newBuilder().build(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + List optionalRepeatedBool = new ArrayList<>(); + String optionalSingularString = "optionalSingularString1852995162"; + long optionalSingularInt64 = 1196565628L; + List repeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedValueValue = new ArrayList<>(); + Duration requiredDurationValue = Duration.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedFieldMaskValue = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + boolean requiredSingularBool = true; + float requiredSingularFloat = -7514705.0F; + List requiredRepeatedBytes = new ArrayList<>(); + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + Any requiredAnyValue = Any.newBuilder().build(); + List repeatedInt32Value = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + long requiredSingularFixed64 = 720656810; + String requiredSingularString = "requiredSingularString-1949894503"; + Map optionalMap = new HashMap<>(); + List requiredRepeatedBool = new ArrayList<>(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + List requiredRepeatedStructValue = new ArrayList<>(); + List repeatedAnyValue = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedMessage = new ArrayList<>(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + List repeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + float optionalSingularFloat = -1.19939918E8F; + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + Int32Value int32Value = Int32Value.newBuilder().build(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Value valueValue = Value.newBuilder().build(); + int optionalSingularInt32 = 1196565723; + BoolValue boolValue = BoolValue.newBuilder().build(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + double optionalSingularDouble = 1.41902287E8; + List requiredRepeatedString = new ArrayList<>(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + List optionalRepeatedFloat = new ArrayList<>(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + List requiredRepeatedEnum = new ArrayList<>(); + Value requiredValueValue = Value.newBuilder().build(); + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + StringValue stringValue = StringValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + double requiredSingularDouble = 1.9111005E8; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + long optionalSingularFixed64 = 1648847863; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + List requiredRepeatedBoolValue = new ArrayList<>(); + int requiredSingularInt32 = 72313594; + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + int requiredSingularFixed32 = 720656715; + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + List repeatedDurationValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedValueValue = new ArrayList<>(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + List repeatedStringValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + long requiredSingularInt64 = 72313499L; + List optionalRepeatedEnum = new ArrayList<>(); + com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + List requiredRepeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + Int64Value int64Value = Int64Value.newBuilder().build(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedInt32 = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + FloatValue floatValue = FloatValue.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + Duration durationValue = Duration.newBuilder().build(); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); + TestOptionalRequiredFlatteningParamsResponse actualResponse = + client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); + TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName())); + Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); + Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); + Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); + Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); + Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); + Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); + Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); + Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); + Assert.assertEquals(anyValue, actualRequest.getAnyValue()); + Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); + Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); + Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); + Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); + Assert.assertEquals(structValue, actualRequest.getStructValue()); + Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); + Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); + Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); + Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); + Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); + Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); + Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); + Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); + Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); + Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); + Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); + Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); + Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); + Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); + Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); + Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); + Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); + Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); + Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); + Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); + Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); + Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); + Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); + Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); + Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); + Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); + Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); + Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); + Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); + Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); + Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); + Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); + Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); + Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); + Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); + Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); + Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); + Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); + Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); + Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); + Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); + Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); + Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); + Assert.assertEquals(int32Value, actualRequest.getInt32Value()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); + Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); + Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); + Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); + Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); + Assert.assertEquals(valueValue, actualRequest.getValueValue()); + Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); + Assert.assertEquals(boolValue, actualRequest.getBoolValue()); + Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); + Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); + Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); + Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); + Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); + Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); + Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); + Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); + Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); + Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); + Assert.assertEquals(stringValue, actualRequest.getStringValue()); + Assert.assertEquals(timeValue, actualRequest.getTimeValue()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); + Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); + Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); + Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); + Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); + Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); + Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); + Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); + Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); + Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); + Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); + Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); + Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); + Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); + Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); + Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); + Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); + Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); + Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); + Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); + Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); + Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); + Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); + Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); + Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); + Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); + Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); + Assert.assertEquals(int64Value, actualRequest.getInt64Value()); + Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); + Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); + Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); + Assert.assertEquals(floatValue, actualRequest.getFloatValue()); + Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); + Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); + Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); + Assert.assertEquals(durationValue, actualRequest.getDurationValue()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14637,14 +19758,135 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listStringsExceptionTest2() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedBytesValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + boolean optionalSingularBool = false; + List repeatedListValueValue = new ArrayList<>(); + int optionalSingularFixed32 = 1648847958; + List optionalRepeatedMessage = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + Any anyValue = Any.newBuilder().build(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + List optionalRepeatedBool = new ArrayList<>(); + String optionalSingularString = "optionalSingularString1852995162"; + long optionalSingularInt64 = 1196565628L; + List repeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedValueValue = new ArrayList<>(); + Duration requiredDurationValue = Duration.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedFieldMaskValue = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + boolean requiredSingularBool = true; + float requiredSingularFloat = -7514705.0F; + List requiredRepeatedBytes = new ArrayList<>(); + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + Any requiredAnyValue = Any.newBuilder().build(); + List repeatedInt32Value = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + long requiredSingularFixed64 = 720656810; + String requiredSingularString = "requiredSingularString-1949894503"; + Map optionalMap = new HashMap<>(); + List requiredRepeatedBool = new ArrayList<>(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + List requiredRepeatedStructValue = new ArrayList<>(); + List repeatedAnyValue = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedMessage = new ArrayList<>(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + List repeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + float optionalSingularFloat = -1.19939918E8F; + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + Int32Value int32Value = Int32Value.newBuilder().build(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Value valueValue = Value.newBuilder().build(); + int optionalSingularInt32 = 1196565723; + BoolValue boolValue = BoolValue.newBuilder().build(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + double optionalSingularDouble = 1.41902287E8; + List requiredRepeatedString = new ArrayList<>(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + List optionalRepeatedFloat = new ArrayList<>(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + List requiredRepeatedEnum = new ArrayList<>(); + Value requiredValueValue = Value.newBuilder().build(); + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + StringValue stringValue = StringValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + double requiredSingularDouble = 1.9111005E8; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + long optionalSingularFixed64 = 1648847863; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + List requiredRepeatedBoolValue = new ArrayList<>(); + int requiredSingularInt32 = 72313594; + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + int requiredSingularFixed32 = 720656715; + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + List repeatedDurationValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedValueValue = new ArrayList<>(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + List repeatedStringValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + long requiredSingularInt64 = 72313499L; + List optionalRepeatedEnum = new ArrayList<>(); + com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + List requiredRepeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + Int64Value int64Value = Int64Value.newBuilder().build(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedInt32 = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + FloatValue floatValue = FloatValue.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + Duration durationValue = Duration.newBuilder().build(); - client.listStrings(name); + client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14653,29 +19895,263 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void addCommentsTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void testOptionalRequiredFlatteningParamsTest2() { + TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedBytesValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + boolean optionalSingularBool = false; + List repeatedListValueValue = new ArrayList<>(); + int optionalSingularFixed32 = 1648847958; + List optionalRepeatedMessage = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + Any anyValue = Any.newBuilder().build(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + List optionalRepeatedBool = new ArrayList<>(); + String optionalSingularString = "optionalSingularString1852995162"; + long optionalSingularInt64 = 1196565628L; + List repeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedValueValue = new ArrayList<>(); + Duration requiredDurationValue = Duration.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedFieldMaskValue = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + boolean requiredSingularBool = true; + float requiredSingularFloat = -7514705.0F; + List requiredRepeatedBytes = new ArrayList<>(); + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + Any requiredAnyValue = Any.newBuilder().build(); + List repeatedInt32Value = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + long requiredSingularFixed64 = 720656810; + String requiredSingularString = "requiredSingularString-1949894503"; + Map optionalMap = new HashMap<>(); + List requiredRepeatedBool = new ArrayList<>(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + List requiredRepeatedStructValue = new ArrayList<>(); + List repeatedAnyValue = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedMessage = new ArrayList<>(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + List repeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + float optionalSingularFloat = -1.19939918E8F; + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + Int32Value int32Value = Int32Value.newBuilder().build(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Value valueValue = Value.newBuilder().build(); + int optionalSingularInt32 = 1196565723; + BoolValue boolValue = BoolValue.newBuilder().build(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + double optionalSingularDouble = 1.41902287E8; + List requiredRepeatedString = new ArrayList<>(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + List optionalRepeatedFloat = new ArrayList<>(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + List requiredRepeatedEnum = new ArrayList<>(); + Value requiredValueValue = Value.newBuilder().build(); + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + StringValue stringValue = StringValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + double requiredSingularDouble = 1.9111005E8; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + long optionalSingularFixed64 = 1648847863; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + List requiredRepeatedBoolValue = new ArrayList<>(); + int requiredSingularInt32 = 72313594; + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + int requiredSingularFixed32 = 720656715; + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + List repeatedDurationValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedValueValue = new ArrayList<>(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + List repeatedStringValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + long requiredSingularInt64 = 72313499L; + List optionalRepeatedEnum = new ArrayList<>(); + com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + List requiredRepeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + Int64Value int64Value = Int64Value.newBuilder().build(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedInt32 = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + FloatValue floatValue = FloatValue.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + Duration durationValue = Duration.newBuilder().build(); - client.addComments(name, comments); + TestOptionalRequiredFlatteningParamsResponse actualResponse = + client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); + TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(comments, actualRequest.getCommentsList()); + Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); + Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); + Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); + Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); + Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); + Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); + Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); + Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); + Assert.assertEquals(anyValue, actualRequest.getAnyValue()); + Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); + Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); + Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); + Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); + Assert.assertEquals(structValue, actualRequest.getStructValue()); + Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); + Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); + Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); + Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); + Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); + Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); + Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); + Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); + Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); + Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); + Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); + Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); + Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); + Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); + Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); + Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); + Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); + Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); + Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); + Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); + Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); + Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); + Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); + Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); + Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); + Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); + Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); + Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); + Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); + Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); + Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); + Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); + Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); + Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); + Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); + Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); + Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); + Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); + Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); + Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); + Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); + Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); + Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); + Assert.assertEquals(int32Value, actualRequest.getInt32Value()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); + Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); + Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); + Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); + Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); + Assert.assertEquals(valueValue, actualRequest.getValueValue()); + Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); + Assert.assertEquals(boolValue, actualRequest.getBoolValue()); + Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); + Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); + Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); + Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); + Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); + Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); + Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); + Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); + Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); + Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); + Assert.assertEquals(stringValue, actualRequest.getStringValue()); + Assert.assertEquals(timeValue, actualRequest.getTimeValue()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); + Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); + Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); + Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); + Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); + Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); + Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); + Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); + Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); + Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); + Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); + Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); + Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); + Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); + Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); + Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); + Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); + Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); + Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); + Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); + Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); + Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); + Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); + Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); + Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); + Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); + Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); + Assert.assertEquals(int64Value, actualRequest.getInt64Value()); + Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); + Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); + Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); + Assert.assertEquals(floatValue, actualRequest.getFloatValue()); + Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); + Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); + Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); + Assert.assertEquals(durationValue, actualRequest.getDurationValue()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14684,23 +20160,135 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void addCommentsExceptionTest() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedBytesValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + boolean optionalSingularBool = false; + List repeatedListValueValue = new ArrayList<>(); + int optionalSingularFixed32 = 1648847958; + List optionalRepeatedMessage = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + Any anyValue = Any.newBuilder().build(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + List optionalRepeatedBool = new ArrayList<>(); + String optionalSingularString = "optionalSingularString1852995162"; + long optionalSingularInt64 = 1196565628L; + List repeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedValueValue = new ArrayList<>(); + Duration requiredDurationValue = Duration.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedFieldMaskValue = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + boolean requiredSingularBool = true; + float requiredSingularFloat = -7514705.0F; + List requiredRepeatedBytes = new ArrayList<>(); + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + Any requiredAnyValue = Any.newBuilder().build(); + List repeatedInt32Value = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + long requiredSingularFixed64 = 720656810; + String requiredSingularString = "requiredSingularString-1949894503"; + Map optionalMap = new HashMap<>(); + List requiredRepeatedBool = new ArrayList<>(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + List requiredRepeatedStructValue = new ArrayList<>(); + List repeatedAnyValue = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List requiredRepeatedMessage = new ArrayList<>(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + List repeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + float optionalSingularFloat = -1.19939918E8F; + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + Int32Value int32Value = Int32Value.newBuilder().build(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Value valueValue = Value.newBuilder().build(); + int optionalSingularInt32 = 1196565723; + BoolValue boolValue = BoolValue.newBuilder().build(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + double optionalSingularDouble = 1.41902287E8; + List requiredRepeatedString = new ArrayList<>(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + List optionalRepeatedFloat = new ArrayList<>(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + List requiredRepeatedEnum = new ArrayList<>(); + Value requiredValueValue = Value.newBuilder().build(); + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + StringValue stringValue = StringValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + double requiredSingularDouble = 1.9111005E8; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + long optionalSingularFixed64 = 1648847863; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + List requiredRepeatedBoolValue = new ArrayList<>(); + int requiredSingularInt32 = 72313594; + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + int requiredSingularFixed32 = 720656715; + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + List repeatedDurationValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedValueValue = new ArrayList<>(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + List repeatedStringValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + long requiredSingularInt64 = 72313499L; + List optionalRepeatedEnum = new ArrayList<>(); + com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + List requiredRepeatedFloatValue = new ArrayList<>(); + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + Int64Value int64Value = Int64Value.newBuilder().build(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedInt32 = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + FloatValue floatValue = FloatValue.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + Duration durationValue = Duration.newBuilder().build(); - client.addComments(name, comments); + client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14709,87 +20297,33 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void listPublishersTest() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) .build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); - - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromAnywhereTest() { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - BookName altBookName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(additionalDestinations, parent, destination); - BookFromAnywhere actualResponse = - client.getBookFromAnywhere(name, altBookName, place, folder); - Assert.assertEquals(expectedResponse, actualResponse); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); - Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); - Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(destination, actualRequest.getDestination()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14798,17 +20332,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAnywhereExceptionTest() throws Exception { + public void listPublishersExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - BookName altBookName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); - client.getBookFromAnywhere(name, altBookName, place, folder); + client.listPublishers(additionalDestinations, parent, destination); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14817,30 +20350,33 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereTest() { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void listPublishersTest2() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); - BookFromAnywhere actualResponse = - client.getBookFromAbsolutelyAnywhere(name); - Assert.assertEquals(expectedResponse, actualResponse); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(additionalDestinations, parent, destination); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(destination, actualRequest.getDestination()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14849,14 +20385,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { + public void listPublishersExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); - client.getBookFromAbsolutelyAnywhere(name); + client.listPublishers(additionalDestinations, parent, destination); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14865,25 +20403,33 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookIndexTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void listPublishersTest3() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) + .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String indexName = "default index"; - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); + String destination = "destination-1429847026"; + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - client.updateBookIndex(name, indexName, indexMap); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(indexName, actualRequest.getIndexName()); - Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14892,18 +20438,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookIndexExceptionTest() throws Exception { + public void listPublishersExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String indexName = "default index"; - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); + String destination = "destination-1429847026"; + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - client.updateBookIndex(name, indexName, indexMap); + client.listPublishers(destination, additionalDestinations, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14912,202 +20456,192 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void streamShelvesTest() throws Exception { - Shelf shelvesElement = Shelf.newBuilder().build(); - List shelves = Arrays.asList(shelvesElement); - StreamShelvesResponse expectedResponse = StreamShelvesResponse.newBuilder() - .addAllShelves(shelves) + public void listPublishersTest4() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - StreamShelvesRequest request = StreamShelvesRequest.newBuilder() - .setName(name.toString()) - .build(); - MockStreamObserver responseObserver = new MockStreamObserver<>(); + ProjectName destination = ProjectName.of("[PROJECT]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - ServerStreamingCallable callable = - client.streamShelvesCallable(); - callable.serverStreamingCall(request, responseObserver); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } @Test @SuppressWarnings("all") - public void streamShelvesExceptionTest() throws Exception { + public void listPublishersExceptionTest4() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); - ShelfName name = ShelfName.of("[SHELF_ID]"); - StreamShelvesRequest request = StreamShelvesRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamShelvesCallable(); - callable.serverStreamingCall(request, responseObserver); try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + ProjectName destination = ProjectName.of("[PROJECT]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } } @Test @SuppressWarnings("all") - public void streamBooksTest() throws Exception { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void listPublishersTest5() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) .build(); mockLibraryService.addResponse(expectedResponse); - String name = "name3373707"; - StreamBooksRequest request = StreamBooksRequest.newBuilder() - .setName(name) - .build(); - MockStreamObserver responseObserver = new MockStreamObserver<>(); + BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - ServerStreamingCallable callable = - client.streamBooksCallable(); - callable.serverStreamingCall(request, responseObserver); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } @Test @SuppressWarnings("all") - public void streamBooksExceptionTest() throws Exception { + public void listPublishersExceptionTest5() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); - String name = "name3373707"; - StreamBooksRequest request = StreamBooksRequest.newBuilder() - .setName(name) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBooksCallable(); - callable.serverStreamingCall(request, responseObserver); try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } } @Test @SuppressWarnings("all") - public void discussBookTest() throws Exception { - String userName = "userName339340927"; - ByteString comment = ByteString.copyFromUtf8("95"); - Comment expectedResponse = Comment.newBuilder() - .setUserName(userName) - .setComment(comment) + public void listPublishersTest6() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - DiscussBookRequest request = DiscussBookRequest.newBuilder() - .setName(name.toString()) - .build(); - MockStreamObserver responseObserver = new MockStreamObserver<>(); + OrganizationName destination = OrganizationName.of("[ORGANIZATION]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - BidiStreamingCallable callable = - client.discussBookCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - requestObserver.onNext(request); - requestObserver.onCompleted(); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } @Test @SuppressWarnings("all") - public void discussBookExceptionTest() throws Exception { + public void listPublishersExceptionTest6() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - DiscussBookRequest request = DiscussBookRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.discussBookCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + OrganizationName destination = OrganizationName.of("[ORGANIZATION]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } } @Test @SuppressWarnings("all") - public void findRelatedBooksTest() { + public void listPublishersTest7() { String nextPageToken = ""; - BookName namesElement2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - List names2 = Arrays.asList(namesElement2); - FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() .setNextPageToken(nextPageToken) - .addAllNames(BookName.toStringList(names2)) + .addAllPublishers(publishers) .build(); mockLibraryService.addResponse(expectedResponse); - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); + BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(formattedNames, formattedShelves); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15116,16 +20650,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void findRelatedBooksExceptionTest() throws Exception { + public void listPublishersExceptionTest7() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); + BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - client.findRelatedBooks(formattedNames, formattedShelves); + client.listPublishers(destination, additionalDestinations, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15134,36 +20668,33 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigBookTest() throws Exception { - BookName name2 = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void listPublishersTest8() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigBookTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); + mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + String destination = "destination-1429847026"; + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - Book actualResponse = - client.getBigBookAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15172,46 +20703,51 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigBookExceptionTest() throws Exception { + public void listPublishersExceptionTest8() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + String destination = "destination-1429847026"; + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - client.getBigBookAsync(name).get(); + client.listPublishers(destination, additionalDestinations, parent); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } - @Test @SuppressWarnings("all") - public void getBigNothingTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigNothingTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); + public void listPublishersTest9() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) + .build(); + mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + FolderName destination = FolderName.of("[FOLDER]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - Empty actualResponse = - client.getBigNothingAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15220,37 +20756,51 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigNothingExceptionTest() throws Exception { + public void listPublishersExceptionTest9() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); + FolderName destination = FolderName.of("[FOLDER]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - client.getBigNothingAsync(name).get(); + client.listPublishers(destination, additionalDestinations, parent); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } - @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest() { - TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); + public void listPublishersTest10() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) + .build(); mockLibraryService.addResponse(expectedResponse); - TestOptionalRequiredFlatteningParamsResponse actualResponse = - client.testOptionalRequiredFlatteningParams(); - Assert.assertEquals(expectedResponse, actualResponse); + BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15259,12 +20809,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { + public void listPublishersExceptionTest10() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - client.testOptionalRequiredFlatteningParams(); + BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15272,264 +20826,34 @@ public class LibraryClientTest { } @Test - @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest2() { - TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0F; - double requiredSingularDouble = 1.9111005E8; - boolean requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedInt64 = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedBool = new ArrayList<>(); - List requiredRepeatedEnum = new ArrayList<>(); - List requiredRepeatedString = new ArrayList<>(); - List requiredRepeatedBytes = new ArrayList<>(); - List requiredRepeatedMessage = new ArrayList<>(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - Any requiredAnyValue = Any.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - Value requiredValueValue = Value.newBuilder().build(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - Duration requiredDurationValue = Duration.newBuilder().build(); - FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - List requiredRepeatedStructValue = new ArrayList<>(); - List requiredRepeatedValueValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - List requiredRepeatedFloatValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List requiredRepeatedBoolValue = new ArrayList<>(); - List requiredRepeatedBytesValue = new ArrayList<>(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8F; - double optionalSingularDouble = 1.41902287E8; - boolean optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - List optionalRepeatedInt32 = new ArrayList<>(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFloat = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - List optionalRepeatedBool = new ArrayList<>(); - List optionalRepeatedEnum = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedMessage = new ArrayList<>(); - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - Map optionalMap = new HashMap<>(); - Any anyValue = Any.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Value valueValue = Value.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - Duration durationValue = Duration.newBuilder().build(); - FieldMask fieldMaskValue = FieldMask.newBuilder().build(); - Int32Value int32Value = Int32Value.newBuilder().build(); - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Int64Value int64Value = Int64Value.newBuilder().build(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - FloatValue floatValue = FloatValue.newBuilder().build(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - StringValue stringValue = StringValue.newBuilder().build(); - BoolValue boolValue = BoolValue.newBuilder().build(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedAnyValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List repeatedValueValue = new ArrayList<>(); - List repeatedListValueValue = new ArrayList<>(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedDurationValue = new ArrayList<>(); - List repeatedFieldMaskValue = new ArrayList<>(); - List repeatedInt32Value = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - List repeatedFloatValue = new ArrayList<>(); - List repeatedDoubleValue = new ArrayList<>(); - List repeatedStringValue = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - - TestOptionalRequiredFlatteningParamsResponse actualResponse = - client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - - Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); - Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); - Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); - Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); - Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); - Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); - Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); - Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); - Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); - Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); - Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); - Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); - Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); - Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); - Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); - Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); - Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); - Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); - Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); - Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); - Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); - Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); - Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); - Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); - Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); - Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); - Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); - Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); - Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); - Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); - Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); - Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); - Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); - Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); - Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); - Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); - Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); - Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); - Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); - Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); - Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); - Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); - Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); - Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); - Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); - Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); - Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); - Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); - Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); - Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); - Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); - Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); - Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); - Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); - Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); - Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); - Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); - Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); - Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); - Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); - Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); - Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); - Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); - Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); - Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); - Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); - Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); - Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); - Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); - Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); - Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); - Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); - Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); - Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); - Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); - Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); - Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); - Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); - Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); - Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); - Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); - Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); - Assert.assertEquals(anyValue, actualRequest.getAnyValue()); - Assert.assertEquals(structValue, actualRequest.getStructValue()); - Assert.assertEquals(valueValue, actualRequest.getValueValue()); - Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); - Assert.assertEquals(timeValue, actualRequest.getTimeValue()); - Assert.assertEquals(durationValue, actualRequest.getDurationValue()); - Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); - Assert.assertEquals(int32Value, actualRequest.getInt32Value()); - Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); - Assert.assertEquals(int64Value, actualRequest.getInt64Value()); - Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); - Assert.assertEquals(floatValue, actualRequest.getFloatValue()); - Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); - Assert.assertEquals(stringValue, actualRequest.getStringValue()); - Assert.assertEquals(boolValue, actualRequest.getBoolValue()); - Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); - Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); - Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); - Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); - Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); - Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); - Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); - Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); - Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); - Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); - Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); - Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); - Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); - Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); - Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); - Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); - Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); + @SuppressWarnings("all") + public void listPublishersTest11() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ArchivedBookName destination = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15538,135 +20862,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { + public void listPublishersExceptionTest11() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0F; - double requiredSingularDouble = 1.9111005E8; - boolean requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedInt64 = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedBool = new ArrayList<>(); - List requiredRepeatedEnum = new ArrayList<>(); - List requiredRepeatedString = new ArrayList<>(); - List requiredRepeatedBytes = new ArrayList<>(); - List requiredRepeatedMessage = new ArrayList<>(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - Any requiredAnyValue = Any.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - Value requiredValueValue = Value.newBuilder().build(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - Duration requiredDurationValue = Duration.newBuilder().build(); - FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - List requiredRepeatedStructValue = new ArrayList<>(); - List requiredRepeatedValueValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - List requiredRepeatedFloatValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List requiredRepeatedBoolValue = new ArrayList<>(); - List requiredRepeatedBytesValue = new ArrayList<>(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8F; - double optionalSingularDouble = 1.41902287E8; - boolean optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - List optionalRepeatedInt32 = new ArrayList<>(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFloat = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - List optionalRepeatedBool = new ArrayList<>(); - List optionalRepeatedEnum = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedMessage = new ArrayList<>(); - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - Map optionalMap = new HashMap<>(); - Any anyValue = Any.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Value valueValue = Value.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - Duration durationValue = Duration.newBuilder().build(); - FieldMask fieldMaskValue = FieldMask.newBuilder().build(); - Int32Value int32Value = Int32Value.newBuilder().build(); - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Int64Value int64Value = Int64Value.newBuilder().build(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - FloatValue floatValue = FloatValue.newBuilder().build(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - StringValue stringValue = StringValue.newBuilder().build(); - BoolValue boolValue = BoolValue.newBuilder().build(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedAnyValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List repeatedValueValue = new ArrayList<>(); - List repeatedListValueValue = new ArrayList<>(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedDurationValue = new ArrayList<>(); - List repeatedFieldMaskValue = new ArrayList<>(); - List repeatedInt32Value = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - List repeatedFloatValue = new ArrayList<>(); - List repeatedDoubleValue = new ArrayList<>(); - List repeatedStringValue = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); + ArchivedBookName destination = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; - client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + client.listPublishers(destination, additionalDestinations, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15675,27 +20880,192 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void privateListShelvesTest() { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void listPublishersTest12() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) .build(); mockLibraryService.addResponse(expectedResponse); - Book actualResponse = - client.privateListShelves(); - Assert.assertEquals(expectedResponse, actualResponse); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listPublishersExceptionTest12() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listPublishersTest13() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listPublishersExceptionTest13() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listPublishersTest14() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BillingAccountName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listPublishersExceptionTest14() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BillingAccountName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listPublishersTest15() { + String nextPageToken = ""; + Publisher publishersElement = Publisher.newBuilder().build(); + List publishers = Arrays.asList(publishersElement); + ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllPublishers(publishers) + .build(); + mockLibraryService.addResponse(expectedResponse); + + String destination = "destination-1429847026"; + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListShelvesRequest actualRequest = (ListShelvesRequest)actualRequests.get(0); + ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15704,12 +21074,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void privateListShelvesExceptionTest() throws Exception { + public void listPublishersExceptionTest15() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - client.privateListShelves(); + String destination = "destination-1429847026"; + List additionalDestinations = new ArrayList<>(); + String parent = "parent-995424086"; + + client.listPublishers(destination, additionalDestinations, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15768,13 +21142,13 @@ public class LibrarySmokeTest { public static void executeNoCatch() throws Exception { try (LibraryClient client = LibraryClient.create()) { - BookName name = ShelfBookName.of("[BOOK_SHELF]", "[BOOK]"); Book.Rating rating = Book.Rating.GOOD; Book book = Book.newBuilder() .setRating(rating) .build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Book response = client.updateBook(name, book); + Book response = client.updateBook(book, name); } } @@ -16148,6 +21522,21 @@ public class MockLibraryServiceImpl extends LibraryServiceImplBase { } } + @Override + public void listPublishers(ListPublishersRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListPublishersResponse) { + requests.add(request); + responseObserver.onNext((ListPublishersResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void getBook(GetBookRequest request, StreamObserver responseObserver) { diff --git a/src/test/java/com/google/api/codegen/testsrc/common/library.proto b/src/test/java/com/google/api/codegen/testsrc/common/library.proto index cd9d21cf70..9f488d825e 100644 --- a/src/test/java/com/google/api/codegen/testsrc/common/library.proto +++ b/src/test/java/com/google/api/codegen/testsrc/common/library.proto @@ -28,8 +28,8 @@ option java_package = "com.google.example.library.v1"; option go_package = "google.golang.org/genproto/googleapis/example/library/v1;library"; option (google.api.resource_definition) = { - type: "library.googleapis.com/Publisher", - pattern: "projects/{project}/locations/{location}/publishers/{publisher}" + type: "library.googleapis.com/Archive", + pattern: "archives/{archive}" }; // This API represents a simple digital library. It lets you manage Shelf @@ -114,6 +114,10 @@ service LibraryService { option (google.api.method_signature) = "shelf,books,edition,series_uuid,publisher"; } + rpc ListPublishers(ListPublishersRequest) returns (ListPublishersResponse) { + option (google.api.method_signature) = "parent,destination,additional_destinations"; + } + // Gets a book. rpc GetBook(GetBookRequest) returns (Book) { option (google.api.http) = { get: "/v1/{name=bookShelves/*/books/*}" }; @@ -396,7 +400,7 @@ service LibraryService { message Book { option (google.api.resource) = { type: "library.googleapis.com/Book", - pattern: "bookShelves/{book_shelf}/books/{book}", + pattern: "shelves/{shelf_id}/books/{book}", pattern: "archives/{archive}/books/{book}", pattern: "projects/{project}/books/{book}" history: ORIGINALLY_SINGLE_PATTERN, @@ -713,7 +717,7 @@ message ListBooksRequest { // The name of the shelf whose books we'd like to list. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "library.googleapis.com/Shelf"]; + (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; // Requested page size. Server may return fewer books than requested. // If unspecified, server will pick an appropriate default. @@ -918,7 +922,7 @@ message DiscussBookRequest { message FindRelatedBooksRequest { repeated string names = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "library.googleapis.com/Book"]; + (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; repeated string shelves = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "library.googleapis.com/Shelf"]; @@ -1104,3 +1108,40 @@ message TestOptionalRequiredFlatteningParamsRequest { message TestOptionalRequiredFlatteningParamsResponse { } + +message Publisher { + + option (google.api.resource) = { + type: "library.googleapis.com/Publisher", + pattern: "projects/{project}/locations/{location}/publishers/{publisher}", + pattern: "projects/{project}/publishers/{publisher}", + pattern: "*" + }; + + string name = 1; +} + +message ListPublishersRequest { + + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).child_type = "library.googleapis.com/Publisher"]; + + string destination = 2 [ + (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; + + repeated string additional_destinations = 3 [ + (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; + + int32 page_size = 4; + + string page_token = 5; +} + +message ListPublishersResponse { + + repeated Publisher publishers = 1; + + string next_page_token = 2; + +} \ No newline at end of file From 774f1bf659517d96f2221be426c444d37f02ce3d Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Wed, 22 Jan 2020 17:43:58 -0800 Subject: [PATCH 05/36] wip --- .../config/ResourceDescriptorConfig.java | 1 + .../testdata/java_library.baseline | 1200 +---------------- 2 files changed, 67 insertions(+), 1134 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index fe9d22588d..b4be3ebcef 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -195,6 +195,7 @@ private static List getParentResourceDescriptor( .values() .stream() .flatMap(List::stream) + .distinct() .collect(Collectors.toList()); ImmutableList.Builder parentResources = ImmutableList.builder(); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 2b2e87c434..8001f58589 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -5954,118 +5954,6 @@ public class LibraryClient implements BackgroundResource { return listBooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, BookName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   String name = "";
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, PublisherName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   String name = "";
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -6122,62 +6010,6 @@ public class LibraryClient implements BackgroundResource { return listBooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, BookName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -6402,62 +6234,6 @@ public class LibraryClient implements BackgroundResource { return listBooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   String name = "";
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, PublisherName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   String name = "";
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -7422,7 +7198,7 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   FolderName parent = FolderName.of("[FOLDER]");
    *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
@@ -7431,7 +7207,7 @@ public class LibraryClient implements BackgroundResource { * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, BookName parent) { + public final BookFromArchive getBookFromArchive(ArchivedBookName name, FolderName parent) { GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder() .setName(name == null ? null : name.toString()) @@ -7448,7 +7224,7 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   String parent = "";
+   *   ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
@@ -7457,7 +7233,7 @@ public class LibraryClient implements BackgroundResource { * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, PublisherName parent) { + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchivedBookName parent) { GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder() .setName(name == null ? null : name.toString()) @@ -7474,7 +7250,7 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   ArchiveName parent = ArchiveName.of("[ARCHIVE]");
    *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
@@ -7483,7 +7259,7 @@ public class LibraryClient implements BackgroundResource { * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, FolderName parent) { + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchiveName parent) { GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder() .setName(name == null ? null : name.toString()) @@ -7500,7 +7276,7 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ShelfName parent = ShelfName.of("[SHELF_ID]");
    *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
@@ -7509,7 +7285,7 @@ public class LibraryClient implements BackgroundResource { * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, BookName parent) { + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ShelfName parent) { GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder() .setName(name == null ? null : name.toString()) @@ -7526,7 +7302,7 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
    *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
@@ -7535,7 +7311,7 @@ public class LibraryClient implements BackgroundResource { * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchivedBookName parent) { + public final BookFromArchive getBookFromArchive(ArchivedBookName name, BillingAccountName parent) { GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder() .setName(name == null ? null : name.toString()) @@ -7552,120 +7328,16 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ArchiveName parent = ArchiveName.of("[ARCHIVE]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   String parent = "";
+   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setParent(parent.toString())
+   *     .build();
+   *   BookFromArchive response = libraryClient.getBookFromArchive(request);
    * }
    * 
* - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchiveName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from an archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ShelfName parent = ShelfName.of("[SHELF_ID]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ShelfName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from an archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, BillingAccountName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from an archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   String parent = "";
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, PublisherName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from an archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   String parent = "";
-   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setParent(parent.toString())
-   *     .build();
-   *   BookFromArchive response = libraryClient.getBookFromArchive(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final BookFromArchive getBookFromArchive(GetBookFromArchiveRequest request) { @@ -9885,68 +9557,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String destination = "";
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -9978,37 +9588,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -10133,37 +9712,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String destination = "";
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -16785,7 +16333,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); String filter = "book-filter-string"; - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + FolderName name = FolderName.of("[FOLDER]"); ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); @@ -16798,7 +16346,7 @@ public class LibraryClientTest { ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, FolderName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16813,7 +16361,7 @@ public class LibraryClientTest { try { String filter = "book-filter-string"; - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + FolderName name = FolderName.of("[FOLDER]"); client.listBooks(filter, name); Assert.fail("No exception raised"); @@ -16835,7 +16383,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); String filter = "book-filter-string"; - String name = "name3373707"; + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); @@ -16848,7 +16396,7 @@ public class LibraryClientTest { ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, PublisherNames.parse(actualRequest.getName())); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16863,7 +16411,7 @@ public class LibraryClientTest { try { String filter = "book-filter-string"; - String name = "name3373707"; + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); client.listBooks(filter, name); Assert.fail("No exception raised"); @@ -16885,7 +16433,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); String filter = "book-filter-string"; - FolderName name = FolderName.of("[FOLDER]"); + ArchiveName name = ArchiveName.of("[ARCHIVE]"); ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); @@ -16898,7 +16446,7 @@ public class LibraryClientTest { ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, FolderName.parse(actualRequest.getName())); + Assert.assertEquals(name, ArchiveName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16913,7 +16461,7 @@ public class LibraryClientTest { try { String filter = "book-filter-string"; - FolderName name = FolderName.of("[FOLDER]"); + ArchiveName name = ArchiveName.of("[ARCHIVE]"); client.listBooks(filter, name); Assert.fail("No exception raised"); @@ -16935,7 +16483,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); String filter = "book-filter-string"; - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); @@ -16948,7 +16496,7 @@ public class LibraryClientTest { ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16963,7 +16511,7 @@ public class LibraryClientTest { try { String filter = "book-filter-string"; - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); client.listBooks(filter, name); Assert.fail("No exception raised"); @@ -16985,157 +16533,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); String filter = "book-filter-string"; - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest9() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String filter = "book-filter-string"; - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listBooksTest10() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String filter = "book-filter-string"; - ArchiveName name = ArchiveName.of("[ARCHIVE]"); - - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, ArchiveName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest10() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String filter = "book-filter-string"; - ArchiveName name = ArchiveName.of("[ARCHIVE]"); - - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listBooksTest11() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String filter = "book-filter-string"; - ShelfName name = ShelfName.of("[SHELF_ID]"); - - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest11() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String filter = "book-filter-string"; - ShelfName name = ShelfName.of("[SHELF_ID]"); - - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listBooksTest12() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String filter = "book-filter-string"; - BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]"); + BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]"); ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); @@ -17157,7 +16555,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest12() throws Exception { + public void listBooksExceptionTest9() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -17174,57 +16572,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksTest13() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String filter = "book-filter-string"; - String name = "name3373707"; - - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, PublisherNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest13() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String filter = "book-filter-string"; - String name = "name3373707"; - - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listBooksTest14() { + public void listBooksTest10() { String nextPageToken = ""; Book booksElement = Book.newBuilder().build(); List books = Arrays.asList(booksElement); @@ -17257,7 +16605,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest14() throws Exception { + public void listBooksExceptionTest10() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -17274,7 +16622,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksTest15() { + public void listBooksTest11() { String nextPageToken = ""; Book booksElement = Book.newBuilder().build(); List books = Arrays.asList(booksElement); @@ -17307,7 +16655,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest15() throws Exception { + public void listBooksExceptionTest11() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -18255,108 +17603,6 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, BookNames.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest7() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest8() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String parent = "parent-995424086"; - - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, PublisherNames.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest8() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String parent = "parent-995424086"; - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest9() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); FolderName parent = FolderName.of("[FOLDER]"); @@ -18378,115 +17624,13 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest9() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - FolderName parent = FolderName.of("[FOLDER]"); - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest10() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, BookNames.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest10() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest11() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ArchivedBookName.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest11() throws Exception { + public void getBookFromArchiveExceptionTest7() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + FolderName parent = FolderName.of("[FOLDER]"); client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); @@ -18497,7 +17641,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest12() { + public void getBookFromArchiveTest8() { ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -18511,7 +17655,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchiveName parent = ArchiveName.of("[ARCHIVE]"); + ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); BookFromArchive actualResponse = client.getBookFromArchive(name, parent); @@ -18522,7 +17666,7 @@ public class LibraryClientTest { GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ArchiveName.parse(actualRequest.getParent())); + Assert.assertEquals(parent, ArchivedBookName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18531,13 +17675,13 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest12() throws Exception { + public void getBookFromArchiveExceptionTest8() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchiveName parent = ArchiveName.of("[ARCHIVE]"); + ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); @@ -18548,7 +17692,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest13() { + public void getBookFromArchiveTest9() { ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -18562,7 +17706,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ShelfName parent = ShelfName.of("[SHELF_ID]"); + ArchiveName parent = ArchiveName.of("[ARCHIVE]"); BookFromArchive actualResponse = client.getBookFromArchive(name, parent); @@ -18573,7 +17717,7 @@ public class LibraryClientTest { GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ShelfName.parse(actualRequest.getParent())); + Assert.assertEquals(parent, ArchiveName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18582,13 +17726,13 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest13() throws Exception { + public void getBookFromArchiveExceptionTest9() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ShelfName parent = ShelfName.of("[SHELF_ID]"); + ArchiveName parent = ArchiveName.of("[ARCHIVE]"); client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); @@ -18599,7 +17743,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest14() { + public void getBookFromArchiveTest10() { ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -18613,7 +17757,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + ShelfName parent = ShelfName.of("[SHELF_ID]"); BookFromArchive actualResponse = client.getBookFromArchive(name, parent); @@ -18624,7 +17768,7 @@ public class LibraryClientTest { GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, BillingAccountName.parse(actualRequest.getParent())); + Assert.assertEquals(parent, ShelfName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18633,13 +17777,13 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest14() throws Exception { + public void getBookFromArchiveExceptionTest10() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + ShelfName parent = ShelfName.of("[SHELF_ID]"); client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); @@ -18650,7 +17794,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest15() { + public void getBookFromArchiveTest11() { ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -18664,7 +17808,7 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String parent = "parent-995424086"; + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); BookFromArchive actualResponse = client.getBookFromArchive(name, parent); @@ -18675,7 +17819,7 @@ public class LibraryClientTest { GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, PublisherNames.parse(actualRequest.getParent())); + Assert.assertEquals(parent, BillingAccountName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18684,13 +17828,13 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest15() throws Exception { + public void getBookFromArchiveExceptionTest11() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String parent = "parent-995424086"; + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); @@ -20625,112 +19769,6 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listPublishersExceptionTest7() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - client.listPublishers(destination, additionalDestinations, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listPublishersTest8() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String destination = "destination-1429847026"; - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listPublishersExceptionTest8() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String destination = "destination-1429847026"; - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - client.listPublishers(destination, additionalDestinations, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listPublishersTest9() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) - .build(); - mockLibraryService.addResponse(expectedResponse); - FolderName destination = FolderName.of("[FOLDER]"); List additionalDestinations = new ArrayList<>(); String parent = "parent-995424086"; @@ -20756,7 +19794,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest9() throws Exception { + public void listPublishersExceptionTest7() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -20774,60 +19812,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest10() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) - .build(); - mockLibraryService.addResponse(expectedResponse); - - BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listPublishersExceptionTest10() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - client.listPublishers(destination, additionalDestinations, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listPublishersTest11() { + public void listPublishersTest8() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -20862,7 +19847,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest11() throws Exception { + public void listPublishersExceptionTest8() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -20880,7 +19865,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest12() { + public void listPublishersTest9() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -20915,7 +19900,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest12() throws Exception { + public void listPublishersExceptionTest9() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -20933,7 +19918,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest13() { + public void listPublishersTest10() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -20968,7 +19953,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest13() throws Exception { + public void listPublishersExceptionTest10() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -20986,7 +19971,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest14() { + public void listPublishersTest11() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -21021,7 +20006,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest14() throws Exception { + public void listPublishersExceptionTest11() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -21037,59 +20022,6 @@ public class LibraryClientTest { } } - @Test - @SuppressWarnings("all") - public void listPublishersTest15() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String destination = "destination-1429847026"; - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listPublishersExceptionTest15() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String destination = "destination-1429847026"; - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - client.listPublishers(destination, additionalDestinations, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - } ============== file: src/test/java/com/google/example/library/v1/LibrarySmokeTest.java ============== /* From 0b60145334d9cb04614f140498be01e0c089cfb6 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 23 Jan 2020 12:33:00 -0800 Subject: [PATCH 06/36] wip --- .../api/codegen/config/FieldConfig.java | 2 +- .../api/codegen/config/FlatteningConfig.java | 70 +- .../api/codegen/config/GapicMethodConfig.java | 8 +- .../config/ResourceDescriptorConfig.java | 111 +- .../testdata/java_library.baseline | 15641 ++++++---------- .../api/codegen/testsrc/common/library.proto | 3 +- 6 files changed, 6226 insertions(+), 9609 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index 76fc6cf0ee..eafa4fd736 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -195,7 +195,7 @@ private static List createFieldConfigsWithMultipleResourceNames( field, treatment, defaultResourceNameTreatment); - fieldConfig.useResourceNameTypeInSampleOnly(); + fieldConfig = fieldConfig.withResourceNameInSampleOnly(); return Collections.singletonList(fieldConfig); } ImmutableList.Builder fieldConfigs = ImmutableList.builder(); diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index dc6b52c884..f56811e07d 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -30,8 +30,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -54,7 +54,7 @@ private static void insertFlatteningsFromGapicConfig( ImmutableMap resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel methodModel, - ImmutableListMultimap.Builder flatteningConfigs) { + ImmutableMap.Builder> flatteningConfigs) { for (FlatteningGroupProto flatteningGroup : methodConfigProto.getFlattening().getGroupsList()) { FlatteningConfig groupConfig = @@ -66,12 +66,12 @@ private static void insertFlatteningsFromGapicConfig( flatteningGroup, methodModel); if (groupConfig != null) { - flatteningConfigs.put(flatteningConfigToString(groupConfig), groupConfig); if (hasAnyResourceNameParameter(groupConfig)) { flatteningConfigs.put( - flatteningConfigToString(groupConfig) + "2", - groupConfig.withResourceNamesInSamplesOnly()); + flatteningConfigToString(groupConfig), + ImmutableList.of(groupConfig, groupConfig.withResourceNamesInSamplesOnly())); } + flatteningConfigs.put(flatteningConfigToString(groupConfig), ImmutableList.of(groupConfig)); } } } @@ -82,8 +82,7 @@ static ImmutableList createFlatteningConfigs( ImmutableMap resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel methodModel) { - ImmutableListMultimap.Builder flatteningConfigs = - ImmutableListMultimap.builder(); + ImmutableMap.Builder> flatteningConfigs = ImmutableMap.builder(); insertFlatteningsFromGapicConfig( diagCollector, messageConfigs, @@ -94,7 +93,12 @@ static ImmutableList createFlatteningConfigs( if (diagCollector.hasErrors()) { return null; } - return ImmutableList.copyOf(flatteningConfigs.build().values()); + return flatteningConfigs + .build() + .values() + .stream() + .flatMap(List::stream) + .collect(ImmutableList.toImmutableList()); } @VisibleForTesting @@ -107,8 +111,7 @@ static ImmutableList createFlatteningConfigs( ProtoMethodModel methodModel, ProtoParser protoParser) { - ImmutableListMultimap.Builder flatteningConfigs = - ImmutableListMultimap.builder(); + ImmutableMap.Builder> flatteningConfigs = ImmutableMap.builder(); insertFlatteningsFromGapicConfig( diagCollector, @@ -128,7 +131,12 @@ static ImmutableList createFlatteningConfigs( if (diagCollector.hasErrors()) { return null; } - return ImmutableList.copyOf(flatteningConfigs.build().values()); + return flatteningConfigs + .build() + .values() + .stream() + .flatMap(List::stream) + .collect(ImmutableList.toImmutableList()); } /** @@ -141,7 +149,7 @@ private static void insertFlatteningConfigsFromProtoFile( ImmutableMap resourceNameConfigs, ProtoMethodModel methodModel, ProtoParser protoParser, - ImmutableListMultimap.Builder flatteningConfigs) { + ImmutableMap.Builder> flatteningConfigs) { // Get flattenings from protofile annotations, let these override flattenings from GAPIC config. List> methodSignatures = protoParser.getMethodSignatures(methodModel.getProtoMethod()); @@ -154,10 +162,8 @@ private static void insertFlatteningConfigsFromProtoFile( signature, methodModel, protoParser); - if (groupConfigs != null) { - for (FlatteningConfig groupConfig : groupConfigs) { - flatteningConfigs.put(flatteningConfigToString(groupConfig), groupConfig); - } + if (groupConfigs != null && !groupConfigs.isEmpty()) { + flatteningConfigs.put(flatteningConfigToString(groupConfigs.get(0)), groupConfigs); } } } @@ -274,7 +280,7 @@ private static List createFlatteningsFromProtoFile( } // We also generate an overload that all resource names are treated as strings - if (hasAnyResourceNameParameter(flatteningConfigs)) { + if (hasBothSingularAndRepeatedResourceNameParameters(flatteningConfigs)) { flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0))); } @@ -292,7 +298,7 @@ private static void collectFieldConfigs( int flatteningConfigsCount = flatteningConfigs.size(); if (flatteningConfigsCount == 0) { for (int j = 0; j < fieldConfigs.size(); j++) { - HashMap newFlattening = new HashMap<>(); + LinkedHashMap newFlattening = new LinkedHashMap<>(); newFlattening.put(parameter, fieldConfigs.get(j)); flatteningConfigs.add(newFlattening); System.out.println(j); @@ -300,7 +306,8 @@ private static void collectFieldConfigs( } else { for (int i = 0; i < flatteningConfigsCount; i++) { for (int j = 0; j < fieldConfigs.size() - 1; j++) { - HashMap newFlattening = new HashMap<>(flatteningConfigs.get(i)); + LinkedHashMap newFlattening = + new LinkedHashMap<>(flatteningConfigs.get(i)); newFlattening.put(parameter, fieldConfigs.get(j)); flatteningConfigs.add(newFlattening); System.out.println(i); @@ -423,4 +430,29 @@ private static boolean hasAnyResourceNameParameter( private static boolean hasAnyResourceNameParameter(Map flatteningGroup) { return flatteningGroup.values().stream().anyMatch(FieldConfig::useResourceNameType); } + + private static boolean hasSingularResourceNameParameter( + Map flatteningGroup) { + return flatteningGroup + .values() + .stream() + .anyMatch( + f -> (!f.getField().isRepeated() && !f.getField().isMap() && f.useResourceNameType())); + } + + private static boolean hasAnyRepeatedResourceNameParameter( + Map flatteningGroup) { + return flatteningGroup + .values() + .stream() + .anyMatch(f -> f.getField().isRepeated() && f.useResourceNameType()); + } + + private static boolean hasBothSingularAndRepeatedResourceNameParameters( + List> flatteningGroups) { + return flatteningGroups + .stream() + .anyMatch( + f -> (hasSingularResourceNameParameter(f) && hasAnyRepeatedResourceNameParameter(f))); + } } diff --git a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java index 507ed8f048..5b9ff1359c 100644 --- a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java @@ -244,11 +244,15 @@ static GapicMethodConfig createGapicMethodConfigFromProto( .setLroConfig( LongRunningConfig.createLongRunningConfig( method, diagCollector, methodConfigProto.getLongRunning(), protoParser)); - if (diagCollector.getErrorCount() - previousErrors > 0) { return null; } else { - return builder.build(); + GapicMethodConfig methodConfig = builder.build(); + if (methodConfig.getMethodModel().getSimpleName().contains("ListPublishers")) { + System.out.println("methodconfig"); + System.out.println(methodConfig.getFlatteningConfigs()); + } + return methodConfig; } } diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index b4be3ebcef..e8ce57ca84 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -25,11 +25,11 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; -import javax.annotation.Nullable; /** * Class that represents a google.api.ResourceDescriptor annotation, and is used to construct @@ -176,57 +176,72 @@ static Map> getChildParentResourceMap( Map descriptorConfigMap, Map> patternResourceDescriptorMap) { ImmutableMap.Builder> builder = ImmutableMap.builder(); + List allResources = + ImmutableList.copyOf(descriptorConfigMap.values()); + System.out.println(allResources); for (Map.Entry entry : descriptorConfigMap.entrySet()) { - List parentResource = - getParentResourceDescriptor(entry.getValue(), patternResourceDescriptorMap); - if (!parentResource.isEmpty()) { - builder.put(entry.getKey(), parentResource); + ResourceDescriptorConfig childResource = entry.getValue(); + for (int i = 0; i < allResources.size(); i++) { + List parentResource = + matchParentResourceDescriptor( + getParentPatternsMap(childResource), + allResources, + new ArrayList<>(), + childResource.getPatterns().size(), + i); + if (parentResource != null) { + builder.put(entry.getKey(), parentResource); + break; + } } } - return builder.build(); + + Map> result = builder.build(); + System.out.println(result); + return result; } - @Nullable - private static List getParentResourceDescriptor( - ResourceDescriptorConfig childResource, - Map> patternResourceDescriptorMap) { - List resources = - patternResourceDescriptorMap - .values() - .stream() - .flatMap(List::stream) - .distinct() - .collect(Collectors.toList()); - - ImmutableList.Builder parentResources = ImmutableList.builder(); - - Map matchedParentPatterns = - childResource - .getPatterns() - .stream() - .map(ResourceDescriptorConfig::getParentPattern) - .distinct() - .collect(Collectors.toMap(p -> p, p -> false)); - int unmatchedPatternsCount = matchedParentPatterns.size(); - - for (ResourceDescriptorConfig resource : resources) { - for (String pattern : resource.getPatterns()) { - Boolean matched = matchedParentPatterns.get(pattern); - if (matched == null) { - continue; - } - if (matched == false) { - unmatchedPatternsCount -= 1; - } - matchedParentPatterns.put(pattern, true); + private static List matchParentResourceDescriptor( + Map parentPatterns, + List allResources, + List matchedParentResources, + int unmatchedPatternsCount, + int i) { + System.out.println("parentPatterns"); + System.out.println(parentPatterns); + System.out.println("matchedparentresource"); + System.out.println(matchedParentResources); + System.out.println("currentresource"); + System.out.println(allResources.get(i)); + // We make a copy to advance in the depth-first search. There won't be + // too many patterns in a resource so performance-wise it is not a problem. + Map parentPatternsCopy = new HashMap<>(parentPatterns); + ResourceDescriptorConfig matchingResource = allResources.get(i); + for (String pattern : matchingResource.getPatterns()) { + if (!parentPatternsCopy.containsKey(pattern)) { + return null; + } + if (parentPatternsCopy.get(pattern) == false) { + unmatchedPatternsCount--; + parentPatternsCopy.put(pattern, true); } - parentResources.add(resource); } - + matchedParentResources.add(matchingResource); if (unmatchedPatternsCount == 0) { - return parentResources.build(); + return ImmutableList.copyOf(matchedParentResources); + } + for (int j = i + 1; j < allResources.size(); j++) { + List result = + matchParentResourceDescriptor( + parentPatternsCopy, allResources, matchedParentResources, unmatchedPatternsCount, j); + + // We stop when we find the first list of matched parent resources + if (result != null) { + return result; + } } - return Collections.emptyList(); + matchedParentResources.remove(matchedParentResources.size() - 1); + return null; } @VisibleForTesting @@ -243,6 +258,14 @@ static String getParentPattern(String pattern) { return String.join("/", segments.subList(0, index)); } + static Map getParentPatternsMap(ResourceDescriptorConfig resource) { + return resource + .getPatterns() + .stream() + .map(ResourceDescriptorConfig::getParentPattern) + .collect(ImmutableMap.toImmutableMap(p -> p, p -> false)); + } + private static List getSegments(String pattern) { return ImmutableList.copyOf(pattern.split("/")); } diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 8001f58589..ce8ddf3bbf 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -509,7 +509,7 @@ public class DeleteShelfFlattenedEmptyResponseTypeWithResponseHandling { public static void sampleDeleteShelf() { try (LibraryClient libraryClient = LibraryClient.create()) { ShelfName name = ShelfName.of("[SHELF_ID]"); - libraryClient.deleteShelf(name.toString()); + libraryClient.deleteShelf(name); // Shelf deleted System.out.println("Shelf deleted."); } catch (Exception exception) { @@ -562,7 +562,7 @@ public class DeleteShelfFlattenedEmptyResponseTypeWithoutResponseHandling { public static void sampleDeleteShelf() { try (LibraryClient libraryClient = LibraryClient.create()) { ShelfName name = ShelfName.of("[SHELF_ID]"); - libraryClient.deleteShelf(name.toString()); + libraryClient.deleteShelf(name); } catch (Exception exception) { System.err.println("Failed to create the client due to: " + exception); } @@ -711,11 +711,11 @@ public class DeleteShelfRequestEmptyResponseTypeWithoutResponseHandling { package com.google.example.examples.library.v1; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -725,11 +725,11 @@ public class FindRelatedBooksCallableCallableListOdyssey { /* * Please include the following imports to run this sample. * + * import com.google.example.library.v1.ArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -738,12 +738,12 @@ public class FindRelatedBooksCallableCallableListOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - String namesElement = "Odyssey"; - List names = Arrays.asList(namesElement); + ArchiveName namesElement = ArchiveName.of("[ARCHIVE]"); + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(PublisherName.toStringList(names)) + .addAllNames(ArchiveName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); while (true) { @@ -820,7 +820,7 @@ public class FindRelatedBooksFlattenedPagedOdyssey { List names = Arrays.asList(namesElement); String shelvesElement = "Classics"; List shelves = Arrays.asList(shelvesElement); - ApiFuture future = libraryClient.findRelatedBooks().futureCall(names, formattedShelves); + ApiFuture future = libraryClient.findRelatedBooks().futureCall(formattedNames, formattedShelves); // Do something @@ -863,11 +863,11 @@ public class FindRelatedBooksFlattenedPagedOdyssey { package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -878,11 +878,11 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; + * import com.google.example.library.v1.ArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -891,12 +891,12 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - String namesElement = "Odyssey"; - List names = Arrays.asList(namesElement); + ArchiveName namesElement = ArchiveName.of("[ARCHIVE]"); + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(PublisherName.toStringList(names)) + .addAllNames(ArchiveName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); ApiFuture future = libraryClient.findRelatedBooksPagedCallable().futureCall(request); @@ -941,10 +941,10 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { package com.google.example.examples.library.v1; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -954,10 +954,10 @@ public class FindRelatedBooksRequestPagedOdyssey { /* * Please include the following imports to run this sample. * + * import com.google.example.library.v1.ArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -966,12 +966,12 @@ public class FindRelatedBooksRequestPagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - String namesElement = "Odyssey"; - List names = Arrays.asList(namesElement); + ArchiveName namesElement = ArchiveName.of("[ARCHIVE]"); + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(PublisherName.toStringList(names)) + .addAllNames(ArchiveName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); for (BookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) { @@ -2484,7 +2484,7 @@ public class GetBookFlattenedTestOnSuccessMap { public static void sampleGetBook() { try (LibraryClient libraryClient = LibraryClient.create()) { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Book response = libraryClient.getBook(name.toString()); + Book response = libraryClient.getBook(name); String intKeyVal = response.getMapStringValueMap().get(123); String booleanKeyVal = response.getMapBoolKeyMap().get(true); int mapValueField = response.getMapMessageValueMap().get("key").getField(); @@ -2928,16 +2928,16 @@ public class PublishSeriesFlattenedPiVersion { */ public static void samplePublishSeries(String shelfName, int edition) { try (LibraryClient libraryClient = LibraryClient.create()) { + Shelf shelf = Shelf.newBuilder() + .setName(shelfName) + .build(); List books = new ArrayList<>(); - String publisher = ""; String seriesString = "xyz3141592654"; SeriesUuid seriesUuid = SeriesUuid.newBuilder() .setSeriesString(seriesString) .build(); - Shelf shelf = Shelf.newBuilder() - .setName(shelfName) - .build(); - PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher.toString(), seriesUuid, shelf); + String publisher = ""; + PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher); // % % % output handling % % % % // fourScoreAndSevenYears ago // @@ -3036,12 +3036,12 @@ public class PublishSeriesFlattenedSecondEdition { /** Testing calling forms */ public static void samplePublishSeries() { try (LibraryClient libraryClient = LibraryClient.create()) { + Shelf shelf = Shelf.newBuilder().build(); List books = new ArrayList<>(); int edition = 2; - String publisher = ""; SeriesUuid seriesUuid = SeriesUuid.newBuilder().build(); - Shelf shelf = Shelf.newBuilder().build(); - PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher.toString(), seriesUuid, shelf); + String publisher = ""; + PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher); System.out.println(response); } catch (Exception exception) { System.err.println("Failed to create the client due to: " + exception); @@ -4357,6 +4357,7 @@ import com.google.protobuf.BytesValue; import com.google.protobuf.DoubleValue; import com.google.protobuf.Duration; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import com.google.protobuf.FloatValue; import com.google.protobuf.Int32Value; import com.google.protobuf.Int64Value; @@ -4471,9 +4472,6 @@ public class LibraryClient implements BackgroundResource { private static final PathTemplate ARCHIVED_BOOK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("archives/{archive}/books/{book}"); - private static final PathTemplate BILLING_ACCOUNT_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}"); - private static final PathTemplate SHELF_BOOK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("bookShelves/{book_shelf}/books/{book}"); @@ -4486,9 +4484,6 @@ public class LibraryClient implements BackgroundResource { private static final PathTemplate LOCATION_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - private static final PathTemplate ORGANIZATION_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); - private static final PathTemplate PROJECT_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}"); @@ -4523,18 +4518,6 @@ public class LibraryClient implements BackgroundResource { "book", book); } - /** - * Formats a string containing the fully-qualified path to represent - * a billing_account resource. - * - * @deprecated Use the {@link BillingAccountName} class instead. - */ - @Deprecated - public static final String formatBillingAccountName(String billingAccount) { - return BILLING_ACCOUNT_PATH_TEMPLATE.instantiate( - "billing_account", billingAccount); - } - /** * Formats a string containing the fully-qualified path to represent * a shelf_book resource. @@ -4586,18 +4569,6 @@ public class LibraryClient implements BackgroundResource { "location", location); } - /** - * Formats a string containing the fully-qualified path to represent - * a organization resource. - * - * @deprecated Use the {@link OrganizationName} class instead. - */ - @Deprecated - public static final String formatOrganizationName(String organization) { - return ORGANIZATION_PATH_TEMPLATE.instantiate( - "organization", organization); - } - /** * Formats a string containing the fully-qualified path to represent * a project resource. @@ -4668,17 +4639,6 @@ public class LibraryClient implements BackgroundResource { return ARCHIVED_BOOK_PATH_TEMPLATE.parse(archivedBookName).get("book"); } - /** - * Parses the billing_account from the given fully-qualified path which - * represents a billing_account resource. - * - * @deprecated Use the {@link BillingAccountName} class instead. - */ - @Deprecated - public static final String parseBillingAccountFromBillingAccountName(String billingAccountName) { - return BILLING_ACCOUNT_PATH_TEMPLATE.parse(billingAccountName).get("billing_account"); - } - /** * Parses the book_shelf from the given fully-qualified path which * represents a shelf_book resource. @@ -4756,17 +4716,6 @@ public class LibraryClient implements BackgroundResource { return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); } - /** - * Parses the organization from the given fully-qualified path which - * represents a organization resource. - * - * @deprecated Use the {@link OrganizationName} class instead. - */ - @Deprecated - public static final String parseOrganizationFromOrganizationName(String organizationName) { - return ORGANIZATION_PATH_TEMPLATE.parse(organizationName).get("organization"); - } - /** * Parses the project from the given fully-qualified path which * represents a project resource. @@ -4964,29 +4913,6 @@ public class LibraryClient implements BackgroundResource { return getShelf(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   Shelf response = libraryClient.getShelf(name.toString());
-   * }
-   * 
- * - * @param name The name of the shelf to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Shelf getShelf(String name) { - GetShelfRequest request = - GetShelfRequest.newBuilder() - .setName(name) - .build(); - return getShelf(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets a shelf. @@ -5022,77 +4948,22 @@ public class LibraryClient implements BackgroundResource { * try (LibraryClient libraryClient = LibraryClient.create()) { * ShelfName name = ShelfName.of("[SHELF_ID]"); * SomeMessage message = SomeMessage.newBuilder().build(); - * Shelf response = libraryClient.getShelf(name.toString(), message); - * } - *
- * - * @param name The name of the shelf to retrieve. - * @param message Field to verify that message-type query parameter gets flattened. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Shelf getShelf(String name, SomeMessage message) { - GetShelfRequest request = - GetShelfRequest.newBuilder() - .setName(name) - .setMessage(message) - .build(); - return getShelf(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build();
-   *   SomeMessage message = SomeMessage.newBuilder().build();
-   *   Shelf response = libraryClient.getShelf(name, stringBuilder, message);
+   *   Shelf response = libraryClient.getShelf(name, message, stringBuilder);
    * }
    * 
* * @param name The name of the shelf to retrieve. - * @param stringBuilder * @param message Field to verify that message-type query parameter gets flattened. + * @param stringBuilder * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Shelf getShelf(ShelfName name, com.google.example.library.v1.StringBuilder stringBuilder, SomeMessage message) { + public final Shelf getShelf(ShelfName name, SomeMessage message, com.google.example.library.v1.StringBuilder stringBuilder) { GetShelfRequest request = GetShelfRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setStringBuilder(stringBuilder) .setMessage(message) - .build(); - return getShelf(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build();
-   *   SomeMessage message = SomeMessage.newBuilder().build();
-   *   Shelf response = libraryClient.getShelf(name.toString(), stringBuilder, message);
-   * }
-   * 
- * - * @param name The name of the shelf to retrieve. - * @param stringBuilder - * @param message Field to verify that message-type query parameter gets flattened. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Shelf getShelf(String name, com.google.example.library.v1.StringBuilder stringBuilder, SomeMessage message) { - GetShelfRequest request = - GetShelfRequest.newBuilder() - .setName(name) .setStringBuilder(stringBuilder) - .setMessage(message) .build(); return getShelf(request); } @@ -5236,29 +5107,6 @@ public class LibraryClient implements BackgroundResource { deleteShelf(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   libraryClient.deleteShelf(name.toString());
-   * }
-   * 
- * - * @param name The name of the shelf to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteShelf(String name) { - DeleteShelfRequest request = - DeleteShelfRequest.newBuilder() - .setName(name) - .build(); - deleteShelf(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes a shelf. @@ -5311,49 +5159,21 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
    *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   Shelf response = libraryClient.mergeShelves(otherShelfName, name);
-   * }
-   * 
- * - * @param otherShelfName The name of the shelf we're removing books from and deleting. - * @param name The name of the shelf we're adding books to. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Shelf mergeShelves(ShelfName otherShelfName, ShelfName name) { - MergeShelvesRequest request = - MergeShelvesRequest.newBuilder() - .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) - .setName(name == null ? null : name.toString()) - .build(); - return mergeShelves(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Merges two shelves by adding all books from the shelf named - * `other_shelf_name` to shelf `name`, and deletes - * `other_shelf_name`. Returns the updated shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   Shelf response = libraryClient.mergeShelves(otherShelfName.toString(), name.toString());
+   *   Shelf response = libraryClient.mergeShelves(name, otherShelfName);
    * }
    * 
* - * @param otherShelfName The name of the shelf we're removing books from and deleting. * @param name The name of the shelf we're adding books to. + * @param otherShelfName The name of the shelf we're removing books from and deleting. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Shelf mergeShelves(String otherShelfName, String name) { + public final Shelf mergeShelves(ShelfName name, ShelfName otherShelfName) { MergeShelvesRequest request = MergeShelvesRequest.newBuilder() - .setOtherShelfName(otherShelfName) - .setName(name) + .setName(name == null ? null : name.toString()) + .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) .build(); return mergeShelves(request); } @@ -5416,47 +5236,21 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   Book book = Book.newBuilder().build();
    *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   Book response = libraryClient.createBook(book, name);
-   * }
-   * 
- * - * @param book The book to create. - * @param name The name of the shelf in which the book is created. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Book createBook(Book book, ShelfName name) { - CreateBookRequest request = - CreateBookRequest.newBuilder() - .setBook(book) - .setName(name == null ? null : name.toString()) - .build(); - return createBook(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   Book book = Book.newBuilder().build();
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   Book response = libraryClient.createBook(book, name.toString());
+   *   Book response = libraryClient.createBook(name, book);
    * }
    * 
* - * @param book The book to create. * @param name The name of the shelf in which the book is created. + * @param book The book to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book createBook(Book book, String name) { + public final Book createBook(ShelfName name, Book book) { CreateBookRequest request = CreateBookRequest.newBuilder() + .setName(name == null ? null : name.toString()) .setBook(book) - .setName(name) .build(); return createBook(request); } @@ -5515,71 +5309,33 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   List<Book> books = new ArrayList<>();
-   *   int edition = 0;
-   *   String publisher = "";
-   *   String seriesString = "foobar";
-   *   SeriesUuid seriesUuid = SeriesUuid.newBuilder()
-   *     .setSeriesString(seriesString)
-   *     .build();
    *   Shelf shelf = Shelf.newBuilder().build();
-   *   PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher, seriesUuid, shelf);
-   * }
-   * 
- * - * @param books The books to publish in the series. - * @param edition The edition of the series - * @param publisher The publisher of the series. - * @param seriesUuid Uniquely identifies the series to the publishing house. - * @param shelf The shelf in which the series is created. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PublishSeriesResponse publishSeries(List books, int edition, PublisherName publisher, SeriesUuid seriesUuid, Shelf shelf) { - PublishSeriesRequest request = - PublishSeriesRequest.newBuilder() - .addAllBooks(books) - .setEdition(edition) - .setPublisher(publisher == null ? null : publisher.toString()) - .setSeriesUuid(seriesUuid) - .setShelf(shelf) - .build(); - return publishSeries(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates a series of books. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   List<Book> books = new ArrayList<>();
    *   int edition = 0;
-   *   String publisher = "";
    *   String seriesString = "foobar";
    *   SeriesUuid seriesUuid = SeriesUuid.newBuilder()
    *     .setSeriesString(seriesString)
    *     .build();
-   *   Shelf shelf = Shelf.newBuilder().build();
-   *   PublishSeriesResponse response = libraryClient.publishSeries(books, edition, publisher.toString(), seriesUuid, shelf);
+   *   String publisher = "";
+   *   PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher);
    * }
    * 
* + * @param shelf The shelf in which the series is created. * @param books The books to publish in the series. * @param edition The edition of the series - * @param publisher The publisher of the series. * @param seriesUuid Uniquely identifies the series to the publishing house. - * @param shelf The shelf in which the series is created. + * @param publisher The publisher of the series. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final PublishSeriesResponse publishSeries(List books, int edition, String publisher, SeriesUuid seriesUuid, Shelf shelf) { + public final PublishSeriesResponse publishSeries(Shelf shelf, List books, int edition, SeriesUuid seriesUuid, PublisherName publisher) { PublishSeriesRequest request = PublishSeriesRequest.newBuilder() + .setShelf(shelf) .addAllBooks(books) .setEdition(edition) - .setPublisher(publisher) .setSeriesUuid(seriesUuid) - .setShelf(shelf) + .setPublisher(publisher == null ? null : publisher.toString()) .build(); return publishSeries(request); } @@ -5672,33 +5428,10 @@ public class LibraryClient implements BackgroundResource { *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.getBook(name.toString());
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Book getBook(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name) - .build(); - return getBook(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Book response = libraryClient.getBook(request);
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Book response = libraryClient.getBook(request);
    * }
    * 
* @@ -5737,23 +5470,23 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
    *   String filter = "book-filter-string";
-   *   String name = "";
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. * @param name The name of the shelf whose books we'd like to list. + * @param filter To test python built-in wrapping. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, PublisherName name) { + public final ListBooksPagedResponse listBooks(ArchiveName name, String filter) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setFilter(filter) .setName(name == null ? null : name.toString()) + .setFilter(filter) .build(); return listBooks(request); } @@ -5765,23 +5498,23 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
    *   String filter = "book-filter-string";
-   *   String name = "";
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *   for (Book element : libraryClient.listBooks(name.toString(), filter).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. * @param name The name of the shelf whose books we'd like to list. + * @param filter To test python built-in wrapping. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { + public final ListBooksPagedResponse listBooks(String name, String filter) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setFilter(filter) .setName(name) + .setFilter(filter) .build(); return listBooks(request); } @@ -5793,23 +5526,23 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. * @param name The name of the shelf whose books we'd like to list. + * @param filter To test python built-in wrapping. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, ProjectName name) { + public final ListBooksPagedResponse listBooks(ShelfName name, String filter) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setFilter(filter) .setName(name == null ? null : name.toString()) + .setFilter(filter) .build(); return listBooks(request); } @@ -5821,23 +5554,23 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *   for (Book element : libraryClient.listBooks(name.toString(), filter).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. * @param name The name of the shelf whose books we'd like to list. + * @param filter To test python built-in wrapping. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { + public final ListBooksPagedResponse listBooks(String name, String filter) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setFilter(filter) .setName(name) + .setFilter(filter) .build(); return listBooks(request); } @@ -5849,23 +5582,23 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
    *   String filter = "book-filter-string";
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. * @param name The name of the shelf whose books we'd like to list. + * @param filter To test python built-in wrapping. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, BookName name) { + public final ListBooksPagedResponse listBooks(ProjectName name, String filter) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setFilter(filter) .setName(name == null ? null : name.toString()) + .setFilter(filter) .build(); return listBooks(request); } @@ -5877,23 +5610,23 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
    *   String filter = "book-filter-string";
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *   for (Book element : libraryClient.listBooks(name.toString(), filter).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. * @param name The name of the shelf whose books we'd like to list. + * @param filter To test python built-in wrapping. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { + public final ListBooksPagedResponse listBooks(String name, String filter) { ListBooksRequest request = ListBooksRequest.newBuilder() - .setFilter(filter) .setName(name) + .setFilter(filter) .build(); return listBooks(request); } @@ -5905,25 +5638,24 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
    *   String filter = "book-filter-string";
-   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
+   *   ListBooksRequest request = ListBooksRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setFilter(filter)
+   *     .build();
+   *   for (Book element : libraryClient.listBooks(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, OrganizationName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); + public final ListBooksPagedResponse listBooks(ListBooksRequest request) { + return listBooksPagedCallable() + .call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -5933,25 +5665,22 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
    *   String filter = "book-filter-string";
-   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *   ListBooksRequest request = ListBooksRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setFilter(filter)
+   *     .build();
+   *   ApiFuture<ListBooksPagedResponse> future = libraryClient.listBooksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Book element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); + public final UnaryCallable listBooksPagedCallable() { + return stub.listBooksPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -5961,377 +5690,337 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
    *   String filter = "book-filter-string";
-   *   FolderName name = FolderName.of("[FOLDER]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
+   *   ListBooksRequest request = ListBooksRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setFilter(filter)
+   *     .build();
+   *   while (true) {
+   *     ListBooksResponse response = libraryClient.listBooksCallable().call(request);
+   *     for (Book element : response.getBooksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
    *   }
    * }
    * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, FolderName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); + public final UnaryCallable listBooksCallable() { + return stub.listBooksCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Deletes a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   FolderName name = FolderName.of("[FOLDER]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.deleteBook(name);
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param name The name of the book to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) + public final void deleteBook(BookName name) { + DeleteBookRequest request = + DeleteBookRequest.newBuilder() + .setName(name == null ? null : name.toString()) .build(); - return listBooks(request); + deleteBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Deletes a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   libraryClient.deleteBook(request);
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, ArchivedBookName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); + public final void deleteBook(DeleteBookRequest request) { + deleteBookCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Deletes a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = libraryClient.deleteBookCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); + public final UnaryCallable deleteBookCallable() { + return stub.deleteBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book book = Book.newBuilder().build();
+   *   Book response = libraryClient.updateBook(name, book);
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param name The name of the book to update. + * @param book The book to update with. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, ArchiveName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) + public final Book updateBook(BookName name, Book book) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() .setName(name == null ? null : name.toString()) + .setBook(book) .build(); - return listBooks(request); + return updateBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String optionalFoo = "";
+   *   Book book = Book.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build();
+   *   Book response = libraryClient.updateBook(name, optionalFoo, book, updateMask, physicalMask);
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param name The name of the book to update. + * @param optionalFoo An optional foo. + * @param book The book to update with. + * @param updateMask A field mask to apply, rendered as an HTTP parameter. + * @param physicalMask To test Python import clash resolution. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) + public final Book updateBook(BookName name, String optionalFoo, Book book, FieldMask updateMask, com.google.example.library.v1.FieldMask physicalMask) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setOptionalFoo(optionalFoo) + .setBook(book) + .setUpdateMask(updateMask) + .setPhysicalMask(physicalMask) .build(); - return listBooks(request); + return updateBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + * Book book = Book.newBuilder().build(); + * UpdateBookRequest request = UpdateBookRequest.newBuilder() + * .setName(name.toString()) + * .setBook(book) + * .build(); + * Book response = libraryClient.updateBook(request); + * } + *
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, ShelfName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); + public final Book updateBook(UpdateBookRequest request) { + return updateBookCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Updates a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book book = Book.newBuilder().build();
+   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setBook(book)
+   *     .build();
+   *   ApiFuture<Book> future = libraryClient.updateBookCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
    * }
    * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); + public final UnaryCallable updateBookCallable() { + return stub.updateBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Moves a book to another shelf, and returns the new book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   Book response = libraryClient.moveBook(name, otherShelfName);
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param name The name of the book to move. + * @param otherShelfName The name of the destination shelf. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, BillingAccountName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) + public final Book moveBook(BookName name, ShelfName otherShelfName) { + MoveBookRequest request = + MoveBookRequest.newBuilder() .setName(name == null ? null : name.toString()) + .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) .build(); - return listBooks(request); + return moveBook(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Moves a book to another shelf, and returns the new book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   MoveBookRequest request = MoveBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOtherShelfName(otherShelfName.toString())
+   *     .build();
+   *   Book response = libraryClient.moveBook(request);
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) - .build(); - return listBooks(request); + public final Book moveBook(MoveBookRequest request) { + return moveBookCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Moves a book to another shelf, and returns the new book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Book element : libraryClient.listBooks(filter, name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   MoveBookRequest request = MoveBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOtherShelfName(otherShelfName.toString())
+   *     .build();
+   *   ApiFuture<Book> future = libraryClient.moveBookCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
    * }
    * 
- * - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, LocationName name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name == null ? null : name.toString()) - .build(); - return listBooks(request); + public final UnaryCallable moveBookCallable() { + return stub.moveBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
+   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param name * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) - .setName(name) + public final ListStringsPagedResponse listStrings(ResourceName name) { + ListStringsRequest request = + ListStringsRequest.newBuilder() + .setName(name == null ? null : name.toString()) .build(); - return listBooks(request); + return listStrings(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String filter = "book-filter-string";
-   *   String name = "";
-   *   for (Book element : libraryClient.listBooks(filter, name.toString()).iterateAll()) {
+   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
+   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param filter To test python built-in wrapping. - * @param name The name of the shelf whose books we'd like to list. + * @param name * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListBooksPagedResponse listBooks(String filter, String name) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setFilter(filter) + public final ListStringsPagedResponse listStrings(String name) { + ListStringsRequest request = + ListStringsRequest.newBuilder() .setName(name) .build(); - return listBooks(request); + return listStrings(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String name = "";
-   *   String filter = "book-filter-string";
-   *   ListBooksRequest request = ListBooksRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setFilter(filter)
-   *     .build();
-   *   for (Book element : libraryClient.listBooks(request).iterateAll()) {
+   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
+   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -6340,52 +6029,42 @@ public class LibraryClient implements BackgroundResource {
    * @param request The request object containing all of the parameters for the API call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final ListBooksPagedResponse listBooks(ListBooksRequest request) {
-    return listBooksPagedCallable()
+  public final ListStringsPagedResponse listStrings(ListStringsRequest request) {
+    return listStringsPagedCallable()
         .call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Lists books in a shelf.
+   * Lists a primitive resource. To test go page streaming.
    *
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String name = "";
-   *   String filter = "book-filter-string";
-   *   ListBooksRequest request = ListBooksRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setFilter(filter)
-   *     .build();
-   *   ApiFuture<ListBooksPagedResponse> future = libraryClient.listBooksPagedCallable().futureCall(request);
+   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
+   *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
    *   // Do something
-   *   for (Book element : future.get().iterateAll()) {
+   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
*/ - public final UnaryCallable listBooksPagedCallable() { - return stub.listBooksPagedCallable(); + public final UnaryCallable listStringsPagedCallable() { + return stub.listStringsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists books in a shelf. + * Lists a primitive resource. To test go page streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String name = "";
-   *   String filter = "book-filter-string";
-   *   ListBooksRequest request = ListBooksRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setFilter(filter)
-   *     .build();
+   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    *   while (true) {
-   *     ListBooksResponse response = libraryClient.listBooksCallable().call(request);
-   *     for (Book element : response.getBooksList()) {
+   *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
+   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -6398,3491 +6077,2563 @@ public class LibraryClient implements BackgroundResource {
    * }
    * 
*/ - public final UnaryCallable listBooksCallable() { - return stub.listBooksCallable(); + public final UnaryCallable listStringsCallable() { + return stub.listStringsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a book. + * Adds comments to a book * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.deleteBook(name);
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
+   *     .build();
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   libraryClient.addComments(name, comments);
    * }
    * 
* - * @param name The name of the book to delete. + * @param name + * @param comments * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteBook(BookName name) { - DeleteBookRequest request = - DeleteBookRequest.newBuilder() + public final void addComments(BookName name, List comments) { + AddCommentsRequest request = + AddCommentsRequest.newBuilder() .setName(name == null ? null : name.toString()) + .addAllComments(comments) .build(); - deleteBook(request); + addComments(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a book. + * Adds comments to a book * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.deleteBook(name.toString());
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
+   *     .build();
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .addAllComments(comments)
+   *     .build();
+   *   libraryClient.addComments(request);
    * }
    * 
* - * @param name The name of the book to delete. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteBook(String name) { - DeleteBookRequest request = - DeleteBookRequest.newBuilder() - .setName(name) - .build(); - deleteBook(request); + public final void addComments(AddCommentsRequest request) { + addCommentsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a book. + * Adds comments to a book * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   libraryClient.deleteBook(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBook(DeleteBookRequest request) { - deleteBookCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
+   *     .build();
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
    *     .setName(name.toString())
+   *     .addAllComments(comments)
    *     .build();
-   *   ApiFuture<Void> future = libraryClient.deleteBookCallable().futureCall(request);
+   *   ApiFuture<Void> future = libraryClient.addCommentsCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ - public final UnaryCallable deleteBookCallable() { - return stub.deleteBookCallable(); + public final UnaryCallable addCommentsCallable() { + return stub.addCommentsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   Book book = Book.newBuilder().build();
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.updateBook(book, name);
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
    * }
    * 
* - * @param book The book to update with. - * @param name The name of the book to update. + * @param name The name of the book to retrieve. + * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(Book book, BookName name) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() - .setBook(book) + public final BookFromArchive getBookFromArchive(ArchivedBookName name, ProjectName parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() .setName(name == null ? null : name.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); - return updateBook(request); + return getBookFromArchive(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   Book book = Book.newBuilder().build();
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.updateBook(book, name.toString());
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setParent(parent.toString())
+   *     .build();
+   *   BookFromArchive response = libraryClient.getBookFromArchive(request);
    * }
    * 
* - * @param book The book to update with. - * @param name The name of the book to update. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(Book book, String name) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() - .setBook(book) - .setName(name) - .build(); - return updateBook(request); + public final BookFromArchive getBookFromArchive(GetBookFromArchiveRequest request) { + return getBookFromArchiveCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Gets a book from an archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String optionalFoo = "";
-   *   Book book = Book.newBuilder().build();
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   FieldMask physicalMask = FieldMask.newBuilder().build();
-   *   com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build();
-   *   Book response = libraryClient.updateBook(optionalFoo, book, name, physicalMask, updateMask);
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<BookFromArchive> future = libraryClient.getBookFromArchiveCallable().futureCall(request);
+   *   // Do something
+   *   BookFromArchive response = future.get();
    * }
    * 
- * - * @param optionalFoo An optional foo. - * @param book The book to update with. - * @param name The name of the book to update. - * @param physicalMask To test Python import clash resolution. - * @param updateMask A field mask to apply, rendered as an HTTP parameter. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(String optionalFoo, Book book, BookName name, FieldMask physicalMask, com.google.protobuf.FieldMask updateMask) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() - .setOptionalFoo(optionalFoo) - .setBook(book) - .setName(name == null ? null : name.toString()) - .setPhysicalMask(physicalMask) - .setUpdateMask(updateMask) - .build(); - return updateBook(request); + public final UnaryCallable getBookFromArchiveCallable() { + return stub.getBookFromArchiveCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Gets a book from a shelf or archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String optionalFoo = "";
-   *   Book book = Book.newBuilder().build();
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   FieldMask physicalMask = FieldMask.newBuilder().build();
-   *   com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build();
-   *   Book response = libraryClient.updateBook(optionalFoo, book, name.toString(), physicalMask, updateMask);
+   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(name, altBookName, place, folder);
    * }
    * 
* - * @param optionalFoo An optional foo. - * @param book The book to update with. - * @param name The name of the book to update. - * @param physicalMask To test Python import clash resolution. - * @param updateMask A field mask to apply, rendered as an HTTP parameter. + * @param name The name of the book to retrieve. + * @param altBookName An alternate book name, used to test restricting flattened field to a + * single resource name type in a oneof. + * @param place + * @param folder * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(String optionalFoo, Book book, String name, FieldMask physicalMask, com.google.protobuf.FieldMask updateMask) { - UpdateBookRequest request = - UpdateBookRequest.newBuilder() - .setOptionalFoo(optionalFoo) - .setBook(book) - .setName(name) - .setPhysicalMask(physicalMask) - .setUpdateMask(updateMask) + public final BookFromAnywhere getBookFromAnywhere(BookName name, BookName altBookName, LocationName place, FolderName folder) { + GetBookFromAnywhereRequest request = + GetBookFromAnywhereRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setAltBookName(altBookName == null ? null : altBookName.toString()) + .setPlace(place == null ? null : place.toString()) + .setFolder(folder == null ? null : folder.toString()) .build(); - return updateBook(request); + return getBookFromAnywhere(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Gets a book from a shelf or archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book book = Book.newBuilder().build();
-   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
+   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setBook(book)
+   *     .setAltBookName(altBookName.toString())
+   *     .setPlace(place.toString())
+   *     .setFolder(folder.toString())
    *     .build();
-   *   Book response = libraryClient.updateBook(request);
+   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(UpdateBookRequest request) { - return updateBookCallable().call(request); + public final BookFromAnywhere getBookFromAnywhere(GetBookFromAnywhereRequest request) { + return getBookFromAnywhereCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a book. + * Gets a book from a shelf or archive. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book book = Book.newBuilder().build();
-   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
+   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setBook(book)
+   *     .setAltBookName(altBookName.toString())
+   *     .setPlace(place.toString())
+   *     .setFolder(folder.toString())
    *     .build();
-   *   ApiFuture<Book> future = libraryClient.updateBookCallable().futureCall(request);
+   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAnywhereCallable().futureCall(request);
    *   // Do something
-   *   Book response = future.get();
+   *   BookFromAnywhere response = future.get();
    * }
    * 
*/ - public final UnaryCallable updateBookCallable() { - return stub.updateBookCallable(); + public final UnaryCallable getBookFromAnywhereCallable() { + return stub.getBookFromAnywhereCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Test proper OneOf-Any resource name mapping * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.moveBook(otherShelfName, name);
+   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name);
    * }
    * 
* - * @param otherShelfName The name of the destination shelf. - * @param name The name of the book to move. + * @param name The name of the book to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book moveBook(ShelfName otherShelfName, BookName name) { - MoveBookRequest request = - MoveBookRequest.newBuilder() - .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) + public final BookFromAnywhere getBookFromAbsolutelyAnywhere(BookName name) { + GetBookFromAbsolutelyAnywhereRequest request = + GetBookFromAbsolutelyAnywhereRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); - return moveBook(request); + return getBookFromAbsolutelyAnywhere(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Test proper OneOf-Any resource name mapping * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.moveBook(otherShelfName.toString(), name.toString());
+   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(request);
    * }
    * 
* - * @param otherShelfName The name of the destination shelf. - * @param name The name of the book to move. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book moveBook(String otherShelfName, String name) { - MoveBookRequest request = - MoveBookRequest.newBuilder() - .setOtherShelfName(otherShelfName) - .setName(name) - .build(); - return moveBook(request); + public final BookFromAnywhere getBookFromAbsolutelyAnywhere(GetBookFromAbsolutelyAnywhereRequest request) { + return getBookFromAbsolutelyAnywhereCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Test proper OneOf-Any resource name mapping * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   MoveBookRequest request = MoveBookRequest.newBuilder()
+   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setOtherShelfName(otherShelfName.toString())
    *     .build();
-   *   Book response = libraryClient.moveBook(request);
+   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAbsolutelyAnywhereCallable().futureCall(request);
+   *   // Do something
+   *   BookFromAnywhere response = future.get();
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book moveBook(MoveBookRequest request) { - return moveBookCallable().call(request); + public final UnaryCallable getBookFromAbsolutelyAnywhereCallable() { + return stub.getBookFromAbsolutelyAnywhereCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Moves a book to another shelf, and returns the new book. + * Updates the index of a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
-   *   MoveBookRequest request = MoveBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setOtherShelfName(otherShelfName.toString())
-   *     .build();
-   *   ApiFuture<Book> future = libraryClient.moveBookCallable().futureCall(request);
-   *   // Do something
-   *   Book response = future.get();
+   *   String indexName = "default index";
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   libraryClient.updateBookIndex(name, indexName, indexMap);
    * }
    * 
+ * + * @param name The name of the book to update. + * @param indexName The name of the index for the book + * @param indexMap The index to update the book with + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable moveBookCallable() { - return stub.moveBookCallable(); + public final void updateBookIndex(BookName name, String indexName, Map indexMap) { + UpdateBookIndexRequest request = + UpdateBookIndexRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setIndexName(indexName) + .putAllIndexMap(indexMap) + .build(); + updateBookIndex(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Updates the index of a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
-   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String indexName = "default index";
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setIndexName(indexName)
+   *     .putAllIndexMap(indexMap)
+   *     .build();
+   *   libraryClient.updateBookIndex(request);
    * }
    * 
* - * @param name + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings(ResourceName name) { - ListStringsRequest request = - ListStringsRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return listStrings(request); + public final void updateBookIndex(UpdateBookIndexRequest request) { + updateBookIndexCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Updates the index of a book. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
-   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
-   *     // doThingsWith(element);
-   *   }
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String indexName = "default index";
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setIndexName(indexName)
+   *     .putAllIndexMap(indexMap)
+   *     .build();
+   *   ApiFuture<Void> future = libraryClient.updateBookIndexCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings(String name) { - ListStringsRequest request = - ListStringsRequest.newBuilder() - .setName(name) - .build(); - return listStrings(request); + public final UnaryCallable updateBookIndexCallable() { + return stub.updateBookIndexCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Test server streaming + * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
-   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
-   *     // doThingsWith(element);
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   StreamShelvesRequest request = StreamShelvesRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *
+   *   ServerStream<StreamShelvesResponse> stream = libraryClient.streamShelvesCallable().call(request);
+   *   for (StreamShelvesResponse response : stream) {
+   *     // Do something when receive a response
    *   }
    * }
    * 
- * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings(String name) { - ListStringsRequest request = - ListStringsRequest.newBuilder() - .setName(name) - .build(); - return listStrings(request); + public final ServerStreamingCallable streamShelvesCallable() { + return stub.streamShelvesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Test server streaming, non-paged responses. + * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
-   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
-   *     // doThingsWith(element);
+   *   String name = "";
+   *   StreamBooksRequest request = StreamBooksRequest.newBuilder()
+   *     .setName(name)
+   *     .build();
+   *
+   *   ServerStream<Book> stream = libraryClient.streamBooksCallable().call(request);
+   *   for (Book response : stream) {
+   *     // Do something when receive a response
    *   }
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListStringsPagedResponse listStrings(ListStringsRequest request) { - return listStringsPagedCallable() - .call(request); + public final ServerStreamingCallable streamBooksCallable() { + return stub.streamBooksCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Test bidi-streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
-   *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
-   *     // doThingsWith(element);
+   *   BidiStream<DiscussBookRequest, Comment> bidiStream =
+   *       libraryClient.discussBookCallable().call();
+   *
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   bidiStream.send(request);
+   *   for (Comment response : bidiStream) {
+   *     // Do something when receive a response
    *   }
    * }
    * 
*/ - public final UnaryCallable listStringsPagedCallable() { - return stub.listStringsPagedCallable(); + public final BidiStreamingCallable discussBookCallable() { + return stub.discussBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists a primitive resource. To test go page streaming. + * Test client streaming. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
-   *   while (true) {
-   *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
-   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   ApiStreamObserver<Comment> responseObserver =
+   *       new ApiStreamObserver<Comment>() {
+   *         {@literal @}Override
+   *         public void onNext(Comment response) {
+   *           // Do something when receive a response
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onError(Throwable t) {
+   *           // Add error-handling
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onCompleted() {
+   *           // Do something when complete.
+   *         }
+   *       };
+   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
+   *       libraryClient.monologAboutBookCallable().clientStreamingCall(responseObserver);
+   *
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   requestObserver.onNext(request);
    * }
    * 
*/ - public final UnaryCallable listStringsCallable() { - return stub.listStringsCallable(); + public final ClientStreamingCallable monologAboutBookCallable() { + return stub.monologAboutBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * Test samplegen response handling when a client streaming method returns Empty. + * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   ApiStreamObserver<Void> responseObserver =
+   *       new ApiStreamObserver<Void>() {
+   *         {@literal @}Override
+   *         public void onNext(Void response) {
+   *           // Do something when receive a response
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onError(Throwable t) {
+   *           // Add error-handling
+   *         }
+   *
+   *         {@literal @}Override
+   *         public void onCompleted() {
+   *           // Do something when complete.
+   *         }
+   *       };
+   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
+   *       libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver);
+   *
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.addComments(comments, name);
+   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   requestObserver.onNext(request);
    * }
    * 
- * - * @param comments - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void addComments(List comments, BookName name) { - AddCommentsRequest request = - AddCommentsRequest.newBuilder() - .addAllComments(comments) - .setName(name == null ? null : name.toString()) - .build(); - addComments(request); + public final ClientStreamingCallable babbleAboutBookCallable() { + return stub.babbleAboutBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.addComments(comments, name.toString());
+   *   String namesElement = "";
+   *   List<String> names = Arrays.asList(namesElement);
+   *   List<String> formattedShelves = new ArrayList<>();
+   *   for (BookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsBookName()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param comments - * @param name + * @param names + * @param shelves * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void addComments(List comments, String name) { - AddCommentsRequest request = - AddCommentsRequest.newBuilder() - .addAllComments(comments) - .setName(name) + public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { + FindRelatedBooksRequest request = + FindRelatedBooksRequest.newBuilder() + .addAllNames(names) + .addAllShelves(shelves) .build(); - addComments(request); + return findRelatedBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
-   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .addAllComments(comments)
+   *   ArchiveName namesElement = ArchiveName.of("[ARCHIVE]");
+   *   List<ArchiveName> names = Arrays.asList(namesElement);
+   *   List<ShelfName> shelves = new ArrayList<>();
+   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
+   *     .addAllNames(ArchiveName.toStringList(names))
+   *     .addAllShelves(ShelfName.toStringList(shelves))
    *     .build();
-   *   libraryClient.addComments(request);
+   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void addComments(AddCommentsRequest request) { - addCommentsCallable().call(request); + public final FindRelatedBooksPagedResponse findRelatedBooks(FindRelatedBooksRequest request) { + return findRelatedBooksPagedCallable() + .call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds comments to a book + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   ByteString comment = ByteString.copyFromUtf8("");
-   *   Comment.Stage stage = Comment.Stage.UNSET;
-   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
-   *   Comment commentsElement = Comment.newBuilder()
-   *     .setComment(comment)
-   *     .setStage(stage)
-   *     .setAlignment(alignment)
-   *     .build();
-   *   List<Comment> comments = Arrays.asList(commentsElement);
-   *   AddCommentsRequest request = AddCommentsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .addAllComments(comments)
+   *   ArchiveName namesElement = ArchiveName.of("[ARCHIVE]");
+   *   List<ArchiveName> names = Arrays.asList(namesElement);
+   *   List<ShelfName> shelves = new ArrayList<>();
+   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
+   *     .addAllNames(ArchiveName.toStringList(names))
+   *     .addAllShelves(ShelfName.toStringList(shelves))
    *     .build();
-   *   ApiFuture<Void> future = libraryClient.addCommentsCallable().futureCall(request);
+   *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   for (BookName element : future.get().iterateAllAsBookName()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
*/ - public final UnaryCallable addCommentsCallable() { - return stub.addCommentsCallable(); + public final UnaryCallable findRelatedBooksPagedCallable() { + return stub.findRelatedBooksPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(parent, name);
+   *   ArchiveName namesElement = ArchiveName.of("[ARCHIVE]");
+   *   List<ArchiveName> names = Arrays.asList(namesElement);
+   *   List<ShelfName> shelves = new ArrayList<>();
+   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
+   *     .addAllNames(ArchiveName.toStringList(names))
+   *     .addAllShelves(ShelfName.toStringList(shelves))
+   *     .build();
+   *   while (true) {
+   *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
+   *     for (BookName element : BookName.parseList(response.getNamesList())) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
    * }
    * 
- * - * @param parent - * @param name The name of the book to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(LocationName parent, ArchivedBookName name) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setName(name == null ? null : name.toString()) - .build(); - return getBookFromArchive(request); + public final UnaryCallable findRelatedBooksCallable() { + return stub.findRelatedBooksCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Adds a label to the entity. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(parent.toString(), name.toString());
+   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String label = "";
+   *   AddLabelRequest request = AddLabelRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setLabel(label)
+   *     .build();
+   *   AddLabelResponse response = libraryClient.addLabel(request);
    * }
    * 
* - * @param parent - * @param name The name of the book to retrieve. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(String parent, String name) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setParent(parent) - .setName(name) - .build(); - return getBookFromArchive(request); + @Deprecated + /* package-private */ final AddLabelResponse addLabel(AddLabelRequest request) { + return addLabelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Adds a label to the entity. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   String parent = "";
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String label = "";
+   *   AddLabelRequest request = AddLabelRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setLabel(label)
+   *     .build();
+   *   ApiFuture<AddLabelResponse> future = libraryClient.addLabelCallable().futureCall(request);
+   *   // Do something
+   *   AddLabelResponse response = future.get();
    * }
    * 
- * - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, PublisherName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); + @Deprecated + /* package-private */ final UnaryCallable addLabelCallable() { + return stub.addLabelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Test long-running operations * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.getBigBookAsync(name).get();
    * }
    * 
* * @param name The name of the book to retrieve. - * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ProjectName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(BookName name) { + GetBookRequest request = + GetBookRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) .build(); - return getBookFromArchive(request); + return getBigBookAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Test long-running operations * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
    * }
    * 
* * @param name The name of the book to retrieve. - * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, BookName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) .build(); - return getBookFromArchive(request); + return getBigBookAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Test long-running operations * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Book response = libraryClient.getBigBookAsync(request).get();
    * }
    * 
* - * @param name The name of the book to retrieve. - * @param parent + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, OrganizationName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(GetBookRequest request) { + return getBigBookOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Test long-running operations * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   FolderName parent = FolderName.of("[FOLDER]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Book, GetBigBookMetadata> future = libraryClient.getBigBookOperationCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
    * }
    * 
- * - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, FolderName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable getBigBookOperationCallable() { + return stub.getBigBookOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Test long-running operations * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   GetBookRequest request = GetBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = libraryClient.getBigBookCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
    * }
    * 
- * - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchivedBookName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); + public final UnaryCallable getBigBookCallable() { + return stub.getBigBookCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Test long-running operations with empty return type. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ArchiveName parent = ArchiveName.of("[ARCHIVE]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.getBigNothingAsync(name).get();
    * }
    * 
* * @param name The name of the book to retrieve. - * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ArchiveName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigNothingAsync(BookName name) { + GetBookRequest request = + GetBookRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) .build(); - return getBookFromArchive(request); + return getBigNothingAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from an archive. + * Test long-running operations with empty return type. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   ShelfName parent = ShelfName.of("[SHELF_ID]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
+   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   libraryClient.getBigNothingAsync(name.toString()).get();
    * }
    * 
* * @param name The name of the book to retrieve. - * @param parent * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, ShelfName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from an archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
-   *   BookFromArchive response = libraryClient.getBookFromArchive(name, parent);
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromArchive getBookFromArchive(ArchivedBookName name, BillingAccountName parent) { - GetBookFromArchiveRequest request = - GetBookFromArchiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setParent(parent == null ? null : parent.toString()) - .build(); - return getBookFromArchive(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from an archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   String parent = "";
-   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setParent(parent.toString())
-   *     .build();
-   *   BookFromArchive response = libraryClient.getBookFromArchive(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromArchive getBookFromArchive(GetBookFromArchiveRequest request) { - return getBookFromArchiveCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from an archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   String parent = "";
-   *   GetBookFromArchiveRequest request = GetBookFromArchiveRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<BookFromArchive> future = libraryClient.getBookFromArchiveCallable().futureCall(request);
-   *   // Do something
-   *   BookFromArchive response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable getBookFromArchiveCallable() { - return stub.getBookFromArchiveCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from a shelf or archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(folder, name, place, altBookName);
-   * }
-   * 
- * - * @param folder - * @param name The name of the book to retrieve. - * @param place - * @param altBookName An alternate book name, used to test restricting flattened field to a - * single resource name type in a oneof. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromAnywhere getBookFromAnywhere(FolderName folder, BookName name, LocationName place, BookName altBookName) { - GetBookFromAnywhereRequest request = - GetBookFromAnywhereRequest.newBuilder() - .setFolder(folder == null ? null : folder.toString()) - .setName(name == null ? null : name.toString()) - .setPlace(place == null ? null : place.toString()) - .setAltBookName(altBookName == null ? null : altBookName.toString()) - .build(); - return getBookFromAnywhere(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets a book from a shelf or archive. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(folder.toString(), name.toString(), place.toString(), altBookName.toString());
-   * }
-   * 
- * - * @param folder - * @param name The name of the book to retrieve. - * @param place - * @param altBookName An alternate book name, used to test restricting flattened field to a - * single resource name type in a oneof. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromAnywhere getBookFromAnywhere(String folder, String name, String place, String altBookName) { - GetBookFromAnywhereRequest request = - GetBookFromAnywhereRequest.newBuilder() - .setFolder(folder) + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigNothingAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() .setName(name) - .setPlace(place) - .setAltBookName(altBookName) .build(); - return getBookFromAnywhere(request); + return getBigNothingAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from a shelf or archive. + * Test long-running operations with empty return type. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
+   *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setAltBookName(altBookName.toString())
-   *     .setPlace(place.toString())
-   *     .setFolder(folder.toString())
    *     .build();
-   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(request);
+   *   libraryClient.getBigNothingAsync(request).get();
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAnywhere(GetBookFromAnywhereRequest request) { - return getBookFromAnywhereCallable().call(request); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigNothingAsync(GetBookRequest request) { + return getBigNothingOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a book from a shelf or archive. + * Test long-running operations with empty return type. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   FolderName folder = FolderName.of("[FOLDER]");
-   *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
+   *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setAltBookName(altBookName.toString())
-   *     .setPlace(place.toString())
-   *     .setFolder(folder.toString())
    *     .build();
-   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAnywhereCallable().futureCall(request);
+   *   OperationFuture<Empty, GetBigBookMetadata> future = libraryClient.getBigNothingOperationCallable().futureCall(request);
    *   // Do something
-   *   BookFromAnywhere response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable getBookFromAnywhereCallable() { - return stub.getBookFromAnywhereCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test proper OneOf-Any resource name mapping - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name);
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromAnywhere getBookFromAbsolutelyAnywhere(BookName name) { - GetBookFromAbsolutelyAnywhereRequest request = - GetBookFromAbsolutelyAnywhereRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return getBookFromAbsolutelyAnywhere(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test proper OneOf-Any resource name mapping - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name.toString());
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final BookFromAnywhere getBookFromAbsolutelyAnywhere(String name) { - GetBookFromAbsolutelyAnywhereRequest request = - GetBookFromAbsolutelyAnywhereRequest.newBuilder() - .setName(name) - .build(); - return getBookFromAbsolutelyAnywhere(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test proper OneOf-Any resource name mapping - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(request);
+   *   future.get();
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final BookFromAnywhere getBookFromAbsolutelyAnywhere(GetBookFromAbsolutelyAnywhereRequest request) { - return getBookFromAbsolutelyAnywhereCallable().call(request); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable getBigNothingOperationCallable() { + return stub.getBigNothingOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test proper OneOf-Any resource name mapping + * Test long-running operations with empty return type. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
    *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
+   *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<BookFromAnywhere> future = libraryClient.getBookFromAbsolutelyAnywhereCallable().futureCall(request);
+   *   ApiFuture<Operation> future = libraryClient.getBigNothingCallable().futureCall(request);
    *   // Do something
-   *   BookFromAnywhere response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable getBookFromAbsolutelyAnywhereCallable() { - return stub.getBookFromAbsolutelyAnywhereCallable(); + public final UnaryCallable getBigNothingCallable() { + return stub.getBigNothingCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates the index of a book. + * Test optional flattening parameters of all types * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   String indexName = "default index";
-   *   libraryClient.updateBookIndex(name, indexMap, indexName);
+   *   int requiredSingularInt32 = 0;
+   *   long requiredSingularInt64 = 0L;
+   *   float requiredSingularFloat = 0.0F;
+   *   double requiredSingularDouble = 0.0;
+   *   boolean requiredSingularBool = false;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   String requiredSingularString = "";
+   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String requiredSingularResourceNameCommon = "";
+   *   int requiredSingularFixed32 = 0;
+   *   long requiredSingularFixed64 = 0L;
+   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
+   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
+   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
+   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
+   *   List<String> requiredRepeatedString = new ArrayList<>();
+   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
+   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
+   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
+   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
+   *   Map<Integer, String> requiredMap = new HashMap<>();
+   *   Any requiredAnyValue = Any.newBuilder().build();
+   *   Struct requiredStructValue = Struct.newBuilder().build();
+   *   Value requiredValueValue = Value.newBuilder().build();
+   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
+   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
+   *   Duration requiredDurationValue = Duration.newBuilder().build();
+   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
+   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
+   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
+   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
+   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
+   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
+   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
+   *   StringValue requiredStringValue = StringValue.newBuilder().build();
+   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
+   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
+   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
+   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
+   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
+   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
+   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
+   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
+   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
+   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
+   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
+   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
+   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
+   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
+   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
+   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
+   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
+   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
+   *   int optionalSingularInt32 = 0;
+   *   long optionalSingularInt64 = 0L;
+   *   float optionalSingularFloat = 0.0F;
+   *   double optionalSingularDouble = 0.0;
+   *   boolean optionalSingularBool = false;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   String optionalSingularString = "";
+   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String optionalSingularResourceNameCommon = "";
+   *   int optionalSingularFixed32 = 0;
+   *   long optionalSingularFixed64 = 0L;
+   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
+   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
+   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
+   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
+   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
+   *   List<String> optionalRepeatedString = new ArrayList<>();
+   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
+   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
+   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
+   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
+   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
+   *   Map<Integer, String> optionalMap = new HashMap<>();
+   *   Any anyValue = Any.newBuilder().build();
+   *   Struct structValue = Struct.newBuilder().build();
+   *   Value valueValue = Value.newBuilder().build();
+   *   ListValue listValueValue = ListValue.newBuilder().build();
+   *   Timestamp timeValue = Timestamp.newBuilder().build();
+   *   Duration durationValue = Duration.newBuilder().build();
+   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
+   *   Int32Value int32Value = Int32Value.newBuilder().build();
+   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
+   *   Int64Value int64Value = Int64Value.newBuilder().build();
+   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
+   *   FloatValue floatValue = FloatValue.newBuilder().build();
+   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
+   *   StringValue stringValue = StringValue.newBuilder().build();
+   *   BoolValue boolValue = BoolValue.newBuilder().build();
+   *   BytesValue bytesValue = BytesValue.newBuilder().build();
+   *   List<Any> repeatedAnyValue = new ArrayList<>();
+   *   List<Struct> repeatedStructValue = new ArrayList<>();
+   *   List<Value> repeatedValueValue = new ArrayList<>();
+   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
+   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
+   *   List<Duration> repeatedDurationValue = new ArrayList<>();
+   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
+   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
+   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
+   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
+   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
+   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
+   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
+   *   List<StringValue> repeatedStringValue = new ArrayList<>();
+   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
+   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    * }
    * 
* - * @param name The name of the book to update. - * @param indexMap The index to update the book with - * @param indexName The name of the index for the book + * @param requiredSingularInt32 + * @param requiredSingularInt64 + * @param requiredSingularFloat + * @param requiredSingularDouble + * @param requiredSingularBool + * @param requiredSingularEnum + * @param requiredSingularString + * @param requiredSingularBytes + * @param requiredSingularMessage + * @param requiredSingularResourceName + * @param requiredSingularResourceNameOneof + * @param requiredSingularResourceNameCommon + * @param requiredSingularFixed32 + * @param requiredSingularFixed64 + * @param requiredRepeatedInt32 + * @param requiredRepeatedInt64 + * @param requiredRepeatedFloat + * @param requiredRepeatedDouble + * @param requiredRepeatedBool + * @param requiredRepeatedEnum + * @param requiredRepeatedString + * @param requiredRepeatedBytes + * @param requiredRepeatedMessage + * @param requiredRepeatedResourceName + * @param requiredRepeatedResourceNameOneof + * @param requiredRepeatedResourceNameCommon + * @param requiredRepeatedFixed32 + * @param requiredRepeatedFixed64 + * @param requiredMap + * @param requiredAnyValue + * @param requiredStructValue + * @param requiredValueValue + * @param requiredListValueValue + * @param requiredTimeValue + * @param requiredDurationValue + * @param requiredFieldMaskValue + * @param requiredInt32Value + * @param requiredUint32Value + * @param requiredInt64Value + * @param requiredUint64Value + * @param requiredFloatValue + * @param requiredDoubleValue + * @param requiredStringValue + * @param requiredBoolValue + * @param requiredBytesValue + * @param requiredRepeatedAnyValue + * @param requiredRepeatedStructValue + * @param requiredRepeatedValueValue + * @param requiredRepeatedListValueValue + * @param requiredRepeatedTimeValue + * @param requiredRepeatedDurationValue + * @param requiredRepeatedFieldMaskValue + * @param requiredRepeatedInt32Value + * @param requiredRepeatedUint32Value + * @param requiredRepeatedInt64Value + * @param requiredRepeatedUint64Value + * @param requiredRepeatedFloatValue + * @param requiredRepeatedDoubleValue + * @param requiredRepeatedStringValue + * @param requiredRepeatedBoolValue + * @param requiredRepeatedBytesValue + * @param optionalSingularInt32 + * @param optionalSingularInt64 + * @param optionalSingularFloat + * @param optionalSingularDouble + * @param optionalSingularBool + * @param optionalSingularEnum + * @param optionalSingularString + * @param optionalSingularBytes + * @param optionalSingularMessage + * @param optionalSingularResourceName + * @param optionalSingularResourceNameOneof + * @param optionalSingularResourceNameCommon + * @param optionalSingularFixed32 + * @param optionalSingularFixed64 + * @param optionalRepeatedInt32 + * @param optionalRepeatedInt64 + * @param optionalRepeatedFloat + * @param optionalRepeatedDouble + * @param optionalRepeatedBool + * @param optionalRepeatedEnum + * @param optionalRepeatedString + * @param optionalRepeatedBytes + * @param optionalRepeatedMessage + * @param optionalRepeatedResourceName + * @param optionalRepeatedResourceNameOneof + * @param optionalRepeatedResourceNameCommon + * @param optionalRepeatedFixed32 + * @param optionalRepeatedFixed64 + * @param optionalMap + * @param anyValue + * @param structValue + * @param valueValue + * @param listValueValue + * @param timeValue + * @param durationValue + * @param fieldMaskValue + * @param int32Value + * @param uint32Value + * @param int64Value + * @param uint64Value + * @param floatValue + * @param doubleValue + * @param stringValue + * @param boolValue + * @param bytesValue + * @param repeatedAnyValue + * @param repeatedStructValue + * @param repeatedValueValue + * @param repeatedListValueValue + * @param repeatedTimeValue + * @param repeatedDurationValue + * @param repeatedFieldMaskValue + * @param repeatedInt32Value + * @param repeatedUint32Value + * @param repeatedInt64Value + * @param repeatedUint64Value + * @param repeatedFloatValue + * @param repeatedDoubleValue + * @param repeatedStringValue + * @param repeatedBoolValue + * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void updateBookIndex(BookName name, Map indexMap, String indexName) { - UpdateBookIndexRequest request = - UpdateBookIndexRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .putAllIndexMap(indexMap) - .setIndexName(indexName) - .build(); - updateBookIndex(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates the index of a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   String indexName = "default index";
-   *   libraryClient.updateBookIndex(name.toString(), indexMap, indexName);
-   * }
-   * 
- * - * @param name The name of the book to update. - * @param indexMap The index to update the book with - * @param indexName The name of the index for the book - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void updateBookIndex(String name, Map indexMap, String indexName) { - UpdateBookIndexRequest request = - UpdateBookIndexRequest.newBuilder() - .setName(name) - .putAllIndexMap(indexMap) - .setIndexName(indexName) + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, BookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, BookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + TestOptionalRequiredFlatteningParamsRequest request = + TestOptionalRequiredFlatteningParamsRequest.newBuilder() + .setRequiredSingularInt32(requiredSingularInt32) + .setRequiredSingularInt64(requiredSingularInt64) + .setRequiredSingularFloat(requiredSingularFloat) + .setRequiredSingularDouble(requiredSingularDouble) + .setRequiredSingularBool(requiredSingularBool) + .setRequiredSingularEnum(requiredSingularEnum) + .setRequiredSingularString(requiredSingularString) + .setRequiredSingularBytes(requiredSingularBytes) + .setRequiredSingularMessage(requiredSingularMessage) + .setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof == null ? null : requiredSingularResourceNameOneof.toString()) + .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) + .setRequiredSingularFixed32(requiredSingularFixed32) + .setRequiredSingularFixed64(requiredSingularFixed64) + .addAllRequiredRepeatedInt32(requiredRepeatedInt32) + .addAllRequiredRepeatedInt64(requiredRepeatedInt64) + .addAllRequiredRepeatedFloat(requiredRepeatedFloat) + .addAllRequiredRepeatedDouble(requiredRepeatedDouble) + .addAllRequiredRepeatedBool(requiredRepeatedBool) + .addAllRequiredRepeatedEnum(requiredRepeatedEnum) + .addAllRequiredRepeatedString(requiredRepeatedString) + .addAllRequiredRepeatedBytes(requiredRepeatedBytes) + .addAllRequiredRepeatedMessage(requiredRepeatedMessage) + .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : BookName.toStringList(requiredRepeatedResourceName)) + .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof)) + .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) + .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) + .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) + .putAllRequiredMap(requiredMap) + .setRequiredAnyValue(requiredAnyValue) + .setRequiredStructValue(requiredStructValue) + .setRequiredValueValue(requiredValueValue) + .setRequiredListValueValue(requiredListValueValue) + .setRequiredTimeValue(requiredTimeValue) + .setRequiredDurationValue(requiredDurationValue) + .setRequiredFieldMaskValue(requiredFieldMaskValue) + .setRequiredInt32Value(requiredInt32Value) + .setRequiredUint32Value(requiredUint32Value) + .setRequiredInt64Value(requiredInt64Value) + .setRequiredUint64Value(requiredUint64Value) + .setRequiredFloatValue(requiredFloatValue) + .setRequiredDoubleValue(requiredDoubleValue) + .setRequiredStringValue(requiredStringValue) + .setRequiredBoolValue(requiredBoolValue) + .setRequiredBytesValue(requiredBytesValue) + .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) + .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) + .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) + .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) + .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) + .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) + .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) + .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) + .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) + .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) + .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) + .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) + .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) + .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) + .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) + .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) + .setOptionalSingularInt32(optionalSingularInt32) + .setOptionalSingularInt64(optionalSingularInt64) + .setOptionalSingularFloat(optionalSingularFloat) + .setOptionalSingularDouble(optionalSingularDouble) + .setOptionalSingularBool(optionalSingularBool) + .setOptionalSingularEnum(optionalSingularEnum) + .setOptionalSingularString(optionalSingularString) + .setOptionalSingularBytes(optionalSingularBytes) + .setOptionalSingularMessage(optionalSingularMessage) + .setOptionalSingularResourceName(optionalSingularResourceName == null ? null : optionalSingularResourceName.toString()) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof == null ? null : optionalSingularResourceNameOneof.toString()) + .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) + .setOptionalSingularFixed32(optionalSingularFixed32) + .setOptionalSingularFixed64(optionalSingularFixed64) + .addAllOptionalRepeatedInt32(optionalRepeatedInt32) + .addAllOptionalRepeatedInt64(optionalRepeatedInt64) + .addAllOptionalRepeatedFloat(optionalRepeatedFloat) + .addAllOptionalRepeatedDouble(optionalRepeatedDouble) + .addAllOptionalRepeatedBool(optionalRepeatedBool) + .addAllOptionalRepeatedEnum(optionalRepeatedEnum) + .addAllOptionalRepeatedString(optionalRepeatedString) + .addAllOptionalRepeatedBytes(optionalRepeatedBytes) + .addAllOptionalRepeatedMessage(optionalRepeatedMessage) + .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : BookName.toStringList(optionalRepeatedResourceName)) + .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof)) + .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) + .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) + .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) + .putAllOptionalMap(optionalMap) + .setAnyValue(anyValue) + .setStructValue(structValue) + .setValueValue(valueValue) + .setListValueValue(listValueValue) + .setTimeValue(timeValue) + .setDurationValue(durationValue) + .setFieldMaskValue(fieldMaskValue) + .setInt32Value(int32Value) + .setUint32Value(uint32Value) + .setInt64Value(int64Value) + .setUint64Value(uint64Value) + .setFloatValue(floatValue) + .setDoubleValue(doubleValue) + .setStringValue(stringValue) + .setBoolValue(boolValue) + .setBytesValue(bytesValue) + .addAllRepeatedAnyValue(repeatedAnyValue) + .addAllRepeatedStructValue(repeatedStructValue) + .addAllRepeatedValueValue(repeatedValueValue) + .addAllRepeatedListValueValue(repeatedListValueValue) + .addAllRepeatedTimeValue(repeatedTimeValue) + .addAllRepeatedDurationValue(repeatedDurationValue) + .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) + .addAllRepeatedInt32Value(repeatedInt32Value) + .addAllRepeatedUint32Value(repeatedUint32Value) + .addAllRepeatedInt64Value(repeatedInt64Value) + .addAllRepeatedUint64Value(repeatedUint64Value) + .addAllRepeatedFloatValue(repeatedFloatValue) + .addAllRepeatedDoubleValue(repeatedDoubleValue) + .addAllRepeatedStringValue(repeatedStringValue) + .addAllRepeatedBoolValue(repeatedBoolValue) + .addAllRepeatedBytesValue(repeatedBytesValue) .build(); - updateBookIndex(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates the index of a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String indexName = "default index";
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setIndexName(indexName)
-   *     .putAllIndexMap(indexMap)
-   *     .build();
-   *   libraryClient.updateBookIndex(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void updateBookIndex(UpdateBookIndexRequest request) { - updateBookIndexCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates the index of a book. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String indexName = "default index";
-   *   String indexMapItem = "";
-   *   Map<String, String> indexMap = new HashMap<>();
-   *   indexMap.put("default_key", indexMapItem);
-   *   UpdateBookIndexRequest request = UpdateBookIndexRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setIndexName(indexName)
-   *     .putAllIndexMap(indexMap)
-   *     .build();
-   *   ApiFuture<Void> future = libraryClient.updateBookIndexCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable updateBookIndexCallable() { - return stub.updateBookIndexCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test server streaming - * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   StreamShelvesRequest request = StreamShelvesRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *
-   *   ServerStream<StreamShelvesResponse> stream = libraryClient.streamShelvesCallable().call(request);
-   *   for (StreamShelvesResponse response : stream) {
-   *     // Do something when receive a response
-   *   }
-   * }
-   * 
- */ - public final ServerStreamingCallable streamShelvesCallable() { - return stub.streamShelvesCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test server streaming, non-paged responses. - * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String name = "";
-   *   StreamBooksRequest request = StreamBooksRequest.newBuilder()
-   *     .setName(name)
-   *     .build();
-   *
-   *   ServerStream<Book> stream = libraryClient.streamBooksCallable().call(request);
-   *   for (Book response : stream) {
-   *     // Do something when receive a response
-   *   }
-   * }
-   * 
- */ - public final ServerStreamingCallable streamBooksCallable() { - return stub.streamBooksCallable(); + return testOptionalRequiredFlatteningParams(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test bidi-streaming. + * Test optional flattening parameters of all types * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BidiStream<DiscussBookRequest, Comment> bidiStream =
-   *       libraryClient.discussBookCallable().call();
-   *
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   bidiStream.send(request);
-   *   for (Comment response : bidiStream) {
-   *     // Do something when receive a response
-   *   }
-   * }
-   * 
- */ - public final BidiStreamingCallable discussBookCallable() { - return stub.discussBookCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test client streaming. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ApiStreamObserver<Comment> responseObserver =
-   *       new ApiStreamObserver<Comment>() {
-   *         {@literal @}Override
-   *         public void onNext(Comment response) {
-   *           // Do something when receive a response
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onError(Throwable t) {
-   *           // Add error-handling
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onCompleted() {
-   *           // Do something when complete.
-   *         }
-   *       };
-   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
-   *       libraryClient.monologAboutBookCallable().clientStreamingCall(responseObserver);
-   *
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   requestObserver.onNext(request);
-   * }
-   * 
- */ - public final ClientStreamingCallable monologAboutBookCallable() { - return stub.monologAboutBookCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test samplegen response handling when a client streaming method returns Empty. - * gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ApiStreamObserver<Void> responseObserver =
-   *       new ApiStreamObserver<Void>() {
-   *         {@literal @}Override
-   *         public void onNext(Void response) {
-   *           // Do something when receive a response
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onError(Throwable t) {
-   *           // Add error-handling
-   *         }
-   *
-   *         {@literal @}Override
-   *         public void onCompleted() {
-   *           // Do something when complete.
-   *         }
-   *       };
-   *   ApiStreamObserver<DiscussBookRequest> requestObserver =
-   *       libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver);
-   *
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   requestObserver.onNext(request);
-   * }
-   * 
- */ - public final ClientStreamingCallable babbleAboutBookCallable() { - return stub.babbleAboutBookCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String namesElement = "";
-   *   List<String> names = Arrays.asList(namesElement);
-   *   List<String> formattedShelves = new ArrayList<>();
-   *   for (BookName element : libraryClient.findRelatedBooks(names, formattedShelves).iterateAllAsBookName()) {
-   *     // doThingsWith(element);
-   *   }
+   *   int requiredSingularInt32 = 0;
+   *   long requiredSingularInt64 = 0L;
+   *   float requiredSingularFloat = 0.0F;
+   *   double requiredSingularDouble = 0.0;
+   *   boolean requiredSingularBool = false;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   String requiredSingularString = "";
+   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String requiredSingularResourceNameCommon = "";
+   *   int requiredSingularFixed32 = 0;
+   *   long requiredSingularFixed64 = 0L;
+   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
+   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
+   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
+   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
+   *   List<String> requiredRepeatedString = new ArrayList<>();
+   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
+   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
+   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
+   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
+   *   Map<Integer, String> requiredMap = new HashMap<>();
+   *   Any requiredAnyValue = Any.newBuilder().build();
+   *   Struct requiredStructValue = Struct.newBuilder().build();
+   *   Value requiredValueValue = Value.newBuilder().build();
+   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
+   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
+   *   Duration requiredDurationValue = Duration.newBuilder().build();
+   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
+   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
+   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
+   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
+   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
+   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
+   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
+   *   StringValue requiredStringValue = StringValue.newBuilder().build();
+   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
+   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
+   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
+   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
+   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
+   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
+   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
+   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
+   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
+   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
+   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
+   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
+   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
+   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
+   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
+   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
+   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
+   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
+   *   int optionalSingularInt32 = 0;
+   *   long optionalSingularInt64 = 0L;
+   *   float optionalSingularFloat = 0.0F;
+   *   double optionalSingularDouble = 0.0;
+   *   boolean optionalSingularBool = false;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   String optionalSingularString = "";
+   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String optionalSingularResourceNameCommon = "";
+   *   int optionalSingularFixed32 = 0;
+   *   long optionalSingularFixed64 = 0L;
+   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
+   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
+   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
+   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
+   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
+   *   List<String> optionalRepeatedString = new ArrayList<>();
+   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
+   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
+   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
+   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
+   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
+   *   Map<Integer, String> optionalMap = new HashMap<>();
+   *   Any anyValue = Any.newBuilder().build();
+   *   Struct structValue = Struct.newBuilder().build();
+   *   Value valueValue = Value.newBuilder().build();
+   *   ListValue listValueValue = ListValue.newBuilder().build();
+   *   Timestamp timeValue = Timestamp.newBuilder().build();
+   *   Duration durationValue = Duration.newBuilder().build();
+   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
+   *   Int32Value int32Value = Int32Value.newBuilder().build();
+   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
+   *   Int64Value int64Value = Int64Value.newBuilder().build();
+   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
+   *   FloatValue floatValue = FloatValue.newBuilder().build();
+   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
+   *   StringValue stringValue = StringValue.newBuilder().build();
+   *   BoolValue boolValue = BoolValue.newBuilder().build();
+   *   BytesValue bytesValue = BytesValue.newBuilder().build();
+   *   List<Any> repeatedAnyValue = new ArrayList<>();
+   *   List<Struct> repeatedStructValue = new ArrayList<>();
+   *   List<Value> repeatedValueValue = new ArrayList<>();
+   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
+   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
+   *   List<Duration> repeatedDurationValue = new ArrayList<>();
+   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
+   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
+   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
+   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
+   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
+   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
+   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
+   *   List<StringValue> repeatedStringValue = new ArrayList<>();
+   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
+   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    * }
    * 
* - * @param names - * @param shelves - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { - FindRelatedBooksRequest request = - FindRelatedBooksRequest.newBuilder() - .addAllNames(names) - .addAllShelves(shelves) - .build(); - return findRelatedBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String namesElement = "";
-   *   List<String> names = Arrays.asList(namesElement);
-   *   List<String> formattedShelves = new ArrayList<>();
-   *   for (BookName element : libraryClient.findRelatedBooks(names, formattedShelves).iterateAllAsBookName()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param names - * @param shelves + * @param requiredSingularInt32 + * @param requiredSingularInt64 + * @param requiredSingularFloat + * @param requiredSingularDouble + * @param requiredSingularBool + * @param requiredSingularEnum + * @param requiredSingularString + * @param requiredSingularBytes + * @param requiredSingularMessage + * @param requiredSingularResourceName + * @param requiredSingularResourceNameOneof + * @param requiredSingularResourceNameCommon + * @param requiredSingularFixed32 + * @param requiredSingularFixed64 + * @param requiredRepeatedInt32 + * @param requiredRepeatedInt64 + * @param requiredRepeatedFloat + * @param requiredRepeatedDouble + * @param requiredRepeatedBool + * @param requiredRepeatedEnum + * @param requiredRepeatedString + * @param requiredRepeatedBytes + * @param requiredRepeatedMessage + * @param requiredRepeatedResourceName + * @param requiredRepeatedResourceNameOneof + * @param requiredRepeatedResourceNameCommon + * @param requiredRepeatedFixed32 + * @param requiredRepeatedFixed64 + * @param requiredMap + * @param requiredAnyValue + * @param requiredStructValue + * @param requiredValueValue + * @param requiredListValueValue + * @param requiredTimeValue + * @param requiredDurationValue + * @param requiredFieldMaskValue + * @param requiredInt32Value + * @param requiredUint32Value + * @param requiredInt64Value + * @param requiredUint64Value + * @param requiredFloatValue + * @param requiredDoubleValue + * @param requiredStringValue + * @param requiredBoolValue + * @param requiredBytesValue + * @param requiredRepeatedAnyValue + * @param requiredRepeatedStructValue + * @param requiredRepeatedValueValue + * @param requiredRepeatedListValueValue + * @param requiredRepeatedTimeValue + * @param requiredRepeatedDurationValue + * @param requiredRepeatedFieldMaskValue + * @param requiredRepeatedInt32Value + * @param requiredRepeatedUint32Value + * @param requiredRepeatedInt64Value + * @param requiredRepeatedUint64Value + * @param requiredRepeatedFloatValue + * @param requiredRepeatedDoubleValue + * @param requiredRepeatedStringValue + * @param requiredRepeatedBoolValue + * @param requiredRepeatedBytesValue + * @param optionalSingularInt32 + * @param optionalSingularInt64 + * @param optionalSingularFloat + * @param optionalSingularDouble + * @param optionalSingularBool + * @param optionalSingularEnum + * @param optionalSingularString + * @param optionalSingularBytes + * @param optionalSingularMessage + * @param optionalSingularResourceName + * @param optionalSingularResourceNameOneof + * @param optionalSingularResourceNameCommon + * @param optionalSingularFixed32 + * @param optionalSingularFixed64 + * @param optionalRepeatedInt32 + * @param optionalRepeatedInt64 + * @param optionalRepeatedFloat + * @param optionalRepeatedDouble + * @param optionalRepeatedBool + * @param optionalRepeatedEnum + * @param optionalRepeatedString + * @param optionalRepeatedBytes + * @param optionalRepeatedMessage + * @param optionalRepeatedResourceName + * @param optionalRepeatedResourceNameOneof + * @param optionalRepeatedResourceNameCommon + * @param optionalRepeatedFixed32 + * @param optionalRepeatedFixed64 + * @param optionalMap + * @param anyValue + * @param structValue + * @param valueValue + * @param listValueValue + * @param timeValue + * @param durationValue + * @param fieldMaskValue + * @param int32Value + * @param uint32Value + * @param int64Value + * @param uint64Value + * @param floatValue + * @param doubleValue + * @param stringValue + * @param boolValue + * @param bytesValue + * @param repeatedAnyValue + * @param repeatedStructValue + * @param repeatedValueValue + * @param repeatedListValueValue + * @param repeatedTimeValue + * @param repeatedDurationValue + * @param repeatedFieldMaskValue + * @param repeatedInt32Value + * @param repeatedUint32Value + * @param repeatedInt64Value + * @param repeatedUint64Value + * @param repeatedFloatValue + * @param repeatedDoubleValue + * @param repeatedStringValue + * @param repeatedBoolValue + * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { - FindRelatedBooksRequest request = - FindRelatedBooksRequest.newBuilder() - .addAllNames(names) - .addAllShelves(shelves) + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, String requiredSingularResourceName, String requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String optionalSingularResourceName, String optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + TestOptionalRequiredFlatteningParamsRequest request = + TestOptionalRequiredFlatteningParamsRequest.newBuilder() + .setRequiredSingularInt32(requiredSingularInt32) + .setRequiredSingularInt64(requiredSingularInt64) + .setRequiredSingularFloat(requiredSingularFloat) + .setRequiredSingularDouble(requiredSingularDouble) + .setRequiredSingularBool(requiredSingularBool) + .setRequiredSingularEnum(requiredSingularEnum) + .setRequiredSingularString(requiredSingularString) + .setRequiredSingularBytes(requiredSingularBytes) + .setRequiredSingularMessage(requiredSingularMessage) + .setRequiredSingularResourceName(requiredSingularResourceName) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) + .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) + .setRequiredSingularFixed32(requiredSingularFixed32) + .setRequiredSingularFixed64(requiredSingularFixed64) + .addAllRequiredRepeatedInt32(requiredRepeatedInt32) + .addAllRequiredRepeatedInt64(requiredRepeatedInt64) + .addAllRequiredRepeatedFloat(requiredRepeatedFloat) + .addAllRequiredRepeatedDouble(requiredRepeatedDouble) + .addAllRequiredRepeatedBool(requiredRepeatedBool) + .addAllRequiredRepeatedEnum(requiredRepeatedEnum) + .addAllRequiredRepeatedString(requiredRepeatedString) + .addAllRequiredRepeatedBytes(requiredRepeatedBytes) + .addAllRequiredRepeatedMessage(requiredRepeatedMessage) + .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName) + .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof) + .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) + .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) + .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) + .putAllRequiredMap(requiredMap) + .setRequiredAnyValue(requiredAnyValue) + .setRequiredStructValue(requiredStructValue) + .setRequiredValueValue(requiredValueValue) + .setRequiredListValueValue(requiredListValueValue) + .setRequiredTimeValue(requiredTimeValue) + .setRequiredDurationValue(requiredDurationValue) + .setRequiredFieldMaskValue(requiredFieldMaskValue) + .setRequiredInt32Value(requiredInt32Value) + .setRequiredUint32Value(requiredUint32Value) + .setRequiredInt64Value(requiredInt64Value) + .setRequiredUint64Value(requiredUint64Value) + .setRequiredFloatValue(requiredFloatValue) + .setRequiredDoubleValue(requiredDoubleValue) + .setRequiredStringValue(requiredStringValue) + .setRequiredBoolValue(requiredBoolValue) + .setRequiredBytesValue(requiredBytesValue) + .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) + .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) + .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) + .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) + .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) + .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) + .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) + .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) + .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) + .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) + .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) + .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) + .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) + .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) + .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) + .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) + .setOptionalSingularInt32(optionalSingularInt32) + .setOptionalSingularInt64(optionalSingularInt64) + .setOptionalSingularFloat(optionalSingularFloat) + .setOptionalSingularDouble(optionalSingularDouble) + .setOptionalSingularBool(optionalSingularBool) + .setOptionalSingularEnum(optionalSingularEnum) + .setOptionalSingularString(optionalSingularString) + .setOptionalSingularBytes(optionalSingularBytes) + .setOptionalSingularMessage(optionalSingularMessage) + .setOptionalSingularResourceName(optionalSingularResourceName) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) + .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) + .setOptionalSingularFixed32(optionalSingularFixed32) + .setOptionalSingularFixed64(optionalSingularFixed64) + .addAllOptionalRepeatedInt32(optionalRepeatedInt32) + .addAllOptionalRepeatedInt64(optionalRepeatedInt64) + .addAllOptionalRepeatedFloat(optionalRepeatedFloat) + .addAllOptionalRepeatedDouble(optionalRepeatedDouble) + .addAllOptionalRepeatedBool(optionalRepeatedBool) + .addAllOptionalRepeatedEnum(optionalRepeatedEnum) + .addAllOptionalRepeatedString(optionalRepeatedString) + .addAllOptionalRepeatedBytes(optionalRepeatedBytes) + .addAllOptionalRepeatedMessage(optionalRepeatedMessage) + .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName) + .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof) + .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) + .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) + .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) + .putAllOptionalMap(optionalMap) + .setAnyValue(anyValue) + .setStructValue(structValue) + .setValueValue(valueValue) + .setListValueValue(listValueValue) + .setTimeValue(timeValue) + .setDurationValue(durationValue) + .setFieldMaskValue(fieldMaskValue) + .setInt32Value(int32Value) + .setUint32Value(uint32Value) + .setInt64Value(int64Value) + .setUint64Value(uint64Value) + .setFloatValue(floatValue) + .setDoubleValue(doubleValue) + .setStringValue(stringValue) + .setBoolValue(boolValue) + .setBytesValue(bytesValue) + .addAllRepeatedAnyValue(repeatedAnyValue) + .addAllRepeatedStructValue(repeatedStructValue) + .addAllRepeatedValueValue(repeatedValueValue) + .addAllRepeatedListValueValue(repeatedListValueValue) + .addAllRepeatedTimeValue(repeatedTimeValue) + .addAllRepeatedDurationValue(repeatedDurationValue) + .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) + .addAllRepeatedInt32Value(repeatedInt32Value) + .addAllRepeatedUint32Value(repeatedUint32Value) + .addAllRepeatedInt64Value(repeatedInt64Value) + .addAllRepeatedUint64Value(repeatedUint64Value) + .addAllRepeatedFloatValue(repeatedFloatValue) + .addAllRepeatedDoubleValue(repeatedDoubleValue) + .addAllRepeatedStringValue(repeatedStringValue) + .addAllRepeatedBoolValue(repeatedBoolValue) + .addAllRepeatedBytesValue(repeatedBytesValue) .build(); - return findRelatedBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String namesElement = "";
-   *   List<String> names = Arrays.asList(namesElement);
-   *   List<ShelfName> shelves = new ArrayList<>();
-   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(PublisherName.toStringList(names))
-   *     .addAllShelves(ShelfName.toStringList(shelves))
-   *     .build();
-   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final FindRelatedBooksPagedResponse findRelatedBooks(FindRelatedBooksRequest request) { - return findRelatedBooksPagedCallable() - .call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String namesElement = "";
-   *   List<String> names = Arrays.asList(namesElement);
-   *   List<ShelfName> shelves = new ArrayList<>();
-   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(PublisherName.toStringList(names))
-   *     .addAllShelves(ShelfName.toStringList(shelves))
-   *     .build();
-   *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (BookName element : future.get().iterateAllAsBookName()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- */ - public final UnaryCallable findRelatedBooksPagedCallable() { - return stub.findRelatedBooksPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String namesElement = "";
-   *   List<String> names = Arrays.asList(namesElement);
-   *   List<ShelfName> shelves = new ArrayList<>();
-   *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(PublisherName.toStringList(names))
-   *     .addAllShelves(ShelfName.toStringList(shelves))
-   *     .build();
-   *   while (true) {
-   *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
-   *     for (BookName element : BookName.parseList(response.getNamesList())) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
- */ - public final UnaryCallable findRelatedBooksCallable() { - return stub.findRelatedBooksCallable(); + return testOptionalRequiredFlatteningParams(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds a label to the entity. + * Test optional flattening parameters of all types * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String label = "";
-   *   AddLabelRequest request = AddLabelRequest.newBuilder()
-   *     .setResource(resource.toString())
-   *     .setLabel(label)
+   *   int requiredSingularInt32 = 0;
+   *   long requiredSingularInt64 = 0L;
+   *   float requiredSingularFloat = 0.0F;
+   *   double requiredSingularDouble = 0.0;
+   *   boolean requiredSingularBool = false;
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
+   *   String requiredSingularString = "";
+   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
+   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
+   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   String requiredSingularResourceNameCommon = "";
+   *   int requiredSingularFixed32 = 0;
+   *   long requiredSingularFixed64 = 0L;
+   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
+   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
+   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
+   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
+   *   List<String> requiredRepeatedString = new ArrayList<>();
+   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
+   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
+   *   List<BookName> requiredRepeatedResourceName = new ArrayList<>();
+   *   List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>();
+   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
+   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
+   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
+   *   Map<Integer, String> requiredMap = new HashMap<>();
+   *   Any requiredAnyValue = Any.newBuilder().build();
+   *   Struct requiredStructValue = Struct.newBuilder().build();
+   *   Value requiredValueValue = Value.newBuilder().build();
+   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
+   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
+   *   Duration requiredDurationValue = Duration.newBuilder().build();
+   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
+   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
+   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
+   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
+   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
+   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
+   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
+   *   StringValue requiredStringValue = StringValue.newBuilder().build();
+   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
+   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
+   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
+   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
+   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
+   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
+   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
+   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
+   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
+   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
+   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
+   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
+   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
+   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
+   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
+   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
+   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
+   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
+   *   TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder()
+   *     .setRequiredSingularInt32(requiredSingularInt32)
+   *     .setRequiredSingularInt64(requiredSingularInt64)
+   *     .setRequiredSingularFloat(requiredSingularFloat)
+   *     .setRequiredSingularDouble(requiredSingularDouble)
+   *     .setRequiredSingularBool(requiredSingularBool)
+   *     .setRequiredSingularEnum(requiredSingularEnum)
+   *     .setRequiredSingularString(requiredSingularString)
+   *     .setRequiredSingularBytes(requiredSingularBytes)
+   *     .setRequiredSingularMessage(requiredSingularMessage)
+   *     .setRequiredSingularResourceName(requiredSingularResourceName.toString())
+   *     .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString())
+   *     .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon)
+   *     .setRequiredSingularFixed32(requiredSingularFixed32)
+   *     .setRequiredSingularFixed64(requiredSingularFixed64)
+   *     .addAllRequiredRepeatedInt32(requiredRepeatedInt32)
+   *     .addAllRequiredRepeatedInt64(requiredRepeatedInt64)
+   *     .addAllRequiredRepeatedFloat(requiredRepeatedFloat)
+   *     .addAllRequiredRepeatedDouble(requiredRepeatedDouble)
+   *     .addAllRequiredRepeatedBool(requiredRepeatedBool)
+   *     .addAllRequiredRepeatedEnum(requiredRepeatedEnum)
+   *     .addAllRequiredRepeatedString(requiredRepeatedString)
+   *     .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
+   *     .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
+   *     .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName))
+   *     .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof))
+   *     .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
+   *     .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
+   *     .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
+   *     .putAllRequiredMap(requiredMap)
+   *     .setRequiredAnyValue(requiredAnyValue)
+   *     .setRequiredStructValue(requiredStructValue)
+   *     .setRequiredValueValue(requiredValueValue)
+   *     .setRequiredListValueValue(requiredListValueValue)
+   *     .setRequiredTimeValue(requiredTimeValue)
+   *     .setRequiredDurationValue(requiredDurationValue)
+   *     .setRequiredFieldMaskValue(requiredFieldMaskValue)
+   *     .setRequiredInt32Value(requiredInt32Value)
+   *     .setRequiredUint32Value(requiredUint32Value)
+   *     .setRequiredInt64Value(requiredInt64Value)
+   *     .setRequiredUint64Value(requiredUint64Value)
+   *     .setRequiredFloatValue(requiredFloatValue)
+   *     .setRequiredDoubleValue(requiredDoubleValue)
+   *     .setRequiredStringValue(requiredStringValue)
+   *     .setRequiredBoolValue(requiredBoolValue)
+   *     .setRequiredBytesValue(requiredBytesValue)
+   *     .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue)
+   *     .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue)
+   *     .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue)
+   *     .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue)
+   *     .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue)
+   *     .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue)
+   *     .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue)
+   *     .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value)
+   *     .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value)
+   *     .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value)
+   *     .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value)
+   *     .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue)
+   *     .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue)
+   *     .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue)
+   *     .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue)
+   *     .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue)
    *     .build();
-   *   AddLabelResponse response = libraryClient.addLabel(request);
+   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @Deprecated - /* package-private */ final AddLabelResponse addLabel(AddLabelRequest request) { - return addLabelCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Adds a label to the entity. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String label = "";
-   *   AddLabelRequest request = AddLabelRequest.newBuilder()
-   *     .setResource(resource.toString())
-   *     .setLabel(label)
-   *     .build();
-   *   ApiFuture<AddLabelResponse> future = libraryClient.addLabelCallable().futureCall(request);
-   *   // Do something
-   *   AddLabelResponse response = future.get();
-   * }
-   * 
- */ - @Deprecated - /* package-private */ final UnaryCallable addLabelCallable() { - return stub.addLabelCallable(); + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest request) { + return testOptionalRequiredFlatteningParamsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * Test optional flattening parameters of all types * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.getBigBookAsync(name).get();
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * int requiredSingularInt32 = 0; + * long requiredSingularInt64 = 0L; + * float requiredSingularFloat = 0.0F; + * double requiredSingularDouble = 0.0; + * boolean requiredSingularBool = false; + * TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + * String requiredSingularString = ""; + * ByteString requiredSingularBytes = ByteString.copyFromUtf8(""); + * TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + * BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + * BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + * String requiredSingularResourceNameCommon = ""; + * int requiredSingularFixed32 = 0; + * long requiredSingularFixed64 = 0L; + * List<Integer> requiredRepeatedInt32 = new ArrayList<>(); + * List<Long> requiredRepeatedInt64 = new ArrayList<>(); + * List<Float> requiredRepeatedFloat = new ArrayList<>(); + * List<Double> requiredRepeatedDouble = new ArrayList<>(); + * List<Boolean> requiredRepeatedBool = new ArrayList<>(); + * List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>(); + * List<String> requiredRepeatedString = new ArrayList<>(); + * List<ByteString> requiredRepeatedBytes = new ArrayList<>(); + * List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>(); + * List<BookName> requiredRepeatedResourceName = new ArrayList<>(); + * List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>(); + * List<String> requiredRepeatedResourceNameCommon = new ArrayList<>(); + * List<Integer> requiredRepeatedFixed32 = new ArrayList<>(); + * List<Long> requiredRepeatedFixed64 = new ArrayList<>(); + * Map<Integer, String> requiredMap = new HashMap<>(); + * Any requiredAnyValue = Any.newBuilder().build(); + * Struct requiredStructValue = Struct.newBuilder().build(); + * Value requiredValueValue = Value.newBuilder().build(); + * ListValue requiredListValueValue = ListValue.newBuilder().build(); + * Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + * Duration requiredDurationValue = Duration.newBuilder().build(); + * FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); + * Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + * UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + * Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + * UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + * FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + * DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + * StringValue requiredStringValue = StringValue.newBuilder().build(); + * BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + * BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + * List<Any> requiredRepeatedAnyValue = new ArrayList<>(); + * List<Struct> requiredRepeatedStructValue = new ArrayList<>(); + * List<Value> requiredRepeatedValueValue = new ArrayList<>(); + * List<ListValue> requiredRepeatedListValueValue = new ArrayList<>(); + * List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>(); + * List<Duration> requiredRepeatedDurationValue = new ArrayList<>(); + * List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>(); + * List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>(); + * List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>(); + * List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>(); + * List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>(); + * List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>(); + * List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>(); + * List<StringValue> requiredRepeatedStringValue = new ArrayList<>(); + * List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>(); + * List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>(); + * TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder() + * .setRequiredSingularInt32(requiredSingularInt32) + * .setRequiredSingularInt64(requiredSingularInt64) + * .setRequiredSingularFloat(requiredSingularFloat) + * .setRequiredSingularDouble(requiredSingularDouble) + * .setRequiredSingularBool(requiredSingularBool) + * .setRequiredSingularEnum(requiredSingularEnum) + * .setRequiredSingularString(requiredSingularString) + * .setRequiredSingularBytes(requiredSingularBytes) + * .setRequiredSingularMessage(requiredSingularMessage) + * .setRequiredSingularResourceName(requiredSingularResourceName.toString()) + * .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString()) + * .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) + * .setRequiredSingularFixed32(requiredSingularFixed32) + * .setRequiredSingularFixed64(requiredSingularFixed64) + * .addAllRequiredRepeatedInt32(requiredRepeatedInt32) + * .addAllRequiredRepeatedInt64(requiredRepeatedInt64) + * .addAllRequiredRepeatedFloat(requiredRepeatedFloat) + * .addAllRequiredRepeatedDouble(requiredRepeatedDouble) + * .addAllRequiredRepeatedBool(requiredRepeatedBool) + * .addAllRequiredRepeatedEnum(requiredRepeatedEnum) + * .addAllRequiredRepeatedString(requiredRepeatedString) + * .addAllRequiredRepeatedBytes(requiredRepeatedBytes) + * .addAllRequiredRepeatedMessage(requiredRepeatedMessage) + * .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName)) + * .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof)) + * .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) + * .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) + * .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) + * .putAllRequiredMap(requiredMap) + * .setRequiredAnyValue(requiredAnyValue) + * .setRequiredStructValue(requiredStructValue) + * .setRequiredValueValue(requiredValueValue) + * .setRequiredListValueValue(requiredListValueValue) + * .setRequiredTimeValue(requiredTimeValue) + * .setRequiredDurationValue(requiredDurationValue) + * .setRequiredFieldMaskValue(requiredFieldMaskValue) + * .setRequiredInt32Value(requiredInt32Value) + * .setRequiredUint32Value(requiredUint32Value) + * .setRequiredInt64Value(requiredInt64Value) + * .setRequiredUint64Value(requiredUint64Value) + * .setRequiredFloatValue(requiredFloatValue) + * .setRequiredDoubleValue(requiredDoubleValue) + * .setRequiredStringValue(requiredStringValue) + * .setRequiredBoolValue(requiredBoolValue) + * .setRequiredBytesValue(requiredBytesValue) + * .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) + * .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) + * .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) + * .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) + * .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) + * .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) + * .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) + * .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) + * .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) + * .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) + * .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) + * .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) + * .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) + * .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) + * .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) + * .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) + * .build(); + * ApiFuture<TestOptionalRequiredFlatteningParamsResponse> future = libraryClient.testOptionalRequiredFlatteningParamsCallable().futureCall(request); + * // Do something + * TestOptionalRequiredFlatteningParamsResponse response = future.get(); + * } + *
*/ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(BookName name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return getBigBookAsync(request); + public final UnaryCallable testOptionalRequiredFlatteningParamsCallable() { + return stub.testOptionalRequiredFlatteningParamsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ProjectName destination = ProjectName.of("[PROJECT]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param parent + * @param destination + * @param additionalDestinations * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name) + public final ListPublishersPagedResponse listPublishers(ProjectName parent, ProjectName destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllAdditionalDestinations(additionalDestinations) .build(); - return getBigBookAsync(request); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ProjectName destination = ProjectName.of("[PROJECT]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param parent + * @param destination + * @param additionalDestinations * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name) + public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent) + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) .build(); - return getBigBookAsync(request); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Book response = libraryClient.getBigBookAsync(request).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProjectName destination = ProjectName.of("[PROJECT]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param parent + * @param destination + * @param additionalDestinations * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(GetBookRequest request) { - return getBigBookOperationCallable().futureCall(request); + public final ListPublishersPagedResponse listPublishers(LocationName parent, ProjectName destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllAdditionalDestinations(additionalDestinations) + .build(); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Book, GetBigBookMetadata> future = libraryClient.getBigBookOperationCallable().futureCall(request);
-   *   // Do something
-   *   Book response = future.get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ProjectName destination = ProjectName.of("[PROJECT]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param parent + * @param destination + * @param additionalDestinations + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable getBigBookOperationCallable() { - return stub.getBigBookOperationCallable(); + public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent) + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .build(); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = libraryClient.getBigBookCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param parent + * @param destination + * @param additionalDestinations + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable getBigBookCallable() { - return stub.getBigBookCallable(); + public final ListPublishersPagedResponse listPublishers(ProjectName parent, ArchiveName destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllAdditionalDestinations(additionalDestinations) + .build(); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.getBigNothingAsync(name).get();
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param parent + * @param destination + * @param additionalDestinations * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(BookName name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name == null ? null : name.toString()) + public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent) + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) .build(); - return getBigNothingAsync(request); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.getBigNothingAsync(name.toString()).get();
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param parent + * @param destination + * @param additionalDestinations * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name) + public final ListPublishersPagedResponse listPublishers(ProjectName parent, ShelfName destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllAdditionalDestinations(additionalDestinations) .build(); - return getBigNothingAsync(request); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.getBigNothingAsync(name.toString()).get();
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name The name of the book to retrieve. + * @param parent + * @param destination + * @param additionalDestinations * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name) + public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent) + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) .build(); - return getBigNothingAsync(request); + return listPublishers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent + * @param destination + * @param additionalDestinations + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(LocationName parent, ArchiveName destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllAdditionalDestinations(additionalDestinations) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent + * @param destination + * @param additionalDestinations + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent) + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent + * @param destination + * @param additionalDestinations + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(LocationName parent, ShelfName destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllAdditionalDestinations(additionalDestinations) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
+   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
+   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent + * @param destination + * @param additionalDestinations + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { + ListPublishersRequest request = + ListPublishersRequest.newBuilder() + .setParent(parent) + .setDestination(destination) + .addAllAdditionalDestinations(additionalDestinations) + .build(); + return listPublishers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   libraryClient.getBigNothingAsync(request).get();
+   *   for (Publisher element : libraryClient.listPublishers(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(GetBookRequest request) { - return getBigNothingOperationCallable().futureCall(request); + public final ListPublishersPagedResponse listPublishers(ListPublishersRequest request) { + return listPublishersPagedCallable() + .call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   OperationFuture<Empty, GetBigBookMetadata> future = libraryClient.getBigNothingOperationCallable().futureCall(request);
+   *   ApiFuture<ListPublishersPagedResponse> future = libraryClient.listPublishersPagedCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   for (Publisher element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable getBigNothingOperationCallable() { - return stub.getBigNothingOperationCallable(); + public final UnaryCallable listPublishersPagedCallable() { + return stub.listPublishersPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test long-running operations with empty return type. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   GetBookRequest request = GetBookRequest.newBuilder()
-   *     .setName(name.toString())
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ApiFuture<Operation> future = libraryClient.getBigNothingCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   while (true) {
+   *     ListPublishersResponse response = libraryClient.listPublishersCallable().call(request);
+   *     for (Publisher element : response.getPublishersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
    * }
    * 
*/ - public final UnaryCallable getBigNothingCallable() { - return stub.getBigNothingCallable(); + public final UnaryCallable listPublishersCallable() { + return stub.listPublishersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test optional flattening parameters of all types + * This method is not exposed in the GAPIC config. It should be generated. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   boolean optionalSingularBool = false;
-   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
-   *   int optionalSingularFixed32 = 0;
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
-   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
-   *   Any anyValue = Any.newBuilder().build();
-   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
-   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   ListValue listValueValue = ListValue.newBuilder().build();
-   *   Struct structValue = Struct.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   String requiredSingularResourceNameCommon = "";
-   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
-   *   String optionalSingularString = "";
-   *   long optionalSingularInt64 = 0L;
-   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
-   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
-   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   boolean requiredSingularBool = false;
-   *   float requiredSingularFloat = 0.0F;
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
-   *   long requiredSingularFixed64 = 0L;
-   *   String requiredSingularString = "";
-   *   Map<Integer, String> optionalMap = new HashMap<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Any> repeatedAnyValue = new ArrayList<>();
-   *   List<String> optionalRepeatedString = new ArrayList<>();
-   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
-   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   float optionalSingularFloat = 0.0F;
-   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
-   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   String optionalSingularResourceNameCommon = "";
-   *   Int32Value int32Value = Int32Value.newBuilder().build();
-   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Value valueValue = Value.newBuilder().build();
-   *   int optionalSingularInt32 = 0;
-   *   BoolValue boolValue = BoolValue.newBuilder().build();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   double optionalSingularDouble = 0.0;
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
-   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   StringValue stringValue = StringValue.newBuilder().build();
-   *   Timestamp timeValue = Timestamp.newBuilder().build();
-   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
-   *   double requiredSingularDouble = 0.0;
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   long optionalSingularFixed64 = 0L;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   int requiredSingularInt32 = 0;
-   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   int requiredSingularFixed32 = 0;
-   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   List<Duration> repeatedDurationValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   BytesValue bytesValue = BytesValue.newBuilder().build();
-   *   List<Value> repeatedValueValue = new ArrayList<>();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   List<StringValue> repeatedStringValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   long requiredSingularInt64 = 0L;
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
-   *   List<Struct> repeatedStructValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   Int64Value int64Value = Int64Value.newBuilder().build();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
-   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
-   *   FloatValue floatValue = FloatValue.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   Duration durationValue = Duration.newBuilder().build();
-   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue);
+   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
+   *   Book response = libraryClient.privateListShelves(request);
    * }
    * 
* - * @param requiredSingularResourceName - * @param requiredRepeatedBytesValue - * @param requiredRepeatedDurationValue - * @param optionalSingularBool - * @param repeatedListValueValue - * @param optionalSingularFixed32 - * @param optionalRepeatedMessage - * @param repeatedUint32Value - * @param anyValue - * @param optionalRepeatedInt64 - * @param optionalRepeatedFixed32 - * @param requiredDoubleValue - * @param listValueValue - * @param structValue - * @param requiredInt64Value - * @param requiredSingularResourceNameCommon - * @param optionalRepeatedBool - * @param optionalSingularString - * @param optionalSingularInt64 - * @param repeatedFloatValue - * @param optionalSingularMessage - * @param requiredSingularResourceNameOneof - * @param requiredRepeatedValueValue - * @param requiredDurationValue - * @param requiredRepeatedAnyValue - * @param requiredBytesValue - * @param requiredRepeatedInt64 - * @param optionalRepeatedDouble - * @param fieldMaskValue - * @param repeatedFieldMaskValue - * @param requiredMap - * @param requiredUint64Value - * @param requiredSingularBool - * @param requiredSingularFloat - * @param requiredRepeatedBytes - * @param optionalSingularBytes - * @param requiredSingularMessage - * @param requiredAnyValue - * @param repeatedInt32Value - * @param requiredRepeatedFixed64 - * @param repeatedUint64Value - * @param requiredSingularFixed64 - * @param requiredSingularString - * @param optionalMap - * @param requiredRepeatedBool - * @param requiredBoolValue - * @param requiredRepeatedStructValue - * @param repeatedAnyValue - * @param optionalRepeatedString - * @param optionalSingularResourceNameOneof - * @param requiredRepeatedMessage - * @param doubleValue - * @param repeatedDoubleValue - * @param requiredRepeatedUint32Value - * @param optionalSingularFloat - * @param optionalRepeatedBytes - * @param optionalRepeatedFixed64 - * @param requiredRepeatedInt32Value - * @param optionalSingularResourceNameCommon - * @param int32Value - * @param requiredRepeatedResourceName - * @param requiredRepeatedFloat - * @param requiredRepeatedStringValue - * @param repeatedInt64Value - * @param requiredFloatValue - * @param optionalSingularResourceName - * @param valueValue - * @param optionalSingularInt32 - * @param boolValue - * @param requiredRepeatedFieldMaskValue - * @param optionalSingularDouble - * @param requiredRepeatedString - * @param requiredInt32Value - * @param optionalRepeatedFloat - * @param uint64Value - * @param requiredRepeatedEnum - * @param requiredValueValue - * @param requiredRepeatedInt32 - * @param requiredRepeatedResourceNameCommon - * @param stringValue - * @param timeValue - * @param optionalRepeatedResourceNameOneof - * @param requiredSingularDouble - * @param requiredSingularBytes - * @param optionalSingularFixed64 - * @param requiredSingularEnum - * @param requiredRepeatedBoolValue - * @param requiredSingularInt32 - * @param optionalRepeatedResourceName - * @param requiredTimeValue - * @param requiredSingularFixed32 - * @param uint32Value - * @param requiredStructValue - * @param repeatedDurationValue - * @param requiredRepeatedDoubleValue - * @param bytesValue - * @param repeatedValueValue - * @param requiredStringValue - * @param repeatedStringValue - * @param requiredRepeatedTimeValue - * @param optionalRepeatedResourceNameCommon - * @param requiredRepeatedResourceNameOneof - * @param requiredSingularInt64 - * @param optionalRepeatedEnum - * @param requiredFieldMaskValue - * @param repeatedTimeValue - * @param repeatedStructValue - * @param requiredRepeatedListValueValue - * @param repeatedBytesValue - * @param requiredRepeatedInt64Value - * @param requiredListValueValue - * @param requiredRepeatedFloatValue - * @param optionalSingularEnum - * @param int64Value - * @param requiredRepeatedFixed32 - * @param optionalRepeatedInt32 - * @param repeatedBoolValue - * @param floatValue - * @param requiredUint32Value - * @param requiredRepeatedDouble - * @param requiredRepeatedUint64Value - * @param durationValue + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(BookName requiredSingularResourceName, List requiredRepeatedBytesValue, List requiredRepeatedDurationValue, boolean optionalSingularBool, List repeatedListValueValue, int optionalSingularFixed32, List optionalRepeatedMessage, List repeatedUint32Value, Any anyValue, List optionalRepeatedInt64, List optionalRepeatedFixed32, DoubleValue requiredDoubleValue, ListValue listValueValue, Struct structValue, Int64Value requiredInt64Value, String requiredSingularResourceNameCommon, List optionalRepeatedBool, String optionalSingularString, long optionalSingularInt64, List repeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, BookName requiredSingularResourceNameOneof, List requiredRepeatedValueValue, Duration requiredDurationValue, List requiredRepeatedAnyValue, BytesValue requiredBytesValue, List requiredRepeatedInt64, List optionalRepeatedDouble, com.google.protobuf.FieldMask fieldMaskValue, List repeatedFieldMaskValue, Map requiredMap, UInt64Value requiredUint64Value, boolean requiredSingularBool, float requiredSingularFloat, List requiredRepeatedBytes, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, Any requiredAnyValue, List repeatedInt32Value, List requiredRepeatedFixed64, List repeatedUint64Value, long requiredSingularFixed64, String requiredSingularString, Map optionalMap, List requiredRepeatedBool, BoolValue requiredBoolValue, List requiredRepeatedStructValue, List repeatedAnyValue, List optionalRepeatedString, BookName optionalSingularResourceNameOneof, List requiredRepeatedMessage, DoubleValue doubleValue, List repeatedDoubleValue, List requiredRepeatedUint32Value, float optionalSingularFloat, List optionalRepeatedBytes, List optionalRepeatedFixed64, List requiredRepeatedInt32Value, String optionalSingularResourceNameCommon, Int32Value int32Value, List requiredRepeatedResourceName, List requiredRepeatedFloat, List requiredRepeatedStringValue, List repeatedInt64Value, FloatValue requiredFloatValue, BookName optionalSingularResourceName, Value valueValue, int optionalSingularInt32, BoolValue boolValue, List requiredRepeatedFieldMaskValue, double optionalSingularDouble, List requiredRepeatedString, Int32Value requiredInt32Value, List optionalRepeatedFloat, UInt64Value uint64Value, List requiredRepeatedEnum, Value requiredValueValue, List requiredRepeatedInt32, List requiredRepeatedResourceNameCommon, StringValue stringValue, Timestamp timeValue, List optionalRepeatedResourceNameOneof, double requiredSingularDouble, ByteString requiredSingularBytes, long optionalSingularFixed64, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, List requiredRepeatedBoolValue, int requiredSingularInt32, List optionalRepeatedResourceName, Timestamp requiredTimeValue, int requiredSingularFixed32, UInt32Value uint32Value, Struct requiredStructValue, List repeatedDurationValue, List requiredRepeatedDoubleValue, BytesValue bytesValue, List repeatedValueValue, StringValue requiredStringValue, List repeatedStringValue, List requiredRepeatedTimeValue, List optionalRepeatedResourceNameCommon, List requiredRepeatedResourceNameOneof, long requiredSingularInt64, List optionalRepeatedEnum, com.google.protobuf.FieldMask requiredFieldMaskValue, List repeatedTimeValue, List repeatedStructValue, List requiredRepeatedListValueValue, List repeatedBytesValue, List requiredRepeatedInt64Value, ListValue requiredListValueValue, List requiredRepeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, Int64Value int64Value, List requiredRepeatedFixed32, List optionalRepeatedInt32, List repeatedBoolValue, FloatValue floatValue, UInt32Value requiredUint32Value, List requiredRepeatedDouble, List requiredRepeatedUint64Value, Duration durationValue) { - TestOptionalRequiredFlatteningParamsRequest request = - TestOptionalRequiredFlatteningParamsRequest.newBuilder() - .setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) - .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) - .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) - .setOptionalSingularBool(optionalSingularBool) - .addAllRepeatedListValueValue(repeatedListValueValue) - .setOptionalSingularFixed32(optionalSingularFixed32) - .addAllOptionalRepeatedMessage(optionalRepeatedMessage) - .addAllRepeatedUint32Value(repeatedUint32Value) - .setAnyValue(anyValue) - .addAllOptionalRepeatedInt64(optionalRepeatedInt64) - .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) - .setRequiredDoubleValue(requiredDoubleValue) - .setListValueValue(listValueValue) - .setStructValue(structValue) - .setRequiredInt64Value(requiredInt64Value) - .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) - .addAllOptionalRepeatedBool(optionalRepeatedBool) - .setOptionalSingularString(optionalSingularString) - .setOptionalSingularInt64(optionalSingularInt64) - .addAllRepeatedFloatValue(repeatedFloatValue) - .setOptionalSingularMessage(optionalSingularMessage) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof == null ? null : requiredSingularResourceNameOneof.toString()) - .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) - .setRequiredDurationValue(requiredDurationValue) - .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) - .setRequiredBytesValue(requiredBytesValue) - .addAllRequiredRepeatedInt64(requiredRepeatedInt64) - .addAllOptionalRepeatedDouble(optionalRepeatedDouble) - .setFieldMaskValue(fieldMaskValue) - .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) - .putAllRequiredMap(requiredMap) - .setRequiredUint64Value(requiredUint64Value) - .setRequiredSingularBool(requiredSingularBool) - .setRequiredSingularFloat(requiredSingularFloat) - .addAllRequiredRepeatedBytes(requiredRepeatedBytes) - .setOptionalSingularBytes(optionalSingularBytes) - .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredAnyValue(requiredAnyValue) - .addAllRepeatedInt32Value(repeatedInt32Value) - .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) - .addAllRepeatedUint64Value(repeatedUint64Value) - .setRequiredSingularFixed64(requiredSingularFixed64) - .setRequiredSingularString(requiredSingularString) - .putAllOptionalMap(optionalMap) - .addAllRequiredRepeatedBool(requiredRepeatedBool) - .setRequiredBoolValue(requiredBoolValue) - .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) - .addAllRepeatedAnyValue(repeatedAnyValue) - .addAllOptionalRepeatedString(optionalRepeatedString) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof == null ? null : optionalSingularResourceNameOneof.toString()) - .addAllRequiredRepeatedMessage(requiredRepeatedMessage) - .setDoubleValue(doubleValue) - .addAllRepeatedDoubleValue(repeatedDoubleValue) - .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) - .setOptionalSingularFloat(optionalSingularFloat) - .addAllOptionalRepeatedBytes(optionalRepeatedBytes) - .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) - .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) - .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) - .setInt32Value(int32Value) - .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : BookName.toStringList(requiredRepeatedResourceName)) - .addAllRequiredRepeatedFloat(requiredRepeatedFloat) - .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) - .addAllRepeatedInt64Value(repeatedInt64Value) - .setRequiredFloatValue(requiredFloatValue) - .setOptionalSingularResourceName(optionalSingularResourceName == null ? null : optionalSingularResourceName.toString()) - .setValueValue(valueValue) - .setOptionalSingularInt32(optionalSingularInt32) - .setBoolValue(boolValue) - .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) - .setOptionalSingularDouble(optionalSingularDouble) - .addAllRequiredRepeatedString(requiredRepeatedString) - .setRequiredInt32Value(requiredInt32Value) - .addAllOptionalRepeatedFloat(optionalRepeatedFloat) - .setUint64Value(uint64Value) - .addAllRequiredRepeatedEnum(requiredRepeatedEnum) - .setRequiredValueValue(requiredValueValue) - .addAllRequiredRepeatedInt32(requiredRepeatedInt32) - .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) - .setStringValue(stringValue) - .setTimeValue(timeValue) - .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof)) - .setRequiredSingularDouble(requiredSingularDouble) - .setRequiredSingularBytes(requiredSingularBytes) - .setOptionalSingularFixed64(optionalSingularFixed64) - .setRequiredSingularEnum(requiredSingularEnum) - .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) - .setRequiredSingularInt32(requiredSingularInt32) - .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : BookName.toStringList(optionalRepeatedResourceName)) - .setRequiredTimeValue(requiredTimeValue) - .setRequiredSingularFixed32(requiredSingularFixed32) - .setUint32Value(uint32Value) - .setRequiredStructValue(requiredStructValue) - .addAllRepeatedDurationValue(repeatedDurationValue) - .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) - .setBytesValue(bytesValue) - .addAllRepeatedValueValue(repeatedValueValue) - .setRequiredStringValue(requiredStringValue) - .addAllRepeatedStringValue(repeatedStringValue) - .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) - .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) - .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof)) - .setRequiredSingularInt64(requiredSingularInt64) - .addAllOptionalRepeatedEnum(optionalRepeatedEnum) - .setRequiredFieldMaskValue(requiredFieldMaskValue) - .addAllRepeatedTimeValue(repeatedTimeValue) - .addAllRepeatedStructValue(repeatedStructValue) - .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) - .addAllRepeatedBytesValue(repeatedBytesValue) - .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) - .setRequiredListValueValue(requiredListValueValue) - .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) - .setOptionalSingularEnum(optionalSingularEnum) - .setInt64Value(int64Value) - .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) - .addAllOptionalRepeatedInt32(optionalRepeatedInt32) - .addAllRepeatedBoolValue(repeatedBoolValue) - .setFloatValue(floatValue) - .setRequiredUint32Value(requiredUint32Value) - .addAllRequiredRepeatedDouble(requiredRepeatedDouble) - .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) - .setDurationValue(durationValue) - .build(); - return testOptionalRequiredFlatteningParams(request); + public final Book privateListShelves(ListShelvesRequest request) { + return privateListShelvesCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Test optional flattening parameters of all types + * This method is not exposed in the GAPIC config. It should be generated. * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   boolean optionalSingularBool = false;
-   *   List<ListValue> repeatedListValueValue = new ArrayList<>();
-   *   int optionalSingularFixed32 = 0;
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> optionalRepeatedMessage = new ArrayList<>();
-   *   List<UInt32Value> repeatedUint32Value = new ArrayList<>();
-   *   Any anyValue = Any.newBuilder().build();
-   *   List<Long> optionalRepeatedInt64 = new ArrayList<>();
-   *   List<Integer> optionalRepeatedFixed32 = new ArrayList<>();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   ListValue listValueValue = ListValue.newBuilder().build();
-   *   Struct structValue = Struct.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   String requiredSingularResourceNameCommon = "";
-   *   List<Boolean> optionalRepeatedBool = new ArrayList<>();
-   *   String optionalSingularString = "";
-   *   long optionalSingularInt64 = 0L;
-   *   List<FloatValue> repeatedFloatValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Double> optionalRepeatedDouble = new ArrayList<>();
-   *   FieldMask fieldMaskValue = FieldMask.newBuilder().build();
-   *   List<FieldMask> repeatedFieldMaskValue = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   boolean requiredSingularBool = false;
-   *   float requiredSingularFloat = 0.0F;
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   List<Int32Value> repeatedInt32Value = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   List<UInt64Value> repeatedUint64Value = new ArrayList<>();
-   *   long requiredSingularFixed64 = 0L;
-   *   String requiredSingularString = "";
-   *   Map<Integer, String> optionalMap = new HashMap<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Any> repeatedAnyValue = new ArrayList<>();
-   *   List<String> optionalRepeatedString = new ArrayList<>();
-   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   DoubleValue doubleValue = DoubleValue.newBuilder().build();
-   *   List<DoubleValue> repeatedDoubleValue = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   float optionalSingularFloat = 0.0F;
-   *   List<ByteString> optionalRepeatedBytes = new ArrayList<>();
-   *   List<Long> optionalRepeatedFixed64 = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   String optionalSingularResourceNameCommon = "";
-   *   Int32Value int32Value = Int32Value.newBuilder().build();
-   *   List<String> formattedRequiredRepeatedResourceName = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<Int64Value> repeatedInt64Value = new ArrayList<>();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Value valueValue = Value.newBuilder().build();
-   *   int optionalSingularInt32 = 0;
-   *   BoolValue boolValue = BoolValue.newBuilder().build();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   double optionalSingularDouble = 0.0;
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   List<Float> optionalRepeatedFloat = new ArrayList<>();
-   *   UInt64Value uint64Value = UInt64Value.newBuilder().build();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   StringValue stringValue = StringValue.newBuilder().build();
-   *   Timestamp timeValue = Timestamp.newBuilder().build();
-   *   List<String> formattedOptionalRepeatedResourceNameOneof = new ArrayList<>();
-   *   double requiredSingularDouble = 0.0;
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   long optionalSingularFixed64 = 0L;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   int requiredSingularInt32 = 0;
-   *   List<String> formattedOptionalRepeatedResourceName = new ArrayList<>();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   int requiredSingularFixed32 = 0;
-   *   UInt32Value uint32Value = UInt32Value.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   List<Duration> repeatedDurationValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   BytesValue bytesValue = BytesValue.newBuilder().build();
-   *   List<Value> repeatedValueValue = new ArrayList<>();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   List<StringValue> repeatedStringValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<String> optionalRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<String> formattedRequiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   long requiredSingularInt64 = 0L;
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> optionalRepeatedEnum = new ArrayList<>();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   List<Timestamp> repeatedTimeValue = new ArrayList<>();
-   *   List<Struct> repeatedStructValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   Int64Value int64Value = Int64Value.newBuilder().build();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Integer> optionalRepeatedInt32 = new ArrayList<>();
-   *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
-   *   FloatValue floatValue = FloatValue.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   Duration durationValue = Duration.newBuilder().build();
-   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularResourceName.toString(), requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof.toString(), requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof.toString(), requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName.toString(), valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue);
+   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
+   *   ApiFuture<Book> future = libraryClient.privateListShelvesCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
    * }
    * 
- * - * @param requiredSingularResourceName - * @param requiredRepeatedBytesValue - * @param requiredRepeatedDurationValue - * @param optionalSingularBool - * @param repeatedListValueValue - * @param optionalSingularFixed32 - * @param optionalRepeatedMessage - * @param repeatedUint32Value - * @param anyValue - * @param optionalRepeatedInt64 - * @param optionalRepeatedFixed32 - * @param requiredDoubleValue - * @param listValueValue - * @param structValue - * @param requiredInt64Value - * @param requiredSingularResourceNameCommon - * @param optionalRepeatedBool - * @param optionalSingularString - * @param optionalSingularInt64 - * @param repeatedFloatValue - * @param optionalSingularMessage - * @param requiredSingularResourceNameOneof - * @param requiredRepeatedValueValue - * @param requiredDurationValue - * @param requiredRepeatedAnyValue - * @param requiredBytesValue - * @param requiredRepeatedInt64 - * @param optionalRepeatedDouble - * @param fieldMaskValue - * @param repeatedFieldMaskValue - * @param requiredMap - * @param requiredUint64Value - * @param requiredSingularBool - * @param requiredSingularFloat - * @param requiredRepeatedBytes - * @param optionalSingularBytes - * @param requiredSingularMessage - * @param requiredAnyValue - * @param repeatedInt32Value - * @param requiredRepeatedFixed64 - * @param repeatedUint64Value - * @param requiredSingularFixed64 - * @param requiredSingularString - * @param optionalMap - * @param requiredRepeatedBool - * @param requiredBoolValue - * @param requiredRepeatedStructValue - * @param repeatedAnyValue - * @param optionalRepeatedString - * @param optionalSingularResourceNameOneof - * @param requiredRepeatedMessage - * @param doubleValue - * @param repeatedDoubleValue - * @param requiredRepeatedUint32Value - * @param optionalSingularFloat - * @param optionalRepeatedBytes - * @param optionalRepeatedFixed64 - * @param requiredRepeatedInt32Value - * @param optionalSingularResourceNameCommon - * @param int32Value - * @param requiredRepeatedResourceName - * @param requiredRepeatedFloat - * @param requiredRepeatedStringValue - * @param repeatedInt64Value - * @param requiredFloatValue - * @param optionalSingularResourceName - * @param valueValue - * @param optionalSingularInt32 - * @param boolValue - * @param requiredRepeatedFieldMaskValue - * @param optionalSingularDouble - * @param requiredRepeatedString - * @param requiredInt32Value - * @param optionalRepeatedFloat - * @param uint64Value - * @param requiredRepeatedEnum - * @param requiredValueValue - * @param requiredRepeatedInt32 - * @param requiredRepeatedResourceNameCommon - * @param stringValue - * @param timeValue - * @param optionalRepeatedResourceNameOneof - * @param requiredSingularDouble - * @param requiredSingularBytes - * @param optionalSingularFixed64 - * @param requiredSingularEnum - * @param requiredRepeatedBoolValue - * @param requiredSingularInt32 - * @param optionalRepeatedResourceName - * @param requiredTimeValue - * @param requiredSingularFixed32 - * @param uint32Value - * @param requiredStructValue - * @param repeatedDurationValue - * @param requiredRepeatedDoubleValue - * @param bytesValue - * @param repeatedValueValue - * @param requiredStringValue - * @param repeatedStringValue - * @param requiredRepeatedTimeValue - * @param optionalRepeatedResourceNameCommon - * @param requiredRepeatedResourceNameOneof - * @param requiredSingularInt64 - * @param optionalRepeatedEnum - * @param requiredFieldMaskValue - * @param repeatedTimeValue - * @param repeatedStructValue - * @param requiredRepeatedListValueValue - * @param repeatedBytesValue - * @param requiredRepeatedInt64Value - * @param requiredListValueValue - * @param requiredRepeatedFloatValue - * @param optionalSingularEnum - * @param int64Value - * @param requiredRepeatedFixed32 - * @param optionalRepeatedInt32 - * @param repeatedBoolValue - * @param floatValue - * @param requiredUint32Value - * @param requiredRepeatedDouble - * @param requiredRepeatedUint64Value - * @param durationValue - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(String requiredSingularResourceName, List requiredRepeatedBytesValue, List requiredRepeatedDurationValue, boolean optionalSingularBool, List repeatedListValueValue, int optionalSingularFixed32, List optionalRepeatedMessage, List repeatedUint32Value, Any anyValue, List optionalRepeatedInt64, List optionalRepeatedFixed32, DoubleValue requiredDoubleValue, ListValue listValueValue, Struct structValue, Int64Value requiredInt64Value, String requiredSingularResourceNameCommon, List optionalRepeatedBool, String optionalSingularString, long optionalSingularInt64, List repeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String requiredSingularResourceNameOneof, List requiredRepeatedValueValue, Duration requiredDurationValue, List requiredRepeatedAnyValue, BytesValue requiredBytesValue, List requiredRepeatedInt64, List optionalRepeatedDouble, com.google.protobuf.FieldMask fieldMaskValue, List repeatedFieldMaskValue, Map requiredMap, UInt64Value requiredUint64Value, boolean requiredSingularBool, float requiredSingularFloat, List requiredRepeatedBytes, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, Any requiredAnyValue, List repeatedInt32Value, List requiredRepeatedFixed64, List repeatedUint64Value, long requiredSingularFixed64, String requiredSingularString, Map optionalMap, List requiredRepeatedBool, BoolValue requiredBoolValue, List requiredRepeatedStructValue, List repeatedAnyValue, List optionalRepeatedString, String optionalSingularResourceNameOneof, List requiredRepeatedMessage, DoubleValue doubleValue, List repeatedDoubleValue, List requiredRepeatedUint32Value, float optionalSingularFloat, List optionalRepeatedBytes, List optionalRepeatedFixed64, List requiredRepeatedInt32Value, String optionalSingularResourceNameCommon, Int32Value int32Value, List requiredRepeatedResourceName, List requiredRepeatedFloat, List requiredRepeatedStringValue, List repeatedInt64Value, FloatValue requiredFloatValue, String optionalSingularResourceName, Value valueValue, int optionalSingularInt32, BoolValue boolValue, List requiredRepeatedFieldMaskValue, double optionalSingularDouble, List requiredRepeatedString, Int32Value requiredInt32Value, List optionalRepeatedFloat, UInt64Value uint64Value, List requiredRepeatedEnum, Value requiredValueValue, List requiredRepeatedInt32, List requiredRepeatedResourceNameCommon, StringValue stringValue, Timestamp timeValue, List optionalRepeatedResourceNameOneof, double requiredSingularDouble, ByteString requiredSingularBytes, long optionalSingularFixed64, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, List requiredRepeatedBoolValue, int requiredSingularInt32, List optionalRepeatedResourceName, Timestamp requiredTimeValue, int requiredSingularFixed32, UInt32Value uint32Value, Struct requiredStructValue, List repeatedDurationValue, List requiredRepeatedDoubleValue, BytesValue bytesValue, List repeatedValueValue, StringValue requiredStringValue, List repeatedStringValue, List requiredRepeatedTimeValue, List optionalRepeatedResourceNameCommon, List requiredRepeatedResourceNameOneof, long requiredSingularInt64, List optionalRepeatedEnum, com.google.protobuf.FieldMask requiredFieldMaskValue, List repeatedTimeValue, List repeatedStructValue, List requiredRepeatedListValueValue, List repeatedBytesValue, List requiredRepeatedInt64Value, ListValue requiredListValueValue, List requiredRepeatedFloatValue, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, Int64Value int64Value, List requiredRepeatedFixed32, List optionalRepeatedInt32, List repeatedBoolValue, FloatValue floatValue, UInt32Value requiredUint32Value, List requiredRepeatedDouble, List requiredRepeatedUint64Value, Duration durationValue) { - TestOptionalRequiredFlatteningParamsRequest request = - TestOptionalRequiredFlatteningParamsRequest.newBuilder() - .setRequiredSingularResourceName(requiredSingularResourceName) - .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue) - .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue) - .setOptionalSingularBool(optionalSingularBool) - .addAllRepeatedListValueValue(repeatedListValueValue) - .setOptionalSingularFixed32(optionalSingularFixed32) - .addAllOptionalRepeatedMessage(optionalRepeatedMessage) - .addAllRepeatedUint32Value(repeatedUint32Value) - .setAnyValue(anyValue) - .addAllOptionalRepeatedInt64(optionalRepeatedInt64) - .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) - .setRequiredDoubleValue(requiredDoubleValue) - .setListValueValue(listValueValue) - .setStructValue(structValue) - .setRequiredInt64Value(requiredInt64Value) - .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) - .addAllOptionalRepeatedBool(optionalRepeatedBool) - .setOptionalSingularString(optionalSingularString) - .setOptionalSingularInt64(optionalSingularInt64) - .addAllRepeatedFloatValue(repeatedFloatValue) - .setOptionalSingularMessage(optionalSingularMessage) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) - .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue) - .setRequiredDurationValue(requiredDurationValue) - .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue) - .setRequiredBytesValue(requiredBytesValue) - .addAllRequiredRepeatedInt64(requiredRepeatedInt64) - .addAllOptionalRepeatedDouble(optionalRepeatedDouble) - .setFieldMaskValue(fieldMaskValue) - .addAllRepeatedFieldMaskValue(repeatedFieldMaskValue) - .putAllRequiredMap(requiredMap) - .setRequiredUint64Value(requiredUint64Value) - .setRequiredSingularBool(requiredSingularBool) - .setRequiredSingularFloat(requiredSingularFloat) - .addAllRequiredRepeatedBytes(requiredRepeatedBytes) - .setOptionalSingularBytes(optionalSingularBytes) - .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredAnyValue(requiredAnyValue) - .addAllRepeatedInt32Value(repeatedInt32Value) - .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) - .addAllRepeatedUint64Value(repeatedUint64Value) - .setRequiredSingularFixed64(requiredSingularFixed64) - .setRequiredSingularString(requiredSingularString) - .putAllOptionalMap(optionalMap) - .addAllRequiredRepeatedBool(requiredRepeatedBool) - .setRequiredBoolValue(requiredBoolValue) - .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue) - .addAllRepeatedAnyValue(repeatedAnyValue) - .addAllOptionalRepeatedString(optionalRepeatedString) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) - .addAllRequiredRepeatedMessage(requiredRepeatedMessage) - .setDoubleValue(doubleValue) - .addAllRepeatedDoubleValue(repeatedDoubleValue) - .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value) - .setOptionalSingularFloat(optionalSingularFloat) - .addAllOptionalRepeatedBytes(optionalRepeatedBytes) - .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) - .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value) - .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) - .setInt32Value(int32Value) - .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName) - .addAllRequiredRepeatedFloat(requiredRepeatedFloat) - .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue) - .addAllRepeatedInt64Value(repeatedInt64Value) - .setRequiredFloatValue(requiredFloatValue) - .setOptionalSingularResourceName(optionalSingularResourceName) - .setValueValue(valueValue) - .setOptionalSingularInt32(optionalSingularInt32) - .setBoolValue(boolValue) - .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue) - .setOptionalSingularDouble(optionalSingularDouble) - .addAllRequiredRepeatedString(requiredRepeatedString) - .setRequiredInt32Value(requiredInt32Value) - .addAllOptionalRepeatedFloat(optionalRepeatedFloat) - .setUint64Value(uint64Value) - .addAllRequiredRepeatedEnum(requiredRepeatedEnum) - .setRequiredValueValue(requiredValueValue) - .addAllRequiredRepeatedInt32(requiredRepeatedInt32) - .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) - .setStringValue(stringValue) - .setTimeValue(timeValue) - .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof) - .setRequiredSingularDouble(requiredSingularDouble) - .setRequiredSingularBytes(requiredSingularBytes) - .setOptionalSingularFixed64(optionalSingularFixed64) - .setRequiredSingularEnum(requiredSingularEnum) - .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue) - .setRequiredSingularInt32(requiredSingularInt32) - .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName) - .setRequiredTimeValue(requiredTimeValue) - .setRequiredSingularFixed32(requiredSingularFixed32) - .setUint32Value(uint32Value) - .setRequiredStructValue(requiredStructValue) - .addAllRepeatedDurationValue(repeatedDurationValue) - .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue) - .setBytesValue(bytesValue) - .addAllRepeatedValueValue(repeatedValueValue) - .setRequiredStringValue(requiredStringValue) - .addAllRepeatedStringValue(repeatedStringValue) - .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue) - .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) - .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof) - .setRequiredSingularInt64(requiredSingularInt64) - .addAllOptionalRepeatedEnum(optionalRepeatedEnum) - .setRequiredFieldMaskValue(requiredFieldMaskValue) - .addAllRepeatedTimeValue(repeatedTimeValue) - .addAllRepeatedStructValue(repeatedStructValue) - .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue) - .addAllRepeatedBytesValue(repeatedBytesValue) - .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value) - .setRequiredListValueValue(requiredListValueValue) - .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue) - .setOptionalSingularEnum(optionalSingularEnum) - .setInt64Value(int64Value) - .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) - .addAllOptionalRepeatedInt32(optionalRepeatedInt32) - .addAllRepeatedBoolValue(repeatedBoolValue) - .setFloatValue(floatValue) - .setRequiredUint32Value(requiredUint32Value) - .addAllRequiredRepeatedDouble(requiredRepeatedDouble) - .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value) - .setDurationValue(durationValue) - .build(); - return testOptionalRequiredFlatteningParams(request); + public final UnaryCallable privateListShelvesCallable() { + return stub.privateListShelvesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test optional flattening parameters of all types - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   int requiredSingularInt32 = 0;
-   *   long requiredSingularInt64 = 0L;
-   *   float requiredSingularFloat = 0.0F;
-   *   double requiredSingularDouble = 0.0;
-   *   boolean requiredSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String requiredSingularString = "";
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String requiredSingularResourceNameCommon = "";
-   *   int requiredSingularFixed32 = 0;
-   *   long requiredSingularFixed64 = 0L;
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceName = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder()
-   *     .setRequiredSingularInt32(requiredSingularInt32)
-   *     .setRequiredSingularInt64(requiredSingularInt64)
-   *     .setRequiredSingularFloat(requiredSingularFloat)
-   *     .setRequiredSingularDouble(requiredSingularDouble)
-   *     .setRequiredSingularBool(requiredSingularBool)
-   *     .setRequiredSingularEnum(requiredSingularEnum)
-   *     .setRequiredSingularString(requiredSingularString)
-   *     .setRequiredSingularBytes(requiredSingularBytes)
-   *     .setRequiredSingularMessage(requiredSingularMessage)
-   *     .setRequiredSingularResourceName(requiredSingularResourceName.toString())
-   *     .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString())
-   *     .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon)
-   *     .setRequiredSingularFixed32(requiredSingularFixed32)
-   *     .setRequiredSingularFixed64(requiredSingularFixed64)
-   *     .addAllRequiredRepeatedInt32(requiredRepeatedInt32)
-   *     .addAllRequiredRepeatedInt64(requiredRepeatedInt64)
-   *     .addAllRequiredRepeatedFloat(requiredRepeatedFloat)
-   *     .addAllRequiredRepeatedDouble(requiredRepeatedDouble)
-   *     .addAllRequiredRepeatedBool(requiredRepeatedBool)
-   *     .addAllRequiredRepeatedEnum(requiredRepeatedEnum)
-   *     .addAllRequiredRepeatedString(requiredRepeatedString)
-   *     .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
-   *     .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
-   *     .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName))
-   *     .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof))
-   *     .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
-   *     .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
-   *     .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
-   *     .putAllRequiredMap(requiredMap)
-   *     .setRequiredAnyValue(requiredAnyValue)
-   *     .setRequiredStructValue(requiredStructValue)
-   *     .setRequiredValueValue(requiredValueValue)
-   *     .setRequiredListValueValue(requiredListValueValue)
-   *     .setRequiredTimeValue(requiredTimeValue)
-   *     .setRequiredDurationValue(requiredDurationValue)
-   *     .setRequiredFieldMaskValue(requiredFieldMaskValue)
-   *     .setRequiredInt32Value(requiredInt32Value)
-   *     .setRequiredUint32Value(requiredUint32Value)
-   *     .setRequiredInt64Value(requiredInt64Value)
-   *     .setRequiredUint64Value(requiredUint64Value)
-   *     .setRequiredFloatValue(requiredFloatValue)
-   *     .setRequiredDoubleValue(requiredDoubleValue)
-   *     .setRequiredStringValue(requiredStringValue)
-   *     .setRequiredBoolValue(requiredBoolValue)
-   *     .setRequiredBytesValue(requiredBytesValue)
-   *     .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue)
-   *     .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue)
-   *     .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue)
-   *     .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue)
-   *     .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue)
-   *     .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue)
-   *     .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue)
-   *     .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value)
-   *     .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value)
-   *     .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value)
-   *     .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value)
-   *     .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue)
-   *     .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue)
-   *     .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue)
-   *     .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue)
-   *     .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue)
-   *     .build();
-   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest request) { - return testOptionalRequiredFlatteningParamsCallable().call(request); + @Override + public final void close() { + stub.close(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test optional flattening parameters of all types - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   int requiredSingularInt32 = 0;
-   *   long requiredSingularInt64 = 0L;
-   *   float requiredSingularFloat = 0.0F;
-   *   double requiredSingularDouble = 0.0;
-   *   boolean requiredSingularBool = false;
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO;
-   *   String requiredSingularString = "";
-   *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
-   *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   String requiredSingularResourceNameCommon = "";
-   *   int requiredSingularFixed32 = 0;
-   *   long requiredSingularFixed64 = 0L;
-   *   List<Integer> requiredRepeatedInt32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedInt64 = new ArrayList<>();
-   *   List<Float> requiredRepeatedFloat = new ArrayList<>();
-   *   List<Double> requiredRepeatedDouble = new ArrayList<>();
-   *   List<Boolean> requiredRepeatedBool = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerEnum> requiredRepeatedEnum = new ArrayList<>();
-   *   List<String> requiredRepeatedString = new ArrayList<>();
-   *   List<ByteString> requiredRepeatedBytes = new ArrayList<>();
-   *   List<TestOptionalRequiredFlatteningParamsRequest.InnerMessage> requiredRepeatedMessage = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceName = new ArrayList<>();
-   *   List<BookName> requiredRepeatedResourceNameOneof = new ArrayList<>();
-   *   List<String> requiredRepeatedResourceNameCommon = new ArrayList<>();
-   *   List<Integer> requiredRepeatedFixed32 = new ArrayList<>();
-   *   List<Long> requiredRepeatedFixed64 = new ArrayList<>();
-   *   Map<Integer, String> requiredMap = new HashMap<>();
-   *   Any requiredAnyValue = Any.newBuilder().build();
-   *   Struct requiredStructValue = Struct.newBuilder().build();
-   *   Value requiredValueValue = Value.newBuilder().build();
-   *   ListValue requiredListValueValue = ListValue.newBuilder().build();
-   *   Timestamp requiredTimeValue = Timestamp.newBuilder().build();
-   *   Duration requiredDurationValue = Duration.newBuilder().build();
-   *   FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build();
-   *   Int32Value requiredInt32Value = Int32Value.newBuilder().build();
-   *   UInt32Value requiredUint32Value = UInt32Value.newBuilder().build();
-   *   Int64Value requiredInt64Value = Int64Value.newBuilder().build();
-   *   UInt64Value requiredUint64Value = UInt64Value.newBuilder().build();
-   *   FloatValue requiredFloatValue = FloatValue.newBuilder().build();
-   *   DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build();
-   *   StringValue requiredStringValue = StringValue.newBuilder().build();
-   *   BoolValue requiredBoolValue = BoolValue.newBuilder().build();
-   *   BytesValue requiredBytesValue = BytesValue.newBuilder().build();
-   *   List<Any> requiredRepeatedAnyValue = new ArrayList<>();
-   *   List<Struct> requiredRepeatedStructValue = new ArrayList<>();
-   *   List<Value> requiredRepeatedValueValue = new ArrayList<>();
-   *   List<ListValue> requiredRepeatedListValueValue = new ArrayList<>();
-   *   List<Timestamp> requiredRepeatedTimeValue = new ArrayList<>();
-   *   List<Duration> requiredRepeatedDurationValue = new ArrayList<>();
-   *   List<FieldMask> requiredRepeatedFieldMaskValue = new ArrayList<>();
-   *   List<Int32Value> requiredRepeatedInt32Value = new ArrayList<>();
-   *   List<UInt32Value> requiredRepeatedUint32Value = new ArrayList<>();
-   *   List<Int64Value> requiredRepeatedInt64Value = new ArrayList<>();
-   *   List<UInt64Value> requiredRepeatedUint64Value = new ArrayList<>();
-   *   List<FloatValue> requiredRepeatedFloatValue = new ArrayList<>();
-   *   List<DoubleValue> requiredRepeatedDoubleValue = new ArrayList<>();
-   *   List<StringValue> requiredRepeatedStringValue = new ArrayList<>();
-   *   List<BoolValue> requiredRepeatedBoolValue = new ArrayList<>();
-   *   List<BytesValue> requiredRepeatedBytesValue = new ArrayList<>();
-   *   TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder()
-   *     .setRequiredSingularInt32(requiredSingularInt32)
-   *     .setRequiredSingularInt64(requiredSingularInt64)
-   *     .setRequiredSingularFloat(requiredSingularFloat)
-   *     .setRequiredSingularDouble(requiredSingularDouble)
-   *     .setRequiredSingularBool(requiredSingularBool)
-   *     .setRequiredSingularEnum(requiredSingularEnum)
-   *     .setRequiredSingularString(requiredSingularString)
-   *     .setRequiredSingularBytes(requiredSingularBytes)
-   *     .setRequiredSingularMessage(requiredSingularMessage)
-   *     .setRequiredSingularResourceName(requiredSingularResourceName.toString())
-   *     .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof.toString())
-   *     .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon)
-   *     .setRequiredSingularFixed32(requiredSingularFixed32)
-   *     .setRequiredSingularFixed64(requiredSingularFixed64)
-   *     .addAllRequiredRepeatedInt32(requiredRepeatedInt32)
-   *     .addAllRequiredRepeatedInt64(requiredRepeatedInt64)
-   *     .addAllRequiredRepeatedFloat(requiredRepeatedFloat)
-   *     .addAllRequiredRepeatedDouble(requiredRepeatedDouble)
-   *     .addAllRequiredRepeatedBool(requiredRepeatedBool)
-   *     .addAllRequiredRepeatedEnum(requiredRepeatedEnum)
-   *     .addAllRequiredRepeatedString(requiredRepeatedString)
-   *     .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
-   *     .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
-   *     .addAllRequiredRepeatedResourceName(BookName.toStringList(requiredRepeatedResourceName))
-   *     .addAllRequiredRepeatedResourceNameOneof(BookName.toStringList(requiredRepeatedResourceNameOneof))
-   *     .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
-   *     .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
-   *     .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
-   *     .putAllRequiredMap(requiredMap)
-   *     .setRequiredAnyValue(requiredAnyValue)
-   *     .setRequiredStructValue(requiredStructValue)
-   *     .setRequiredValueValue(requiredValueValue)
-   *     .setRequiredListValueValue(requiredListValueValue)
-   *     .setRequiredTimeValue(requiredTimeValue)
-   *     .setRequiredDurationValue(requiredDurationValue)
-   *     .setRequiredFieldMaskValue(requiredFieldMaskValue)
-   *     .setRequiredInt32Value(requiredInt32Value)
-   *     .setRequiredUint32Value(requiredUint32Value)
-   *     .setRequiredInt64Value(requiredInt64Value)
-   *     .setRequiredUint64Value(requiredUint64Value)
-   *     .setRequiredFloatValue(requiredFloatValue)
-   *     .setRequiredDoubleValue(requiredDoubleValue)
-   *     .setRequiredStringValue(requiredStringValue)
-   *     .setRequiredBoolValue(requiredBoolValue)
-   *     .setRequiredBytesValue(requiredBytesValue)
-   *     .addAllRequiredRepeatedAnyValue(requiredRepeatedAnyValue)
-   *     .addAllRequiredRepeatedStructValue(requiredRepeatedStructValue)
-   *     .addAllRequiredRepeatedValueValue(requiredRepeatedValueValue)
-   *     .addAllRequiredRepeatedListValueValue(requiredRepeatedListValueValue)
-   *     .addAllRequiredRepeatedTimeValue(requiredRepeatedTimeValue)
-   *     .addAllRequiredRepeatedDurationValue(requiredRepeatedDurationValue)
-   *     .addAllRequiredRepeatedFieldMaskValue(requiredRepeatedFieldMaskValue)
-   *     .addAllRequiredRepeatedInt32Value(requiredRepeatedInt32Value)
-   *     .addAllRequiredRepeatedUint32Value(requiredRepeatedUint32Value)
-   *     .addAllRequiredRepeatedInt64Value(requiredRepeatedInt64Value)
-   *     .addAllRequiredRepeatedUint64Value(requiredRepeatedUint64Value)
-   *     .addAllRequiredRepeatedFloatValue(requiredRepeatedFloatValue)
-   *     .addAllRequiredRepeatedDoubleValue(requiredRepeatedDoubleValue)
-   *     .addAllRequiredRepeatedStringValue(requiredRepeatedStringValue)
-   *     .addAllRequiredRepeatedBoolValue(requiredRepeatedBoolValue)
-   *     .addAllRequiredRepeatedBytesValue(requiredRepeatedBytesValue)
-   *     .build();
-   *   ApiFuture<TestOptionalRequiredFlatteningParamsResponse> future = libraryClient.testOptionalRequiredFlatteningParamsCallable().futureCall(request);
-   *   // Do something
-   *   TestOptionalRequiredFlatteningParamsResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable testOptionalRequiredFlatteningParamsCallable() { - return stub.testOptionalRequiredFlatteningParamsCallable(); + @Override + public void shutdown() { + stub.shutdown(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Publisher element : libraryClient.listPublishers(additionalDestinations, parent, destination.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param additionalDestinations - * @param parent - * @param destination - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(List additionalDestinations, String parent, String destination) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .setDestination(destination) - .build(); - return listPublishers(request); + @Override + public boolean isShutdown() { + return stub.isShutdown(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Publisher element : libraryClient.listPublishers(additionalDestinations, parent, destination.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param additionalDestinations - * @param parent - * @param destination - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(List additionalDestinations, String parent, String destination) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .setDestination(destination) - .build(); - return listPublishers(request); + @Override + public boolean isTerminated() { + return stub.isTerminated(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String destination = "";
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); + @Override + public void shutdownNow() { + stub.shutdownNow(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName destination = ProjectName.of("[PROJECT]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } + public static class ListShelvesPagedResponse extends AbstractPagedListResponse< + ListShelvesRequest, + ListShelvesResponse, + Shelf, + ListShelvesPage, + ListShelvesFixedSizeCollection> { - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   OrganizationName destination = OrganizationName.of("[ORGANIZATION]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   FolderName destination = FolderName.of("[FOLDER]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchivedBookName destination = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BillingAccountName destination = BillingAccountName.of("[BILLING_ACCOUNT]");
-   *   List<String> additionalDestinations = new ArrayList<>();
-   *   String parent = "";
-   *   for (Publisher element : libraryClient.listPublishers(destination.toString(), additionalDestinations, parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param destination - * @param additionalDestinations - * @param parent - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(String destination, List additionalDestinations, String parent) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) - .setParent(parent) - .build(); - return listPublishers(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String parent = "";
-   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   for (Publisher element : libraryClient.listPublishers(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(ListPublishersRequest request) { - return listPublishersPagedCallable() - .call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String parent = "";
-   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   ApiFuture<ListPublishersPagedResponse> future = libraryClient.listPublishersPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Publisher element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- */ - public final UnaryCallable listPublishersPagedCallable() { - return stub.listPublishersPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   String parent = "";
-   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   while (true) {
-   *     ListPublishersResponse response = libraryClient.listPublishersCallable().call(request);
-   *     for (Publisher element : response.getPublishersList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
- */ - public final UnaryCallable listPublishersCallable() { - return stub.listPublishersCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * This method is not exposed in the GAPIC config. It should be generated. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
-   *   Book response = libraryClient.privateListShelves(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Book privateListShelves(ListShelvesRequest request) { - return privateListShelvesCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * This method is not exposed in the GAPIC config. It should be generated. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
-   *   ApiFuture<Book> future = libraryClient.privateListShelvesCallable().futureCall(request);
-   *   // Do something
-   *   Book response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable privateListShelvesCallable() { - return stub.privateListShelvesCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } - - public static class ListShelvesPagedResponse extends AbstractPagedListResponse< - ListShelvesRequest, - ListShelvesResponse, - Shelf, - ListShelvesPage, - ListShelvesFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListShelvesPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListShelvesPagedResponse apply(ListShelvesPage input) { - return new ListShelvesPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); - } - - private ListShelvesPagedResponse(ListShelvesPage page) { - super(page, ListShelvesFixedSizeCollection.createEmptyCollection()); - } + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListShelvesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListShelvesPagedResponse apply(ListShelvesPage input) { + return new ListShelvesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListShelvesPagedResponse(ListShelvesPage page) { + super(page, ListShelvesFixedSizeCollection.createEmptyCollection()); + } } @@ -11626,7 +10377,6 @@ import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; -import com.google.example.library.v1.BillingAccountName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; import com.google.example.library.v1.BookFromArchive; @@ -11637,7 +10387,6 @@ import com.google.example.library.v1.CreateShelfRequest; import com.google.example.library.v1.DeleteBookRequest; import com.google.example.library.v1.DeleteShelfRequest; import com.google.example.library.v1.DiscussBookRequest; -import com.google.example.library.v1.FieldMask; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.FolderName; @@ -11664,7 +10413,6 @@ import com.google.example.library.v1.ListStringsResponse; import com.google.example.library.v1.LocationName; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; -import com.google.example.library.v1.OrganizationName; import com.google.example.library.v1.ProjectName; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; @@ -11692,6 +10440,7 @@ import com.google.protobuf.BytesValue; import com.google.protobuf.DoubleValue; import com.google.protobuf.Duration; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import com.google.protobuf.FloatValue; import com.google.protobuf.Int32Value; import com.google.protobuf.Int64Value; @@ -11815,7 +10564,6 @@ import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; -import com.google.example.library.v1.BillingAccountName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; import com.google.example.library.v1.BookFromArchive; @@ -11826,7 +10574,6 @@ import com.google.example.library.v1.CreateShelfRequest; import com.google.example.library.v1.DeleteBookRequest; import com.google.example.library.v1.DeleteShelfRequest; import com.google.example.library.v1.DiscussBookRequest; -import com.google.example.library.v1.FieldMask; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.FolderName; @@ -11853,7 +10600,6 @@ import com.google.example.library.v1.ListStringsResponse; import com.google.example.library.v1.LocationName; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; -import com.google.example.library.v1.OrganizationName; import com.google.example.library.v1.ProjectName; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; @@ -11880,6 +10626,7 @@ import com.google.protobuf.BytesValue; import com.google.protobuf.DoubleValue; import com.google.protobuf.Duration; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import com.google.protobuf.FloatValue; import com.google.protobuf.Int32Value; import com.google.protobuf.Int64Value; @@ -12476,5146 +11223,2841 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setMethodDescriptor(listPublishersMethodDescriptor) .build(); GrpcCallSettings privateListShelvesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(privateListShelvesMethodDescriptor) - .build(); - - this.createShelfCallable = callableFactory.createUnaryCallable(createShelfTransportSettings,settings.createShelfSettings(), clientContext); - this.getShelfCallable = callableFactory.createUnaryCallable(getShelfTransportSettings,settings.getShelfSettings(), clientContext); - this.listShelvesCallable = callableFactory.createUnaryCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); - this.listShelvesPagedCallable = callableFactory.createPagedCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); - this.deleteShelfCallable = callableFactory.createUnaryCallable(deleteShelfTransportSettings,settings.deleteShelfSettings(), clientContext); - this.mergeShelvesCallable = callableFactory.createUnaryCallable(mergeShelvesTransportSettings,settings.mergeShelvesSettings(), clientContext); - this.createBookCallable = callableFactory.createUnaryCallable(createBookTransportSettings,settings.createBookSettings(), clientContext); - this.publishSeriesCallable = callableFactory.createBatchingCallable(publishSeriesTransportSettings,settings.publishSeriesSettings(), clientContext); - this.getBookCallable = callableFactory.createUnaryCallable(getBookTransportSettings,settings.getBookSettings(), clientContext); - this.listBooksCallable = callableFactory.createUnaryCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); - this.listBooksPagedCallable = callableFactory.createPagedCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); - this.deleteBookCallable = callableFactory.createUnaryCallable(deleteBookTransportSettings,settings.deleteBookSettings(), clientContext); - this.updateBookCallable = callableFactory.createUnaryCallable(updateBookTransportSettings,settings.updateBookSettings(), clientContext); - this.moveBookCallable = callableFactory.createUnaryCallable(moveBookTransportSettings,settings.moveBookSettings(), clientContext); - this.listStringsCallable = callableFactory.createUnaryCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); - this.listStringsPagedCallable = callableFactory.createPagedCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); - this.addCommentsCallable = callableFactory.createBatchingCallable(addCommentsTransportSettings,settings.addCommentsSettings(), clientContext); - this.getBookFromArchiveCallable = callableFactory.createUnaryCallable(getBookFromArchiveTransportSettings,settings.getBookFromArchiveSettings(), clientContext); - this.getBookFromAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAnywhereTransportSettings,settings.getBookFromAnywhereSettings(), clientContext); - this.getBookFromAbsolutelyAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAbsolutelyAnywhereTransportSettings,settings.getBookFromAbsolutelyAnywhereSettings(), clientContext); - this.updateBookIndexCallable = callableFactory.createUnaryCallable(updateBookIndexTransportSettings,settings.updateBookIndexSettings(), clientContext); - this.streamShelvesCallable = callableFactory.createServerStreamingCallable(streamShelvesTransportSettings,settings.streamShelvesSettings(), clientContext); - this.streamBooksCallable = callableFactory.createServerStreamingCallable(streamBooksTransportSettings,settings.streamBooksSettings(), clientContext); - this.discussBookCallable = callableFactory.createBidiStreamingCallable(discussBookTransportSettings,settings.discussBookSettings(), clientContext); - this.monologAboutBookCallable = callableFactory.createClientStreamingCallable(monologAboutBookTransportSettings,settings.monologAboutBookSettings(), clientContext); - this.babbleAboutBookCallable = callableFactory.createClientStreamingCallable(babbleAboutBookTransportSettings,settings.babbleAboutBookSettings(), clientContext); - this.findRelatedBooksCallable = callableFactory.createUnaryCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); - this.findRelatedBooksPagedCallable = callableFactory.createPagedCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); - this.addLabelCallable = callableFactory.createUnaryCallable(addLabelTransportSettings,settings.addLabelSettings(), clientContext); - this.getBigBookCallable = callableFactory.createUnaryCallable(getBigBookTransportSettings,settings.getBigBookSettings(), clientContext); - this.getBigBookOperationCallable = callableFactory.createOperationCallable( - getBigBookTransportSettings,settings.getBigBookOperationSettings(), clientContext, this.operationsStub); - this.getBigNothingCallable = callableFactory.createUnaryCallable(getBigNothingTransportSettings,settings.getBigNothingSettings(), clientContext); - this.getBigNothingOperationCallable = callableFactory.createOperationCallable( - getBigNothingTransportSettings,settings.getBigNothingOperationSettings(), clientContext, this.operationsStub); - this.testOptionalRequiredFlatteningParamsCallable = callableFactory.createUnaryCallable(testOptionalRequiredFlatteningParamsTransportSettings,settings.testOptionalRequiredFlatteningParamsSettings(), clientContext); - this.listPublishersCallable = callableFactory.createUnaryCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); - this.listPublishersPagedCallable = callableFactory.createPagedCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); - this.privateListShelvesCallable = callableFactory.createUnaryCallable(privateListShelvesTransportSettings,settings.privateListShelvesSettings(), clientContext); - - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - public UnaryCallable createShelfCallable() { - return createShelfCallable; - } - - public UnaryCallable getShelfCallable() { - return getShelfCallable; - } - - public UnaryCallable listShelvesPagedCallable() { - return listShelvesPagedCallable; - } - - public UnaryCallable listShelvesCallable() { - return listShelvesCallable; - } - - public UnaryCallable deleteShelfCallable() { - return deleteShelfCallable; - } - - public UnaryCallable mergeShelvesCallable() { - return mergeShelvesCallable; - } - - public UnaryCallable createBookCallable() { - return createBookCallable; - } - - public UnaryCallable publishSeriesCallable() { - return publishSeriesCallable; - } - - public UnaryCallable getBookCallable() { - return getBookCallable; - } - - public UnaryCallable listBooksPagedCallable() { - return listBooksPagedCallable; - } - - public UnaryCallable listBooksCallable() { - return listBooksCallable; - } - - public UnaryCallable deleteBookCallable() { - return deleteBookCallable; - } - - public UnaryCallable updateBookCallable() { - return updateBookCallable; - } - - public UnaryCallable moveBookCallable() { - return moveBookCallable; - } - - public UnaryCallable listStringsPagedCallable() { - return listStringsPagedCallable; - } - - public UnaryCallable listStringsCallable() { - return listStringsCallable; - } - - public UnaryCallable addCommentsCallable() { - return addCommentsCallable; - } - - public UnaryCallable getBookFromArchiveCallable() { - return getBookFromArchiveCallable; - } - - public UnaryCallable getBookFromAnywhereCallable() { - return getBookFromAnywhereCallable; - } - - public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { - return getBookFromAbsolutelyAnywhereCallable; - } - - public UnaryCallable updateBookIndexCallable() { - return updateBookIndexCallable; - } - - public ServerStreamingCallable streamShelvesCallable() { - return streamShelvesCallable; - } - - public ServerStreamingCallable streamBooksCallable() { - return streamBooksCallable; - } - - public BidiStreamingCallable discussBookCallable() { - return discussBookCallable; - } - - public ClientStreamingCallable monologAboutBookCallable() { - return monologAboutBookCallable; - } - - public ClientStreamingCallable babbleAboutBookCallable() { - return babbleAboutBookCallable; - } - - public UnaryCallable findRelatedBooksPagedCallable() { - return findRelatedBooksPagedCallable; - } - - public UnaryCallable findRelatedBooksCallable() { - return findRelatedBooksCallable; - } - - @Deprecated - public UnaryCallable addLabelCallable() { - return addLabelCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigBookOperationCallable() { - return getBigBookOperationCallable; - } - - public UnaryCallable getBigBookCallable() { - return getBigBookCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigNothingOperationCallable() { - return getBigNothingOperationCallable; - } - - public UnaryCallable getBigNothingCallable() { - return getBigNothingCallable; - } - - public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { - return testOptionalRequiredFlatteningParamsCallable; - } - - public UnaryCallable listPublishersPagedCallable() { - return listPublishersPagedCallable; - } - - public UnaryCallable listPublishersCallable() { - return listPublishersCallable; - } - - public UnaryCallable privateListShelvesCallable() { - return privateListShelvesCallable; - } - - @Override - public final void close() { - shutdown(); - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } - -} -============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoCallableFactory.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.example.library.v1.MyProtoSettings; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC callable factory implementation for Google Example Library API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") -public class GrpcMyProtoCallableFactory implements GrpcStubCallableFactory { - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, pagedCallSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable(grpcCallSettings, batchingCallSettings, clientContext); - } - - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - @Override - public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, - ClientContext clientContext, OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable(grpcCallSettings, operationCallSettings, clientContext, operationsStub); - } - - @Override - public BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); - } - - @Override - public ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); - } - - @Override - public ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); - } -} -============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoStub.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsExtractor; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.example.library.v1.MyProtoSettings; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC stub implementation for Google Example Library API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public class GrpcMyProtoStub extends MyProtoStub { - - private static final MethodDescriptor myMethodMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.MyProto/MyMethod") - .setRequestMarshaller(ProtoUtils.marshaller(MethodRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(MethodResponse.getDefaultInstance())) - .build(); - - - private final BackgroundResource backgroundResources; - - private final UnaryCallable myMethodCallable; - - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcMyProtoStub create(MyProtoStubSettings settings) throws IOException { - return new GrpcMyProtoStub(settings, ClientContext.create(settings)); - } - - public static final GrpcMyProtoStub create(ClientContext clientContext) throws IOException { - return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcMyProtoStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcMyProtoStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new GrpcMyProtoCallableFactory()); - } - - /** - * Constructs an instance of GrpcMyProtoStub, using the given settings. - * This is protected so that it is easy to make a subclass, but otherwise, the static - * factory methods should be preferred. - */ - protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - this.callableFactory = callableFactory; - - GrpcCallSettings myMethodTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(myMethodMethodDescriptor) - .build(); - - this.myMethodCallable = callableFactory.createUnaryCallable(myMethodTransportSettings,settings.myMethodSettings(), clientContext); - - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - - public UnaryCallable myMethodCallable() { - return myMethodCallable; - } - - @Override - public final void close() { - shutdown(); - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } - -} -============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStub.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.resourcenames.ResourceName; -import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.ArchiveName; -import com.google.example.library.v1.ArchivedBookName; -import com.google.example.library.v1.BillingAccountName; -import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromAnywhere; -import com.google.example.library.v1.BookFromArchive; -import com.google.example.library.v1.BookName; -import com.google.example.library.v1.Comment; -import com.google.example.library.v1.CreateBookRequest; -import com.google.example.library.v1.CreateShelfRequest; -import com.google.example.library.v1.DeleteBookRequest; -import com.google.example.library.v1.DeleteShelfRequest; -import com.google.example.library.v1.DiscussBookRequest; -import com.google.example.library.v1.FieldMask; -import com.google.example.library.v1.FindRelatedBooksRequest; -import com.google.example.library.v1.FindRelatedBooksResponse; -import com.google.example.library.v1.FolderName; -import com.google.example.library.v1.GetBigBookMetadata; -import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; -import com.google.example.library.v1.GetBookFromAnywhereRequest; -import com.google.example.library.v1.GetBookFromArchiveRequest; -import com.google.example.library.v1.GetBookRequest; -import com.google.example.library.v1.GetShelfRequest; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.ListBooksRequest; -import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListPublishersRequest; -import com.google.example.library.v1.ListPublishersResponse; -import com.google.example.library.v1.ListShelvesRequest; -import com.google.example.library.v1.ListShelvesResponse; -import com.google.example.library.v1.ListStringsRequest; -import com.google.example.library.v1.ListStringsResponse; -import com.google.example.library.v1.LocationName; -import com.google.example.library.v1.MergeShelvesRequest; -import com.google.example.library.v1.MoveBookRequest; -import com.google.example.library.v1.OrganizationName; -import com.google.example.library.v1.ProjectName; -import com.google.example.library.v1.PublishSeriesRequest; -import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.Publisher; -import com.google.example.library.v1.PublisherName; -import com.google.example.library.v1.SeriesUuid; -import com.google.example.library.v1.Shelf; -import com.google.example.library.v1.ShelfName; -import com.google.example.library.v1.SomeMessage; -import com.google.example.library.v1.StreamBooksRequest; -import com.google.example.library.v1.StreamShelvesRequest; -import com.google.example.library.v1.StreamShelvesResponse; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; -import com.google.example.library.v1.UpdateBookIndexRequest; -import com.google.example.library.v1.UpdateBookRequest; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.protobuf.Any; -import com.google.protobuf.BoolValue; -import com.google.protobuf.ByteString; -import com.google.protobuf.BytesValue; -import com.google.protobuf.DoubleValue; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FloatValue; -import com.google.protobuf.Int32Value; -import com.google.protobuf.Int64Value; -import com.google.protobuf.ListValue; -import com.google.protobuf.StringValue; -import com.google.protobuf.Struct; -import com.google.protobuf.Timestamp; -import com.google.protobuf.UInt32Value; -import com.google.protobuf.UInt64Value; -import com.google.protobuf.Value; -import com.google.tagger.v1.TaggerProto.AddLabelRequest; -import com.google.tagger.v1.TaggerProto.AddLabelResponse; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Base stub class for Google Example Library API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public abstract class LibraryServiceStub implements BackgroundResource { - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); - } - - public UnaryCallable createShelfCallable() { - throw new UnsupportedOperationException("Not implemented: createShelfCallable()"); - } - - public UnaryCallable getShelfCallable() { - throw new UnsupportedOperationException("Not implemented: getShelfCallable()"); - } - - public UnaryCallable listShelvesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listShelvesPagedCallable()"); - } - - public UnaryCallable listShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: listShelvesCallable()"); - } - - public UnaryCallable deleteShelfCallable() { - throw new UnsupportedOperationException("Not implemented: deleteShelfCallable()"); - } - - public UnaryCallable mergeShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: mergeShelvesCallable()"); - } - - public UnaryCallable createBookCallable() { - throw new UnsupportedOperationException("Not implemented: createBookCallable()"); - } - - public UnaryCallable publishSeriesCallable() { - throw new UnsupportedOperationException("Not implemented: publishSeriesCallable()"); - } - - public UnaryCallable getBookCallable() { - throw new UnsupportedOperationException("Not implemented: getBookCallable()"); - } - - public UnaryCallable listBooksPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listBooksPagedCallable()"); - } - - public UnaryCallable listBooksCallable() { - throw new UnsupportedOperationException("Not implemented: listBooksCallable()"); - } - - public UnaryCallable deleteBookCallable() { - throw new UnsupportedOperationException("Not implemented: deleteBookCallable()"); - } - - public UnaryCallable updateBookCallable() { - throw new UnsupportedOperationException("Not implemented: updateBookCallable()"); - } - - public UnaryCallable moveBookCallable() { - throw new UnsupportedOperationException("Not implemented: moveBookCallable()"); - } - - public UnaryCallable listStringsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listStringsPagedCallable()"); - } - - public UnaryCallable listStringsCallable() { - throw new UnsupportedOperationException("Not implemented: listStringsCallable()"); - } - - public UnaryCallable addCommentsCallable() { - throw new UnsupportedOperationException("Not implemented: addCommentsCallable()"); - } - - public UnaryCallable getBookFromArchiveCallable() { - throw new UnsupportedOperationException("Not implemented: getBookFromArchiveCallable()"); - } - - public UnaryCallable getBookFromAnywhereCallable() { - throw new UnsupportedOperationException("Not implemented: getBookFromAnywhereCallable()"); - } - - public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { - throw new UnsupportedOperationException("Not implemented: getBookFromAbsolutelyAnywhereCallable()"); - } - - public UnaryCallable updateBookIndexCallable() { - throw new UnsupportedOperationException("Not implemented: updateBookIndexCallable()"); - } - - public ServerStreamingCallable streamShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: streamShelvesCallable()"); - } - - public ServerStreamingCallable streamBooksCallable() { - throw new UnsupportedOperationException("Not implemented: streamBooksCallable()"); - } - - public BidiStreamingCallable discussBookCallable() { - throw new UnsupportedOperationException("Not implemented: discussBookCallable()"); - } - - public ClientStreamingCallable monologAboutBookCallable() { - throw new UnsupportedOperationException("Not implemented: monologAboutBookCallable()"); - } - - public ClientStreamingCallable babbleAboutBookCallable() { - throw new UnsupportedOperationException("Not implemented: babbleAboutBookCallable()"); - } - - public UnaryCallable findRelatedBooksPagedCallable() { - throw new UnsupportedOperationException("Not implemented: findRelatedBooksPagedCallable()"); - } - - public UnaryCallable findRelatedBooksCallable() { - throw new UnsupportedOperationException("Not implemented: findRelatedBooksCallable()"); - } - - @Deprecated - public UnaryCallable addLabelCallable() { - throw new UnsupportedOperationException("Not implemented: addLabelCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigBookOperationCallable() { - throw new UnsupportedOperationException("Not implemented: getBigBookOperationCallable()"); - } - - public UnaryCallable getBigBookCallable() { - throw new UnsupportedOperationException("Not implemented: getBigBookCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable getBigNothingOperationCallable() { - throw new UnsupportedOperationException("Not implemented: getBigNothingOperationCallable()"); - } - - public UnaryCallable getBigNothingCallable() { - throw new UnsupportedOperationException("Not implemented: getBigNothingCallable()"); - } - - public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { - throw new UnsupportedOperationException("Not implemented: testOptionalRequiredFlatteningParamsCallable()"); - } - - public UnaryCallable listPublishersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listPublishersPagedCallable()"); - } - - public UnaryCallable listPublishersCallable() { - throw new UnsupportedOperationException("Not implemented: listPublishersCallable()"); - } - - public UnaryCallable privateListShelvesCallable() { - throw new UnsupportedOperationException("Not implemented: privateListShelvesCallable()"); - } - - @Override - public abstract void close(); -} -============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStubSettings.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.batching.BatchingSettings; -import com.google.api.gax.batching.FlowControlSettings; -import com.google.api.gax.batching.FlowController; -import com.google.api.gax.batching.FlowController.LimitExceededBehavior; -import com.google.api.gax.batching.PartitionKey; -import com.google.api.gax.batching.RequestBuilder; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.BatchedRequestIssuer; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BatchingDescriptor; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.auth.Credentials; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromAnywhere; -import com.google.example.library.v1.BookFromArchive; -import com.google.example.library.v1.Comment; -import com.google.example.library.v1.CreateBookRequest; -import com.google.example.library.v1.CreateShelfRequest; -import com.google.example.library.v1.DeleteBookRequest; -import com.google.example.library.v1.DeleteShelfRequest; -import com.google.example.library.v1.DiscussBookRequest; -import com.google.example.library.v1.FindRelatedBooksRequest; -import com.google.example.library.v1.FindRelatedBooksResponse; -import com.google.example.library.v1.GetBigBookMetadata; -import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; -import com.google.example.library.v1.GetBookFromAnywhereRequest; -import com.google.example.library.v1.GetBookFromArchiveRequest; -import com.google.example.library.v1.GetBookRequest; -import com.google.example.library.v1.GetShelfRequest; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.LibraryServiceGrpc; -import com.google.example.library.v1.ListBooksRequest; -import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListPublishersRequest; -import com.google.example.library.v1.ListPublishersResponse; -import com.google.example.library.v1.ListShelvesRequest; -import com.google.example.library.v1.ListShelvesResponse; -import com.google.example.library.v1.ListStringsRequest; -import com.google.example.library.v1.ListStringsResponse; -import com.google.example.library.v1.MergeShelvesRequest; -import com.google.example.library.v1.MoveBookRequest; -import com.google.example.library.v1.PublishSeriesRequest; -import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.Publisher; -import com.google.example.library.v1.Shelf; -import com.google.example.library.v1.StreamBooksRequest; -import com.google.example.library.v1.StreamShelvesRequest; -import com.google.example.library.v1.StreamShelvesResponse; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; -import com.google.example.library.v1.UpdateBookIndexRequest; -import com.google.example.library.v1.UpdateBookRequest; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.tagger.v1.LabelerGrpc; -import com.google.tagger.v1.TaggerProto.AddLabelRequest; -import com.google.tagger.v1.TaggerProto.AddLabelResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link LibraryServiceStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (library-example.googleapis.com) and default port (1234) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. - * - * For example, to set the total timeout of createShelf to 30 seconds: - * - *

- * 
- * LibraryServiceStubSettings.Builder librarySettingsBuilder =
- *     LibraryServiceStubSettings.newBuilder();
- * librarySettingsBuilder.createShelfSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * LibraryServiceStubSettings librarySettings = librarySettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -public class LibraryServiceStubSettings extends StubSettings { - /** - * The default scopes of the service. - */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-platform") - .add("https://www.googleapis.com/auth/library") - .build(); - - private final UnaryCallSettings createShelfSettings; - private final UnaryCallSettings getShelfSettings; - private final PagedCallSettings listShelvesSettings; - private final UnaryCallSettings deleteShelfSettings; - private final UnaryCallSettings mergeShelvesSettings; - private final UnaryCallSettings createBookSettings; - private final BatchingCallSettings publishSeriesSettings; - private final UnaryCallSettings getBookSettings; - private final PagedCallSettings listBooksSettings; - private final UnaryCallSettings deleteBookSettings; - private final UnaryCallSettings updateBookSettings; - private final UnaryCallSettings moveBookSettings; - private final PagedCallSettings listStringsSettings; - private final BatchingCallSettings addCommentsSettings; - private final UnaryCallSettings getBookFromArchiveSettings; - private final UnaryCallSettings getBookFromAnywhereSettings; - private final UnaryCallSettings getBookFromAbsolutelyAnywhereSettings; - private final UnaryCallSettings updateBookIndexSettings; - private final ServerStreamingCallSettings streamShelvesSettings; - private final ServerStreamingCallSettings streamBooksSettings; - private final StreamingCallSettings discussBookSettings; - private final StreamingCallSettings monologAboutBookSettings; - private final StreamingCallSettings babbleAboutBookSettings; - private final PagedCallSettings findRelatedBooksSettings; - private final UnaryCallSettings addLabelSettings; - private final UnaryCallSettings getBigBookSettings; - private final OperationCallSettings getBigBookOperationSettings; - private final UnaryCallSettings getBigNothingSettings; - private final OperationCallSettings getBigNothingOperationSettings; - private final UnaryCallSettings testOptionalRequiredFlatteningParamsSettings; - private final PagedCallSettings listPublishersSettings; - private final UnaryCallSettings privateListShelvesSettings; - - /** - * Returns the object with the settings used for calls to createShelf. - */ - public UnaryCallSettings createShelfSettings() { - return createShelfSettings; - } - - /** - * Returns the object with the settings used for calls to getShelf. - */ - public UnaryCallSettings getShelfSettings() { - return getShelfSettings; - } - - /** - * Returns the object with the settings used for calls to listShelves. - */ - public PagedCallSettings listShelvesSettings() { - return listShelvesSettings; - } - - /** - * Returns the object with the settings used for calls to deleteShelf. - */ - public UnaryCallSettings deleteShelfSettings() { - return deleteShelfSettings; - } - - /** - * Returns the object with the settings used for calls to mergeShelves. - */ - public UnaryCallSettings mergeShelvesSettings() { - return mergeShelvesSettings; - } - - /** - * Returns the object with the settings used for calls to createBook. - */ - public UnaryCallSettings createBookSettings() { - return createBookSettings; - } - - /** - * Returns the object with the settings used for calls to publishSeries. - */ - public BatchingCallSettings publishSeriesSettings() { - return publishSeriesSettings; - } - - /** - * Returns the object with the settings used for calls to getBook. - */ - public UnaryCallSettings getBookSettings() { - return getBookSettings; - } - - /** - * Returns the object with the settings used for calls to listBooks. - */ - public PagedCallSettings listBooksSettings() { - return listBooksSettings; - } - - /** - * Returns the object with the settings used for calls to deleteBook. - */ - public UnaryCallSettings deleteBookSettings() { - return deleteBookSettings; - } - - /** - * Returns the object with the settings used for calls to updateBook. - */ - public UnaryCallSettings updateBookSettings() { - return updateBookSettings; - } - - /** - * Returns the object with the settings used for calls to moveBook. - */ - public UnaryCallSettings moveBookSettings() { - return moveBookSettings; - } - - /** - * Returns the object with the settings used for calls to listStrings. - */ - public PagedCallSettings listStringsSettings() { - return listStringsSettings; - } - - /** - * Returns the object with the settings used for calls to addComments. - */ - public BatchingCallSettings addCommentsSettings() { - return addCommentsSettings; - } - - /** - * Returns the object with the settings used for calls to getBookFromArchive. - */ - public UnaryCallSettings getBookFromArchiveSettings() { - return getBookFromArchiveSettings; - } - - /** - * Returns the object with the settings used for calls to getBookFromAnywhere. - */ - public UnaryCallSettings getBookFromAnywhereSettings() { - return getBookFromAnywhereSettings; - } - - /** - * Returns the object with the settings used for calls to getBookFromAbsolutelyAnywhere. - */ - public UnaryCallSettings getBookFromAbsolutelyAnywhereSettings() { - return getBookFromAbsolutelyAnywhereSettings; - } - - /** - * Returns the object with the settings used for calls to updateBookIndex. - */ - public UnaryCallSettings updateBookIndexSettings() { - return updateBookIndexSettings; - } - - /** - * Returns the object with the settings used for calls to streamShelves. - */ - public ServerStreamingCallSettings streamShelvesSettings() { - return streamShelvesSettings; - } - - /** - * Returns the object with the settings used for calls to streamBooks. - */ - public ServerStreamingCallSettings streamBooksSettings() { - return streamBooksSettings; - } - - /** - * Returns the object with the settings used for calls to discussBook. - */ - public StreamingCallSettings discussBookSettings() { - return discussBookSettings; - } - - /** - * Returns the object with the settings used for calls to monologAboutBook. - */ - public StreamingCallSettings monologAboutBookSettings() { - return monologAboutBookSettings; - } - - /** - * Returns the object with the settings used for calls to babbleAboutBook. - */ - public StreamingCallSettings babbleAboutBookSettings() { - return babbleAboutBookSettings; - } - - /** - * Returns the object with the settings used for calls to findRelatedBooks. - */ - public PagedCallSettings findRelatedBooksSettings() { - return findRelatedBooksSettings; - } - - /** - * Returns the object with the settings used for calls to addLabel. - */ - public UnaryCallSettings addLabelSettings() { - return addLabelSettings; - } - - /** - * Returns the object with the settings used for calls to getBigBook. - */ - public UnaryCallSettings getBigBookSettings() { - return getBigBookSettings; - } - - /** - * Returns the object with the settings used for calls to getBigBook. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings getBigBookOperationSettings() { - return getBigBookOperationSettings; - } - - /** - * Returns the object with the settings used for calls to getBigNothing. - */ - public UnaryCallSettings getBigNothingSettings() { - return getBigNothingSettings; - } - - /** - * Returns the object with the settings used for calls to getBigNothing. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings getBigNothingOperationSettings() { - return getBigNothingOperationSettings; - } - - /** - * Returns the object with the settings used for calls to testOptionalRequiredFlatteningParams. - */ - public UnaryCallSettings testOptionalRequiredFlatteningParamsSettings() { - return testOptionalRequiredFlatteningParamsSettings; - } - - /** - * Returns the object with the settings used for calls to listPublishers. - */ - public PagedCallSettings listPublishersSettings() { - return listPublishersSettings; - } - - /** - * Returns the object with the settings used for calls to privateListShelves. - */ - public UnaryCallSettings privateListShelvesSettings() { - return privateListShelvesSettings; - } - - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public LibraryServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcLibraryServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); - } - } - - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return "library-example.googleapis.com:1234"; - } - - - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - ; - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LibraryServiceStubSettings.class)) - .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** - * Returns a builder containing all the values of this settings class. - */ - public Builder toBuilder() { - return new Builder(this); - } - - protected LibraryServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createShelfSettings = settingsBuilder.createShelfSettings().build(); - getShelfSettings = settingsBuilder.getShelfSettings().build(); - listShelvesSettings = settingsBuilder.listShelvesSettings().build(); - deleteShelfSettings = settingsBuilder.deleteShelfSettings().build(); - mergeShelvesSettings = settingsBuilder.mergeShelvesSettings().build(); - createBookSettings = settingsBuilder.createBookSettings().build(); - publishSeriesSettings = settingsBuilder.publishSeriesSettings().build(); - getBookSettings = settingsBuilder.getBookSettings().build(); - listBooksSettings = settingsBuilder.listBooksSettings().build(); - deleteBookSettings = settingsBuilder.deleteBookSettings().build(); - updateBookSettings = settingsBuilder.updateBookSettings().build(); - moveBookSettings = settingsBuilder.moveBookSettings().build(); - listStringsSettings = settingsBuilder.listStringsSettings().build(); - addCommentsSettings = settingsBuilder.addCommentsSettings().build(); - getBookFromArchiveSettings = settingsBuilder.getBookFromArchiveSettings().build(); - getBookFromAnywhereSettings = settingsBuilder.getBookFromAnywhereSettings().build(); - getBookFromAbsolutelyAnywhereSettings = settingsBuilder.getBookFromAbsolutelyAnywhereSettings().build(); - updateBookIndexSettings = settingsBuilder.updateBookIndexSettings().build(); - streamShelvesSettings = settingsBuilder.streamShelvesSettings().build(); - streamBooksSettings = settingsBuilder.streamBooksSettings().build(); - discussBookSettings = settingsBuilder.discussBookSettings().build(); - monologAboutBookSettings = settingsBuilder.monologAboutBookSettings().build(); - babbleAboutBookSettings = settingsBuilder.babbleAboutBookSettings().build(); - findRelatedBooksSettings = settingsBuilder.findRelatedBooksSettings().build(); - addLabelSettings = settingsBuilder.addLabelSettings().build(); - getBigBookSettings = settingsBuilder.getBigBookSettings().build(); - getBigBookOperationSettings = settingsBuilder.getBigBookOperationSettings().build(); - getBigNothingSettings = settingsBuilder.getBigNothingSettings().build(); - getBigNothingOperationSettings = settingsBuilder.getBigNothingOperationSettings().build(); - testOptionalRequiredFlatteningParamsSettings = settingsBuilder.testOptionalRequiredFlatteningParamsSettings().build(); - listPublishersSettings = settingsBuilder.listPublishersSettings().build(); - privateListShelvesSettings = settingsBuilder.privateListShelvesSettings().build(); - } - - private static final PagedListDescriptor LIST_SHELVES_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListShelvesRequest injectToken(ListShelvesRequest payload, String token) { - return ListShelvesRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListShelvesRequest injectPageSize(ListShelvesRequest payload, int pageSize) { - throw new UnsupportedOperationException("page size is not supported by this API method"); - } - @Override - public Integer extractPageSize(ListShelvesRequest payload) { - throw new UnsupportedOperationException("page size is not supported by this API method"); - } - @Override - public String extractNextToken(ListShelvesResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListShelvesResponse payload) { - return payload.getShelvesList() != null ? payload.getShelvesList() : - ImmutableList.of(); - } - }; - - private static final PagedListDescriptor LIST_BOOKS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListBooksRequest injectToken(ListBooksRequest payload, String token) { - return ListBooksRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListBooksRequest injectPageSize(ListBooksRequest payload, int pageSize) { - return ListBooksRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(ListBooksRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(ListBooksResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListBooksResponse payload) { - return payload.getBooksList() != null ? payload.getBooksList() : - ImmutableList.of(); - } - }; - - private static final PagedListDescriptor LIST_STRINGS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListStringsRequest injectToken(ListStringsRequest payload, String token) { - return ListStringsRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListStringsRequest injectPageSize(ListStringsRequest payload, int pageSize) { - return ListStringsRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(ListStringsRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(ListStringsResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListStringsResponse payload) { - return payload.getStringsList() != null ? payload.getStringsList() : - ImmutableList.of(); - } - }; - - private static final PagedListDescriptor FIND_RELATED_BOOKS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public FindRelatedBooksRequest injectToken(FindRelatedBooksRequest payload, String token) { - return FindRelatedBooksRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public FindRelatedBooksRequest injectPageSize(FindRelatedBooksRequest payload, int pageSize) { - return FindRelatedBooksRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(FindRelatedBooksRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(FindRelatedBooksResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(FindRelatedBooksResponse payload) { - return payload.getNamesList() != null ? payload.getNamesList() : - ImmutableList.of(); - } - }; - - private static final PagedListDescriptor LIST_PUBLISHERS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListPublishersRequest injectToken(ListPublishersRequest payload, String token) { - return ListPublishersRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListPublishersRequest injectPageSize(ListPublishersRequest payload, int pageSize) { - return ListPublishersRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(ListPublishersRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(ListPublishersResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListPublishersResponse payload) { - return payload.getPublishersList() != null ? payload.getPublishersList() : - ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory LIST_SHELVES_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListShelvesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_SHELVES_PAGE_STR_DESC, request, context); - return ListShelvesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory LIST_BOOKS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListBooksRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_BOOKS_PAGE_STR_DESC, request, context); - return ListBooksPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory LIST_STRINGS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListStringsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_STRINGS_PAGE_STR_DESC, request, context); - return ListStringsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory FIND_RELATED_BOOKS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - FindRelatedBooksRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, FIND_RELATED_BOOKS_PAGE_STR_DESC, request, context); - return FindRelatedBooksPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory LIST_PUBLISHERS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListPublishersRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_PUBLISHERS_PAGE_STR_DESC, request, context); - return ListPublishersPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final BatchingDescriptor PUBLISH_SERIES_BATCHING_DESC = - new BatchingDescriptor() { - @Override - public PartitionKey getBatchPartitionKey(PublishSeriesRequest request) { - return new PartitionKey(request.getEdition(), request.getName()); - } - - @Override - public RequestBuilder getRequestBuilder() { - return new RequestBuilder() { - private PublishSeriesRequest.Builder builder; - @Override - public void appendRequest(PublishSeriesRequest request) { - if (builder == null) { - builder = request.toBuilder(); - } else { - builder.addAllBooks(request.getBooksList()); - } - } - @Override - public PublishSeriesRequest build() { - return builder.build(); - } - }; - } - - @Override - public void splitResponse( - PublishSeriesResponse batchResponse, - Collection> batch) { - int batchMessageIndex = 0; - for (BatchedRequestIssuer responder : batch) { - List subresponseElements = new ArrayList<>(); - long subresponseCount = responder.getMessageCount(); - for (int i = 0; i < subresponseCount; i++) { - subresponseElements.add(batchResponse.getBookNames(batchMessageIndex)); - batchMessageIndex += 1; - } - PublishSeriesResponse response = - PublishSeriesResponse.newBuilder().addAllBookNames(subresponseElements).build(); - responder.setResponse(response); - } - } - - @Override - public void splitException( - Throwable throwable, - Collection> batch) { - for (BatchedRequestIssuer responder : batch) { - responder.setException(throwable); - } - } - - @Override - public long countElements(PublishSeriesRequest request) { - return request.getBooksCount(); - } - - @Override - public long countBytes(PublishSeriesRequest request) { - return request.getSerializedSize(); - } - }; - - private static final BatchingDescriptor ADD_COMMENTS_BATCHING_DESC = - new BatchingDescriptor() { - @Override - public PartitionKey getBatchPartitionKey(AddCommentsRequest request) { - return new PartitionKey(request.getName()); - } - - @Override - public RequestBuilder getRequestBuilder() { - return new RequestBuilder() { - private AddCommentsRequest.Builder builder; - @Override - public void appendRequest(AddCommentsRequest request) { - if (builder == null) { - builder = request.toBuilder(); - } else { - builder.addAllComments(request.getCommentsList()); - } - } - @Override - public AddCommentsRequest build() { - return builder.build(); - } - }; - } - - @Override - public void splitResponse( - Empty batchResponse, - Collection> batch) { - int batchMessageIndex = 0; - for (BatchedRequestIssuer responder : batch) { - Empty response = - Empty.newBuilder().build(); - responder.setResponse(response); - } - } - - @Override - public void splitException( - Throwable throwable, - Collection> batch) { - for (BatchedRequestIssuer responder : batch) { - responder.setException(throwable); - } - } - - @Override - public long countElements(AddCommentsRequest request) { - return request.getCommentsCount(); - } - - @Override - public long countBytes(AddCommentsRequest request) { - return request.getSerializedSize(); - } - }; - - /** - * Builder for LibraryServiceStubSettings. - */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - - private final UnaryCallSettings.Builder createShelfSettings; - private final UnaryCallSettings.Builder getShelfSettings; - private final PagedCallSettings.Builder listShelvesSettings; - private final UnaryCallSettings.Builder deleteShelfSettings; - private final UnaryCallSettings.Builder mergeShelvesSettings; - private final UnaryCallSettings.Builder createBookSettings; - private final BatchingCallSettings.Builder publishSeriesSettings; - private final UnaryCallSettings.Builder getBookSettings; - private final PagedCallSettings.Builder listBooksSettings; - private final UnaryCallSettings.Builder deleteBookSettings; - private final UnaryCallSettings.Builder updateBookSettings; - private final UnaryCallSettings.Builder moveBookSettings; - private final PagedCallSettings.Builder listStringsSettings; - private final BatchingCallSettings.Builder addCommentsSettings; - private final UnaryCallSettings.Builder getBookFromArchiveSettings; - private final UnaryCallSettings.Builder getBookFromAnywhereSettings; - private final UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings; - private final UnaryCallSettings.Builder updateBookIndexSettings; - private final ServerStreamingCallSettings.Builder streamShelvesSettings; - private final ServerStreamingCallSettings.Builder streamBooksSettings; - private final StreamingCallSettings.Builder discussBookSettings; - private final StreamingCallSettings.Builder monologAboutBookSettings; - private final StreamingCallSettings.Builder babbleAboutBookSettings; - private final PagedCallSettings.Builder findRelatedBooksSettings; - private final UnaryCallSettings.Builder addLabelSettings; - private final UnaryCallSettings.Builder getBigBookSettings; - private final OperationCallSettings.Builder getBigBookOperationSettings; - private final UnaryCallSettings.Builder getBigNothingSettings; - private final OperationCallSettings.Builder getBigNothingOperationSettings; - private final UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings; - private final PagedCallSettings.Builder listPublishersSettings; - private final UnaryCallSettings.Builder privateListShelvesSettings; - - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = ImmutableMap.builder(); - definitions.put( - "idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.2) - .setMaxRetryDelay(Duration.ofMillis(1000L)) - .setInitialRpcTimeout(Duration.ofMillis(300L)) - .setRpcTimeoutMultiplier(1.3) - .setMaxRpcTimeout(Duration.ofMillis(3000L)) - .setTotalTimeout(Duration.ofMillis(30000L)) - .build(); - definitions.put("default", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - getShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - listShelvesSettings = PagedCallSettings.newBuilder( - LIST_SHELVES_PAGE_STR_FACT); - - deleteShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - mergeShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - createBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - publishSeriesSettings = BatchingCallSettings.newBuilder( - PUBLISH_SERIES_BATCHING_DESC) - .setBatchingSettings(BatchingSettings.newBuilder().build()); - - getBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - listBooksSettings = PagedCallSettings.newBuilder( - LIST_BOOKS_PAGE_STR_FACT); - - deleteBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - updateBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - moveBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - listStringsSettings = PagedCallSettings.newBuilder( - LIST_STRINGS_PAGE_STR_FACT); - - addCommentsSettings = BatchingCallSettings.newBuilder( - ADD_COMMENTS_BATCHING_DESC) - .setBatchingSettings(BatchingSettings.newBuilder().build()); - - getBookFromArchiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - getBookFromAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - getBookFromAbsolutelyAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - updateBookIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - streamShelvesSettings = ServerStreamingCallSettings.newBuilder(); - - streamBooksSettings = ServerStreamingCallSettings.newBuilder(); - - discussBookSettings = StreamingCallSettings.newBuilder(); - - monologAboutBookSettings = StreamingCallSettings.newBuilder(); - - babbleAboutBookSettings = StreamingCallSettings.newBuilder(); - - findRelatedBooksSettings = PagedCallSettings.newBuilder( - FIND_RELATED_BOOKS_PAGE_STR_FACT); - - addLabelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - getBigBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - getBigBookOperationSettings = OperationCallSettings.newBuilder(); - - getBigNothingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - getBigNothingOperationSettings = OperationCallSettings.newBuilder(); - - testOptionalRequiredFlatteningParamsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - listPublishersSettings = PagedCallSettings.newBuilder( - LIST_PUBLISHERS_PAGE_STR_FACT); - - privateListShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = ImmutableList.>of( - createShelfSettings, - getShelfSettings, - listShelvesSettings, - deleteShelfSettings, - mergeShelvesSettings, - createBookSettings, - publishSeriesSettings, - getBookSettings, - listBooksSettings, - deleteBookSettings, - updateBookSettings, - moveBookSettings, - listStringsSettings, - addCommentsSettings, - getBookFromArchiveSettings, - getBookFromAnywhereSettings, - getBookFromAbsolutelyAnywhereSettings, - updateBookIndexSettings, - findRelatedBooksSettings, - addLabelSettings, - getBigBookSettings, - getBigNothingSettings, - testOptionalRequiredFlatteningParamsSettings, - listPublishersSettings, - privateListShelvesSettings - ); - - initDefaults(this); - } - - private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - - builder.createShelfSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getShelfSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.listShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.deleteShelfSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.mergeShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.createBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.publishSeriesSettings().setBatchingSettings( - BatchingSettings.newBuilder() - .setElementCountThreshold(6L) - .setRequestByteThreshold(100000L) - .setDelayThreshold(Duration.ofMillis(500)) - .setFlowControlSettings( - FlowControlSettings.newBuilder() - .setLimitExceededBehavior(LimitExceededBehavior.Ignore) - .build()) - .build()); - builder.publishSeriesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.listBooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.deleteBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.updateBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.moveBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.listStringsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.addCommentsSettings().setBatchingSettings( - BatchingSettings.newBuilder() - .setElementCountThreshold(6L) - .setRequestByteThreshold(100000L) - .setDelayThreshold(Duration.ofMillis(500)) - .setFlowControlSettings( - FlowControlSettings.newBuilder() - .setLimitExceededBehavior(LimitExceededBehavior.Ignore) - .build()) - .build()); - builder.addCommentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getBookFromArchiveSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getBookFromAnywhereSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getBookFromAbsolutelyAnywhereSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.updateBookIndexSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.streamShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.streamBooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.findRelatedBooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.addLabelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getBigBookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.getBigNothingSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.testOptionalRequiredFlatteningParamsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.listPublishersSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder.privateListShelvesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder - .getBigBookOperationSettings() - .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) - .build()) - .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Book.class)) - .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(3000L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(30000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(86400000L)) - .build())); - builder - .getBigNothingOperationSettings() - .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) - .build()) - .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) - .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(3000L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(600000L)) - .build())); - - return builder; - } - - protected Builder(LibraryServiceStubSettings settings) { - super(settings); - - createShelfSettings = settings.createShelfSettings.toBuilder(); - getShelfSettings = settings.getShelfSettings.toBuilder(); - listShelvesSettings = settings.listShelvesSettings.toBuilder(); - deleteShelfSettings = settings.deleteShelfSettings.toBuilder(); - mergeShelvesSettings = settings.mergeShelvesSettings.toBuilder(); - createBookSettings = settings.createBookSettings.toBuilder(); - publishSeriesSettings = settings.publishSeriesSettings.toBuilder(); - getBookSettings = settings.getBookSettings.toBuilder(); - listBooksSettings = settings.listBooksSettings.toBuilder(); - deleteBookSettings = settings.deleteBookSettings.toBuilder(); - updateBookSettings = settings.updateBookSettings.toBuilder(); - moveBookSettings = settings.moveBookSettings.toBuilder(); - listStringsSettings = settings.listStringsSettings.toBuilder(); - addCommentsSettings = settings.addCommentsSettings.toBuilder(); - getBookFromArchiveSettings = settings.getBookFromArchiveSettings.toBuilder(); - getBookFromAnywhereSettings = settings.getBookFromAnywhereSettings.toBuilder(); - getBookFromAbsolutelyAnywhereSettings = settings.getBookFromAbsolutelyAnywhereSettings.toBuilder(); - updateBookIndexSettings = settings.updateBookIndexSettings.toBuilder(); - streamShelvesSettings = settings.streamShelvesSettings.toBuilder(); - streamBooksSettings = settings.streamBooksSettings.toBuilder(); - discussBookSettings = settings.discussBookSettings.toBuilder(); - monologAboutBookSettings = settings.monologAboutBookSettings.toBuilder(); - babbleAboutBookSettings = settings.babbleAboutBookSettings.toBuilder(); - findRelatedBooksSettings = settings.findRelatedBooksSettings.toBuilder(); - addLabelSettings = settings.addLabelSettings.toBuilder(); - getBigBookSettings = settings.getBigBookSettings.toBuilder(); - getBigBookOperationSettings = settings.getBigBookOperationSettings.toBuilder(); - getBigNothingSettings = settings.getBigNothingSettings.toBuilder(); - getBigNothingOperationSettings = settings.getBigNothingOperationSettings.toBuilder(); - testOptionalRequiredFlatteningParamsSettings = settings.testOptionalRequiredFlatteningParamsSettings.toBuilder(); - listPublishersSettings = settings.listPublishersSettings.toBuilder(); - privateListShelvesSettings = settings.privateListShelvesSettings.toBuilder(); - - unaryMethodSettingsBuilders = ImmutableList.>of( - createShelfSettings, - getShelfSettings, - listShelvesSettings, - deleteShelfSettings, - mergeShelvesSettings, - createBookSettings, - publishSeriesSettings, - getBookSettings, - listBooksSettings, - deleteBookSettings, - updateBookSettings, - moveBookSettings, - listStringsSettings, - addCommentsSettings, - getBookFromArchiveSettings, - getBookFromAnywhereSettings, - getBookFromAbsolutelyAnywhereSettings, - updateBookIndexSettings, - findRelatedBooksSettings, - addLabelSettings, - getBigBookSettings, - getBigNothingSettings, - testOptionalRequiredFlatteningParamsSettings, - listPublishersSettings, - privateListShelvesSettings - ); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** - * Returns the builder for the settings used for calls to createShelf. - */ - public UnaryCallSettings.Builder createShelfSettings() { - return createShelfSettings; - } - - /** - * Returns the builder for the settings used for calls to getShelf. - */ - public UnaryCallSettings.Builder getShelfSettings() { - return getShelfSettings; - } - - /** - * Returns the builder for the settings used for calls to listShelves. - */ - public PagedCallSettings.Builder listShelvesSettings() { - return listShelvesSettings; - } - - /** - * Returns the builder for the settings used for calls to deleteShelf. - */ - public UnaryCallSettings.Builder deleteShelfSettings() { - return deleteShelfSettings; - } - - /** - * Returns the builder for the settings used for calls to mergeShelves. - */ - public UnaryCallSettings.Builder mergeShelvesSettings() { - return mergeShelvesSettings; - } - - /** - * Returns the builder for the settings used for calls to createBook. - */ - public UnaryCallSettings.Builder createBookSettings() { - return createBookSettings; - } - - /** - * Returns the builder for the settings used for calls to publishSeries. - */ - public BatchingCallSettings.Builder publishSeriesSettings() { - return publishSeriesSettings; - } - - /** - * Returns the builder for the settings used for calls to getBook. - */ - public UnaryCallSettings.Builder getBookSettings() { - return getBookSettings; - } - - /** - * Returns the builder for the settings used for calls to listBooks. - */ - public PagedCallSettings.Builder listBooksSettings() { - return listBooksSettings; - } - - /** - * Returns the builder for the settings used for calls to deleteBook. - */ - public UnaryCallSettings.Builder deleteBookSettings() { - return deleteBookSettings; - } - - /** - * Returns the builder for the settings used for calls to updateBook. - */ - public UnaryCallSettings.Builder updateBookSettings() { - return updateBookSettings; - } - - /** - * Returns the builder for the settings used for calls to moveBook. - */ - public UnaryCallSettings.Builder moveBookSettings() { - return moveBookSettings; - } - - /** - * Returns the builder for the settings used for calls to listStrings. - */ - public PagedCallSettings.Builder listStringsSettings() { - return listStringsSettings; - } - - /** - * Returns the builder for the settings used for calls to addComments. - */ - public BatchingCallSettings.Builder addCommentsSettings() { - return addCommentsSettings; - } - - /** - * Returns the builder for the settings used for calls to getBookFromArchive. - */ - public UnaryCallSettings.Builder getBookFromArchiveSettings() { - return getBookFromArchiveSettings; - } - - /** - * Returns the builder for the settings used for calls to getBookFromAnywhere. - */ - public UnaryCallSettings.Builder getBookFromAnywhereSettings() { - return getBookFromAnywhereSettings; - } - - /** - * Returns the builder for the settings used for calls to getBookFromAbsolutelyAnywhere. - */ - public UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings() { - return getBookFromAbsolutelyAnywhereSettings; - } - - /** - * Returns the builder for the settings used for calls to updateBookIndex. - */ - public UnaryCallSettings.Builder updateBookIndexSettings() { - return updateBookIndexSettings; - } - - /** - * Returns the builder for the settings used for calls to streamShelves. - */ - public ServerStreamingCallSettings.Builder streamShelvesSettings() { - return streamShelvesSettings; - } - - /** - * Returns the builder for the settings used for calls to streamBooks. - */ - public ServerStreamingCallSettings.Builder streamBooksSettings() { - return streamBooksSettings; - } - - /** - * Returns the builder for the settings used for calls to discussBook. - */ - public StreamingCallSettings.Builder discussBookSettings() { - return discussBookSettings; - } - - /** - * Returns the builder for the settings used for calls to monologAboutBook. - */ - public StreamingCallSettings.Builder monologAboutBookSettings() { - return monologAboutBookSettings; - } - - /** - * Returns the builder for the settings used for calls to babbleAboutBook. - */ - public StreamingCallSettings.Builder babbleAboutBookSettings() { - return babbleAboutBookSettings; - } - - /** - * Returns the builder for the settings used for calls to findRelatedBooks. - */ - public PagedCallSettings.Builder findRelatedBooksSettings() { - return findRelatedBooksSettings; - } - - /** - * Returns the builder for the settings used for calls to addLabel. - */ - public UnaryCallSettings.Builder addLabelSettings() { - return addLabelSettings; - } - - /** - * Returns the builder for the settings used for calls to getBigBook. - */ - public UnaryCallSettings.Builder getBigBookSettings() { - return getBigBookSettings; - } - - /** - * Returns the builder for the settings used for calls to getBigBook. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder getBigBookOperationSettings() { - return getBigBookOperationSettings; - } - - /** - * Returns the builder for the settings used for calls to getBigNothing. - */ - public UnaryCallSettings.Builder getBigNothingSettings() { - return getBigNothingSettings; - } - - /** - * Returns the builder for the settings used for calls to getBigNothing. - */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder getBigNothingOperationSettings() { - return getBigNothingOperationSettings; - } - - /** - * Returns the builder for the settings used for calls to testOptionalRequiredFlatteningParams. - */ - public UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings() { - return testOptionalRequiredFlatteningParamsSettings; - } - - /** - * Returns the builder for the settings used for calls to listPublishers. - */ - public PagedCallSettings.Builder listPublishersSettings() { - return listPublishersSettings; - } - - /** - * Returns the builder for the settings used for calls to privateListShelves. - */ - public UnaryCallSettings.Builder privateListShelvesSettings() { - return privateListShelvesSettings; - } - - @Override - public LibraryServiceStubSettings build() throws IOException { - return new LibraryServiceStubSettings(this); - } - } -} -============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStub.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Base stub class for Google Example Library API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public abstract class MyProtoStub implements BackgroundResource { - - - public UnaryCallable myMethodCallable() { - throw new UnsupportedOperationException("Not implemented: myMethodCallable()"); - } - - @Override - public abstract void close(); -} -============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStubSettings.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.CredentialsProvider; -import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.HeaderProvider; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; -import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; -import com.google.protos.google.example.library.v1.MyProtoGrpc; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link MyProtoStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (library-example.googleapis.com) and default port (1234) - * are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. - * - * For example, to set the total timeout of myMethod to 30 seconds: - * - *

- * 
- * MyProtoStubSettings.Builder myProtoSettingsBuilder =
- *     MyProtoStubSettings.newBuilder();
- * myProtoSettingsBuilder.myMethodSettings().getRetrySettings().toBuilder()
- *     .setTotalTimeout(Duration.ofSeconds(30));
- * MyProtoStubSettings myProtoSettings = myProtoSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -public class MyProtoStubSettings extends StubSettings { - /** - * The default scopes of the service. - */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() - .add("https://www.googleapis.com/auth/cloud-platform") - .add("https://www.googleapis.com/auth/library") - .build(); - - private final UnaryCallSettings myMethodSettings; - - /** - * Returns the object with the settings used for calls to myMethod. - */ - public UnaryCallSettings myMethodSettings() { - return myMethodSettings; - } - - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public MyProtoStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcMyProtoStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); - } - } - - /** - * Returns a builder for the default ExecutorProvider for this service. - */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** - * Returns the default service endpoint. - */ - public static String getDefaultEndpoint() { - return "library-example.googleapis.com:1234"; - } - - - /** - * Returns the default service scopes. - */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - - /** - * Returns a builder for the default credentials for this service. - */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - ; - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MyProtoStubSettings.class)) - .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder() { - return Builder.createDefault(); - } + GrpcCallSettings.newBuilder() + .setMethodDescriptor(privateListShelvesMethodDescriptor) + .build(); - /** - * Returns a new builder for this class. - */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } + this.createShelfCallable = callableFactory.createUnaryCallable(createShelfTransportSettings,settings.createShelfSettings(), clientContext); + this.getShelfCallable = callableFactory.createUnaryCallable(getShelfTransportSettings,settings.getShelfSettings(), clientContext); + this.listShelvesCallable = callableFactory.createUnaryCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); + this.listShelvesPagedCallable = callableFactory.createPagedCallable(listShelvesTransportSettings,settings.listShelvesSettings(), clientContext); + this.deleteShelfCallable = callableFactory.createUnaryCallable(deleteShelfTransportSettings,settings.deleteShelfSettings(), clientContext); + this.mergeShelvesCallable = callableFactory.createUnaryCallable(mergeShelvesTransportSettings,settings.mergeShelvesSettings(), clientContext); + this.createBookCallable = callableFactory.createUnaryCallable(createBookTransportSettings,settings.createBookSettings(), clientContext); + this.publishSeriesCallable = callableFactory.createBatchingCallable(publishSeriesTransportSettings,settings.publishSeriesSettings(), clientContext); + this.getBookCallable = callableFactory.createUnaryCallable(getBookTransportSettings,settings.getBookSettings(), clientContext); + this.listBooksCallable = callableFactory.createUnaryCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); + this.listBooksPagedCallable = callableFactory.createPagedCallable(listBooksTransportSettings,settings.listBooksSettings(), clientContext); + this.deleteBookCallable = callableFactory.createUnaryCallable(deleteBookTransportSettings,settings.deleteBookSettings(), clientContext); + this.updateBookCallable = callableFactory.createUnaryCallable(updateBookTransportSettings,settings.updateBookSettings(), clientContext); + this.moveBookCallable = callableFactory.createUnaryCallable(moveBookTransportSettings,settings.moveBookSettings(), clientContext); + this.listStringsCallable = callableFactory.createUnaryCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); + this.listStringsPagedCallable = callableFactory.createPagedCallable(listStringsTransportSettings,settings.listStringsSettings(), clientContext); + this.addCommentsCallable = callableFactory.createBatchingCallable(addCommentsTransportSettings,settings.addCommentsSettings(), clientContext); + this.getBookFromArchiveCallable = callableFactory.createUnaryCallable(getBookFromArchiveTransportSettings,settings.getBookFromArchiveSettings(), clientContext); + this.getBookFromAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAnywhereTransportSettings,settings.getBookFromAnywhereSettings(), clientContext); + this.getBookFromAbsolutelyAnywhereCallable = callableFactory.createUnaryCallable(getBookFromAbsolutelyAnywhereTransportSettings,settings.getBookFromAbsolutelyAnywhereSettings(), clientContext); + this.updateBookIndexCallable = callableFactory.createUnaryCallable(updateBookIndexTransportSettings,settings.updateBookIndexSettings(), clientContext); + this.streamShelvesCallable = callableFactory.createServerStreamingCallable(streamShelvesTransportSettings,settings.streamShelvesSettings(), clientContext); + this.streamBooksCallable = callableFactory.createServerStreamingCallable(streamBooksTransportSettings,settings.streamBooksSettings(), clientContext); + this.discussBookCallable = callableFactory.createBidiStreamingCallable(discussBookTransportSettings,settings.discussBookSettings(), clientContext); + this.monologAboutBookCallable = callableFactory.createClientStreamingCallable(monologAboutBookTransportSettings,settings.monologAboutBookSettings(), clientContext); + this.babbleAboutBookCallable = callableFactory.createClientStreamingCallable(babbleAboutBookTransportSettings,settings.babbleAboutBookSettings(), clientContext); + this.findRelatedBooksCallable = callableFactory.createUnaryCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); + this.findRelatedBooksPagedCallable = callableFactory.createPagedCallable(findRelatedBooksTransportSettings,settings.findRelatedBooksSettings(), clientContext); + this.addLabelCallable = callableFactory.createUnaryCallable(addLabelTransportSettings,settings.addLabelSettings(), clientContext); + this.getBigBookCallable = callableFactory.createUnaryCallable(getBigBookTransportSettings,settings.getBigBookSettings(), clientContext); + this.getBigBookOperationCallable = callableFactory.createOperationCallable( + getBigBookTransportSettings,settings.getBigBookOperationSettings(), clientContext, this.operationsStub); + this.getBigNothingCallable = callableFactory.createUnaryCallable(getBigNothingTransportSettings,settings.getBigNothingSettings(), clientContext); + this.getBigNothingOperationCallable = callableFactory.createOperationCallable( + getBigNothingTransportSettings,settings.getBigNothingOperationSettings(), clientContext, this.operationsStub); + this.testOptionalRequiredFlatteningParamsCallable = callableFactory.createUnaryCallable(testOptionalRequiredFlatteningParamsTransportSettings,settings.testOptionalRequiredFlatteningParamsSettings(), clientContext); + this.listPublishersCallable = callableFactory.createUnaryCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); + this.listPublishersPagedCallable = callableFactory.createPagedCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); + this.privateListShelvesCallable = callableFactory.createUnaryCallable(privateListShelvesTransportSettings,settings.privateListShelvesSettings(), clientContext); - /** - * Returns a builder containing all the values of this settings class. - */ - public Builder toBuilder() { - return new Builder(this); + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - protected MyProtoStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - myMethodSettings = settingsBuilder.myMethodSettings().build(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + public UnaryCallable createShelfCallable() { + return createShelfCallable; } - - - - /** - * Builder for MyProtoStubSettings. - */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - - private final UnaryCallSettings.Builder myMethodSettings; - - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = ImmutableMap.builder(); - definitions.put( - "idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) - .build(); - definitions.put("default", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - myMethodSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = ImmutableList.>of( - myMethodSettings - ); - - initDefaults(this); - } - - private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - - builder.myMethodSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - return builder; - } - - protected Builder(MyProtoStubSettings settings) { - super(settings); - - myMethodSettings = settings.myMethodSettings.toBuilder(); - - unaryMethodSettingsBuilders = ImmutableList.>of( - myMethodSettings - ); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - * Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** - * Returns the builder for the settings used for calls to myMethod. - */ - public UnaryCallSettings.Builder myMethodSettings() { - return myMethodSettings; - } - - @Override - public MyProtoStubSettings build() throws IOException { - return new MyProtoStubSettings(this); - } + public UnaryCallable getShelfCallable() { + return getShelfCallable; } -} -============== file: src/test/java/com/google/example/library/v1/LibraryClientTest.java ============== -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.example.library.v1; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcStatusCode; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.resourcenames.ResourceName; -import com.google.common.collect.Lists; -import com.google.example.library.v1.Comment; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; -import com.google.example.library.v1.SomeMessage2; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; -import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.BoolValue; -import com.google.protobuf.ByteString; -import com.google.protobuf.BytesValue; -import com.google.protobuf.DoubleValue; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FloatValue; -import com.google.protobuf.Int32Value; -import com.google.protobuf.Int64Value; -import com.google.protobuf.ListValue; -import com.google.protobuf.StringValue; -import com.google.protobuf.Struct; -import com.google.protobuf.Timestamp; -import com.google.protobuf.UInt32Value; -import com.google.protobuf.UInt64Value; -import com.google.protobuf.Value; -import io.grpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; + public UnaryCallable listShelvesPagedCallable() { + return listShelvesPagedCallable; + } -@javax.annotation.Generated("by GAPIC") -public class LibraryClientTest { - private static MockLibraryService mockLibraryService; - private static MockLabeler mockLabeler; - private static MockMyProto mockMyProto; - private static MockServiceHelper serviceHelper; - private LibraryClient client; - private LocalChannelProvider channelProvider; + public UnaryCallable listShelvesCallable() { + return listShelvesCallable; + } - @BeforeClass - public static void startStaticServer() { - mockLibraryService = new MockLibraryService(); - mockLabeler = new MockLabeler(); - mockMyProto = new MockMyProto(); - serviceHelper = new MockServiceHelper(UUID.randomUUID().toString(), Arrays.asList(mockLibraryService, mockLabeler, mockMyProto)); - serviceHelper.start(); + public UnaryCallable deleteShelfCallable() { + return deleteShelfCallable; } - @AfterClass - public static void stopServer() { - serviceHelper.stop(); + public UnaryCallable mergeShelvesCallable() { + return mergeShelvesCallable; } - @Before - public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); - LibrarySettings settings = LibrarySettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = LibraryClient.create(settings); + public UnaryCallable createBookCallable() { + return createBookCallable; } - @After - public void tearDown() throws Exception { - client.close(); + public UnaryCallable publishSeriesCallable() { + return publishSeriesCallable; } - @Test - @SuppressWarnings("all") - public void createShelfTest() { - ShelfName name = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); + public UnaryCallable getBookCallable() { + return getBookCallable; + } - Shelf shelf = Shelf.newBuilder().build(); + public UnaryCallable listBooksPagedCallable() { + return listBooksPagedCallable; + } - Shelf actualResponse = - client.createShelf(shelf); - Assert.assertEquals(expectedResponse, actualResponse); + public UnaryCallable listBooksCallable() { + return listBooksCallable; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateShelfRequest actualRequest = (CreateShelfRequest)actualRequests.get(0); + public UnaryCallable deleteBookCallable() { + return deleteBookCallable; + } - Assert.assertEquals(shelf, actualRequest.getShelf()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable updateBookCallable() { + return updateBookCallable; } - @Test - @SuppressWarnings("all") - public void createShelfExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + public UnaryCallable moveBookCallable() { + return moveBookCallable; + } - try { - Shelf shelf = Shelf.newBuilder().build(); + public UnaryCallable listStringsPagedCallable() { + return listStringsPagedCallable; + } - client.createShelf(shelf); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable listStringsCallable() { + return listStringsCallable; } - @Test - @SuppressWarnings("all") - public void getShelfTest() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); + public UnaryCallable addCommentsCallable() { + return addCommentsCallable; + } - ShelfName name = ShelfName.of("[SHELF_ID]"); + public UnaryCallable getBookFromArchiveCallable() { + return getBookFromArchiveCallable; + } - Shelf actualResponse = - client.getShelf(name); - Assert.assertEquals(expectedResponse, actualResponse); + public UnaryCallable getBookFromAnywhereCallable() { + return getBookFromAnywhereCallable; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { + return getBookFromAbsolutelyAnywhereCallable; + } - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable updateBookIndexCallable() { + return updateBookIndexCallable; } - @Test - @SuppressWarnings("all") - public void getShelfExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + public ServerStreamingCallable streamShelvesCallable() { + return streamShelvesCallable; + } - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + public ServerStreamingCallable streamBooksCallable() { + return streamBooksCallable; + } - client.getShelf(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public BidiStreamingCallable discussBookCallable() { + return discussBookCallable; } - @Test - @SuppressWarnings("all") - public void getShelfTest2() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); + public ClientStreamingCallable monologAboutBookCallable() { + return monologAboutBookCallable; + } - ShelfName name = ShelfName.of("[SHELF_ID]"); + public ClientStreamingCallable babbleAboutBookCallable() { + return babbleAboutBookCallable; + } - Shelf actualResponse = - client.getShelf(name); - Assert.assertEquals(expectedResponse, actualResponse); + public UnaryCallable findRelatedBooksPagedCallable() { + return findRelatedBooksPagedCallable; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + public UnaryCallable findRelatedBooksCallable() { + return findRelatedBooksCallable; + } - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + @Deprecated + public UnaryCallable addLabelCallable() { + return addLabelCallable; } - @Test - @SuppressWarnings("all") - public void getShelfExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigBookOperationCallable() { + return getBigBookOperationCallable; + } - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + public UnaryCallable getBigBookCallable() { + return getBigBookCallable; + } - client.getShelf(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigNothingOperationCallable() { + return getBigNothingOperationCallable; } - @Test - @SuppressWarnings("all") - public void getShelfTest3() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); + public UnaryCallable getBigNothingCallable() { + return getBigNothingCallable; + } + + public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { + return testOptionalRequiredFlatteningParamsCallable; + } + + public UnaryCallable listPublishersPagedCallable() { + return listPublishersPagedCallable; + } + + public UnaryCallable listPublishersCallable() { + return listPublishersCallable; + } + + public UnaryCallable privateListShelvesCallable() { + return privateListShelvesCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } - Shelf actualResponse = - client.getShelf(name, message); - Assert.assertEquals(expectedResponse, actualResponse); + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); } - @Test - @SuppressWarnings("all") - public void getShelfExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); +} +============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoCallableFactory.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.example.library.v1.MyProtoSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; - client.getShelf(name, message); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Google Example Library API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcMyProtoCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); } - @Test - @SuppressWarnings("all") - public void getShelfTest4() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); + @Override + public UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, pagedCallSettings, clientContext); + } - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable(grpcCallSettings, batchingCallSettings, clientContext); + } - Shelf actualResponse = - client.getShelf(name, message); - Assert.assertEquals(expectedResponse, actualResponse); + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + @Override + public OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable(grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + @Override + public BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + } - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + @Override + public ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); } - @Test - @SuppressWarnings("all") - public void getShelfExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + @Override + public ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable(grpcCallSettings, streamingCallSettings, clientContext); + } +} +============== file: src/main/java/com/google/example/library/v1/stub/GrpcMyProtoStub.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.example.library.v1.MyProtoSettings; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; - client.getShelf(name, message); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Google Example Library API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcMyProtoStub extends MyProtoStub { + + private static final MethodDescriptor myMethodMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.MyProto/MyMethod") + .setRequestMarshaller(ProtoUtils.marshaller(MethodRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(MethodResponse.getDefaultInstance())) + .build(); - @Test - @SuppressWarnings("all") - public void getShelfTest5() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - SomeMessage message = SomeMessage.newBuilder().build(); + private final BackgroundResource backgroundResources; - Shelf actualResponse = - client.getShelf(name, stringBuilder, message); - Assert.assertEquals(expectedResponse, actualResponse); + private final UnaryCallable myMethodCallable; - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + private final GrpcStubCallableFactory callableFactory; - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); - Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public static final GrpcMyProtoStub create(MyProtoStubSettings settings) throws IOException { + return new GrpcMyProtoStub(settings, ClientContext.create(settings)); } - @Test - @SuppressWarnings("all") - public void getShelfExceptionTest5() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - SomeMessage message = SomeMessage.newBuilder().build(); + public static final GrpcMyProtoStub create(ClientContext clientContext) throws IOException { + return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext); + } - client.getShelf(name, stringBuilder, message); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public static final GrpcMyProtoStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMyProtoStub(MyProtoStubSettings.newBuilder().build(), clientContext, callableFactory); } - @Test - @SuppressWarnings("all") - public void getShelfTest6() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Constructs an instance of GrpcMyProtoStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcMyProtoCallableFactory()); + } - ShelfName name = ShelfName.of("[SHELF_ID]"); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - SomeMessage message = SomeMessage.newBuilder().build(); + /** + * Constructs an instance of GrpcMyProtoStub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static + * factory methods should be preferred. + */ + protected GrpcMyProtoStub(MyProtoStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + this.callableFactory = callableFactory; - Shelf actualResponse = - client.getShelf(name, stringBuilder, message); - Assert.assertEquals(expectedResponse, actualResponse); + GrpcCallSettings myMethodTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(myMethodMethodDescriptor) + .build(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + this.myMethodCallable = callableFactory.createUnaryCallable(myMethodTransportSettings,settings.myMethodSettings(), clientContext); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); - Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @Test - @SuppressWarnings("all") - public void getShelfExceptionTest6() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - SomeMessage message = SomeMessage.newBuilder().build(); - client.getShelf(name, stringBuilder, message); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable myMethodCallable() { + return myMethodCallable; } - @Test - @SuppressWarnings("all") - public void deleteShelfTest() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName name = ShelfName.of("[SHELF_ID]"); - - client.deleteShelf(name); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); + @Override + public final void close() { + shutdown(); + } - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + @Override + public void shutdown() { + backgroundResources.shutdown(); } - @Test - @SuppressWarnings("all") - public void deleteShelfExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } - client.deleteShelf(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); } - @Test - @SuppressWarnings("all") - public void deleteShelfTest2() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } - ShelfName name = ShelfName.of("[SHELF_ID]"); +} +============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStub.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; - client.deleteShelf(name); +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveName; +import com.google.example.library.v1.ArchivedBookName; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromAnywhere; +import com.google.example.library.v1.BookFromArchive; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.Comment; +import com.google.example.library.v1.CreateBookRequest; +import com.google.example.library.v1.CreateShelfRequest; +import com.google.example.library.v1.DeleteBookRequest; +import com.google.example.library.v1.DeleteShelfRequest; +import com.google.example.library.v1.DiscussBookRequest; +import com.google.example.library.v1.FindRelatedBooksRequest; +import com.google.example.library.v1.FindRelatedBooksResponse; +import com.google.example.library.v1.FolderName; +import com.google.example.library.v1.GetBigBookMetadata; +import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; +import com.google.example.library.v1.GetBookFromAnywhereRequest; +import com.google.example.library.v1.GetBookFromArchiveRequest; +import com.google.example.library.v1.GetBookRequest; +import com.google.example.library.v1.GetShelfRequest; +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListPublishersRequest; +import com.google.example.library.v1.ListPublishersResponse; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.ListShelvesResponse; +import com.google.example.library.v1.ListStringsRequest; +import com.google.example.library.v1.ListStringsResponse; +import com.google.example.library.v1.LocationName; +import com.google.example.library.v1.MergeShelvesRequest; +import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.ProjectName; +import com.google.example.library.v1.PublishSeriesRequest; +import com.google.example.library.v1.PublishSeriesResponse; +import com.google.example.library.v1.Publisher; +import com.google.example.library.v1.PublisherName; +import com.google.example.library.v1.SeriesUuid; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; +import com.google.example.library.v1.SomeMessage; +import com.google.example.library.v1.StreamBooksRequest; +import com.google.example.library.v1.StreamShelvesRequest; +import com.google.example.library.v1.StreamShelvesResponse; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; +import com.google.example.library.v1.UpdateBookIndexRequest; +import com.google.example.library.v1.UpdateBookRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Any; +import com.google.protobuf.BoolValue; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.DoubleValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.FloatValue; +import com.google.protobuf.Int32Value; +import com.google.protobuf.Int64Value; +import com.google.protobuf.ListValue; +import com.google.protobuf.StringValue; +import com.google.protobuf.Struct; +import com.google.protobuf.Timestamp; +import com.google.protobuf.UInt32Value; +import com.google.protobuf.UInt64Value; +import com.google.protobuf.Value; +import com.google.tagger.v1.TaggerProto.AddLabelRequest; +import com.google.tagger.v1.TaggerProto.AddLabelResponse; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Google Example Library API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class LibraryServiceStub implements BackgroundResource { - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - @Test - @SuppressWarnings("all") - public void deleteShelfExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - - client.deleteShelf(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable createShelfCallable() { + throw new UnsupportedOperationException("Not implemented: createShelfCallable()"); } - @Test - @SuppressWarnings("all") - public void mergeShelvesTest() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - ShelfName name = ShelfName.of("[SHELF_ID]"); - - Shelf actualResponse = - client.mergeShelves(otherShelfName, name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); - - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable getShelfCallable() { + throw new UnsupportedOperationException("Not implemented: getShelfCallable()"); } - @Test - @SuppressWarnings("all") - public void mergeShelvesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - ShelfName name = ShelfName.of("[SHELF_ID]"); - - client.mergeShelves(otherShelfName, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable listShelvesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listShelvesPagedCallable()"); } - @Test - @SuppressWarnings("all") - public void mergeShelvesTest2() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - ShelfName name = ShelfName.of("[SHELF_ID]"); - - Shelf actualResponse = - client.mergeShelves(otherShelfName, name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); - - Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable listShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: listShelvesCallable()"); } - @Test - @SuppressWarnings("all") - public void mergeShelvesExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - ShelfName name = ShelfName.of("[SHELF_ID]"); - - client.mergeShelves(otherShelfName, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable deleteShelfCallable() { + throw new UnsupportedOperationException("Not implemented: deleteShelfCallable()"); } - @Test - @SuppressWarnings("all") - public void createBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - Book book = Book.newBuilder().build(); - ShelfName name = ShelfName.of("[SHELF_ID]"); - - Book actualResponse = - client.createBook(book, name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); - - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable mergeShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: mergeShelvesCallable()"); } - @Test - @SuppressWarnings("all") - public void createBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - Book book = Book.newBuilder().build(); - ShelfName name = ShelfName.of("[SHELF_ID]"); - - client.createBook(book, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable createBookCallable() { + throw new UnsupportedOperationException("Not implemented: createBookCallable()"); } - @Test - @SuppressWarnings("all") - public void createBookTest2() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - Book book = Book.newBuilder().build(); - ShelfName name = ShelfName.of("[SHELF_ID]"); - - Book actualResponse = - client.createBook(book, name); - Assert.assertEquals(expectedResponse, actualResponse); + public UnaryCallable publishSeriesCallable() { + throw new UnsupportedOperationException("Not implemented: publishSeriesCallable()"); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + public UnaryCallable getBookCallable() { + throw new UnsupportedOperationException("Not implemented: getBookCallable()"); + } - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable listBooksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBooksPagedCallable()"); } - @Test - @SuppressWarnings("all") - public void createBookExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + public UnaryCallable listBooksCallable() { + throw new UnsupportedOperationException("Not implemented: listBooksCallable()"); + } - try { - Book book = Book.newBuilder().build(); - ShelfName name = ShelfName.of("[SHELF_ID]"); + public UnaryCallable deleteBookCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBookCallable()"); + } - client.createBook(book, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable updateBookCallable() { + throw new UnsupportedOperationException("Not implemented: updateBookCallable()"); } - @Test - @SuppressWarnings("all") - public void publishSeriesTest() { - String bookNamesElement = "bookNamesElement1491670575"; - List bookNames = Arrays.asList(bookNamesElement); - PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() - .addAllBookNames(bookNames) - .build(); - mockLibraryService.addResponse(expectedResponse); + public UnaryCallable moveBookCallable() { + throw new UnsupportedOperationException("Not implemented: moveBookCallable()"); + } - List books = new ArrayList<>(); - int edition = 1887963714; - String publisher = "publisher1447404028"; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - Shelf shelf = Shelf.newBuilder().build(); + public UnaryCallable listStringsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listStringsPagedCallable()"); + } - PublishSeriesResponse actualResponse = - client.publishSeries(books, edition, publisher, seriesUuid, shelf); - Assert.assertEquals(expectedResponse, actualResponse); + public UnaryCallable listStringsCallable() { + throw new UnsupportedOperationException("Not implemented: listStringsCallable()"); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + public UnaryCallable addCommentsCallable() { + throw new UnsupportedOperationException("Not implemented: addCommentsCallable()"); + } - Assert.assertEquals(books, actualRequest.getBooksList()); - Assert.assertEquals(edition, actualRequest.getEdition()); - Assert.assertEquals(publisher, PublisherNames.parse(actualRequest.getPublisher())); - Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(shelf, actualRequest.getShelf()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable getBookFromArchiveCallable() { + throw new UnsupportedOperationException("Not implemented: getBookFromArchiveCallable()"); } - @Test - @SuppressWarnings("all") - public void publishSeriesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + public UnaryCallable getBookFromAnywhereCallable() { + throw new UnsupportedOperationException("Not implemented: getBookFromAnywhereCallable()"); + } - try { - List books = new ArrayList<>(); - int edition = 1887963714; - String publisher = "publisher1447404028"; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - Shelf shelf = Shelf.newBuilder().build(); + public UnaryCallable getBookFromAbsolutelyAnywhereCallable() { + throw new UnsupportedOperationException("Not implemented: getBookFromAbsolutelyAnywhereCallable()"); + } - client.publishSeries(books, edition, publisher, seriesUuid, shelf); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable updateBookIndexCallable() { + throw new UnsupportedOperationException("Not implemented: updateBookIndexCallable()"); } - @Test - @SuppressWarnings("all") - public void publishSeriesTest2() { - String bookNamesElement = "bookNamesElement1491670575"; - List bookNames = Arrays.asList(bookNamesElement); - PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() - .addAllBookNames(bookNames) - .build(); - mockLibraryService.addResponse(expectedResponse); + public ServerStreamingCallable streamShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: streamShelvesCallable()"); + } - List books = new ArrayList<>(); - int edition = 1887963714; - String publisher = "publisher1447404028"; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - Shelf shelf = Shelf.newBuilder().build(); + public ServerStreamingCallable streamBooksCallable() { + throw new UnsupportedOperationException("Not implemented: streamBooksCallable()"); + } - PublishSeriesResponse actualResponse = - client.publishSeries(books, edition, publisher, seriesUuid, shelf); - Assert.assertEquals(expectedResponse, actualResponse); + public BidiStreamingCallable discussBookCallable() { + throw new UnsupportedOperationException("Not implemented: discussBookCallable()"); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + public ClientStreamingCallable monologAboutBookCallable() { + throw new UnsupportedOperationException("Not implemented: monologAboutBookCallable()"); + } - Assert.assertEquals(books, actualRequest.getBooksList()); - Assert.assertEquals(edition, actualRequest.getEdition()); - Assert.assertEquals(publisher, actualRequest.getPublisher()); - Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(shelf, actualRequest.getShelf()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public ClientStreamingCallable babbleAboutBookCallable() { + throw new UnsupportedOperationException("Not implemented: babbleAboutBookCallable()"); } - @Test - @SuppressWarnings("all") - public void publishSeriesExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + public UnaryCallable findRelatedBooksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: findRelatedBooksPagedCallable()"); + } - try { - List books = new ArrayList<>(); - int edition = 1887963714; - String publisher = "publisher1447404028"; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - Shelf shelf = Shelf.newBuilder().build(); + public UnaryCallable findRelatedBooksCallable() { + throw new UnsupportedOperationException("Not implemented: findRelatedBooksCallable()"); + } - client.publishSeries(books, edition, publisher, seriesUuid, shelf); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + @Deprecated + public UnaryCallable addLabelCallable() { + throw new UnsupportedOperationException("Not implemented: addLabelCallable()"); } - @Test - @SuppressWarnings("all") - public void getBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigBookOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getBigBookOperationCallable()"); + } - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + public UnaryCallable getBigBookCallable() { + throw new UnsupportedOperationException("Not implemented: getBigBookCallable()"); + } - Book actualResponse = - client.getBook(name); - Assert.assertEquals(expectedResponse, actualResponse); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable getBigNothingOperationCallable() { + throw new UnsupportedOperationException("Not implemented: getBigNothingOperationCallable()"); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + public UnaryCallable getBigNothingCallable() { + throw new UnsupportedOperationException("Not implemented: getBigNothingCallable()"); + } - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + public UnaryCallable testOptionalRequiredFlatteningParamsCallable() { + throw new UnsupportedOperationException("Not implemented: testOptionalRequiredFlatteningParamsCallable()"); } - @Test - @SuppressWarnings("all") - public void getBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + public UnaryCallable listPublishersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPublishersPagedCallable()"); + } - try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + public UnaryCallable listPublishersCallable() { + throw new UnsupportedOperationException("Not implemented: listPublishersCallable()"); + } - client.getBook(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + public UnaryCallable privateListShelvesCallable() { + throw new UnsupportedOperationException("Not implemented: privateListShelvesCallable()"); } - @Test - @SuppressWarnings("all") - public void getBookTest2() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + @Override + public abstract void close(); +} +============== file: src/main/java/com/google/example/library/v1/stub/LibraryServiceStubSettings.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.batching.FlowController.LimitExceededBehavior; +import com.google.api.gax.batching.PartitionKey; +import com.google.api.gax.batching.RequestBuilder; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.BatchedRequestIssuer; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BatchingDescriptor; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookFromAnywhere; +import com.google.example.library.v1.BookFromArchive; +import com.google.example.library.v1.Comment; +import com.google.example.library.v1.CreateBookRequest; +import com.google.example.library.v1.CreateShelfRequest; +import com.google.example.library.v1.DeleteBookRequest; +import com.google.example.library.v1.DeleteShelfRequest; +import com.google.example.library.v1.DiscussBookRequest; +import com.google.example.library.v1.FindRelatedBooksRequest; +import com.google.example.library.v1.FindRelatedBooksResponse; +import com.google.example.library.v1.GetBigBookMetadata; +import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; +import com.google.example.library.v1.GetBookFromAnywhereRequest; +import com.google.example.library.v1.GetBookFromArchiveRequest; +import com.google.example.library.v1.GetBookRequest; +import com.google.example.library.v1.GetShelfRequest; +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; +import com.google.example.library.v1.LibraryServiceGrpc; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListPublishersRequest; +import com.google.example.library.v1.ListPublishersResponse; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.ListShelvesResponse; +import com.google.example.library.v1.ListStringsRequest; +import com.google.example.library.v1.ListStringsResponse; +import com.google.example.library.v1.MergeShelvesRequest; +import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.PublishSeriesRequest; +import com.google.example.library.v1.PublishSeriesResponse; +import com.google.example.library.v1.Publisher; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.StreamBooksRequest; +import com.google.example.library.v1.StreamShelvesRequest; +import com.google.example.library.v1.StreamShelvesResponse; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; +import com.google.example.library.v1.UpdateBookIndexRequest; +import com.google.example.library.v1.UpdateBookRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.tagger.v1.LabelerGrpc; +import com.google.tagger.v1.TaggerProto.AddLabelRequest; +import com.google.tagger.v1.TaggerProto.AddLabelResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LibraryServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (library-example.googleapis.com) and default port (1234) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. + * + * For example, to set the total timeout of createShelf to 30 seconds: + * + *

+ * 
+ * LibraryServiceStubSettings.Builder librarySettingsBuilder =
+ *     LibraryServiceStubSettings.newBuilder();
+ * librarySettingsBuilder.createShelfSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * LibraryServiceStubSettings librarySettings = librarySettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class LibraryServiceStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/library") .build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - - Book actualResponse = - client.getBook(name); - Assert.assertEquals(expectedResponse, actualResponse); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + private final UnaryCallSettings createShelfSettings; + private final UnaryCallSettings getShelfSettings; + private final PagedCallSettings listShelvesSettings; + private final UnaryCallSettings deleteShelfSettings; + private final UnaryCallSettings mergeShelvesSettings; + private final UnaryCallSettings createBookSettings; + private final BatchingCallSettings publishSeriesSettings; + private final UnaryCallSettings getBookSettings; + private final PagedCallSettings listBooksSettings; + private final UnaryCallSettings deleteBookSettings; + private final UnaryCallSettings updateBookSettings; + private final UnaryCallSettings moveBookSettings; + private final PagedCallSettings listStringsSettings; + private final BatchingCallSettings addCommentsSettings; + private final UnaryCallSettings getBookFromArchiveSettings; + private final UnaryCallSettings getBookFromAnywhereSettings; + private final UnaryCallSettings getBookFromAbsolutelyAnywhereSettings; + private final UnaryCallSettings updateBookIndexSettings; + private final ServerStreamingCallSettings streamShelvesSettings; + private final ServerStreamingCallSettings streamBooksSettings; + private final StreamingCallSettings discussBookSettings; + private final StreamingCallSettings monologAboutBookSettings; + private final StreamingCallSettings babbleAboutBookSettings; + private final PagedCallSettings findRelatedBooksSettings; + private final UnaryCallSettings addLabelSettings; + private final UnaryCallSettings getBigBookSettings; + private final OperationCallSettings getBigBookOperationSettings; + private final UnaryCallSettings getBigNothingSettings; + private final OperationCallSettings getBigNothingOperationSettings; + private final UnaryCallSettings testOptionalRequiredFlatteningParamsSettings; + private final PagedCallSettings listPublishersSettings; + private final UnaryCallSettings privateListShelvesSettings; - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the object with the settings used for calls to createShelf. + */ + public UnaryCallSettings createShelfSettings() { + return createShelfSettings; } - @Test - @SuppressWarnings("all") - public void getBookExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - - client.getBook(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + /** + * Returns the object with the settings used for calls to getShelf. + */ + public UnaryCallSettings getShelfSettings() { + return getShelfSettings; } - @Test - @SuppressWarnings("all") - public void listBooksTest() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String filter = "book-filter-string"; - String name = "name3373707"; - - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, PublisherNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the object with the settings used for calls to listShelves. + */ + public PagedCallSettings listShelvesSettings() { + return listShelvesSettings; } - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String filter = "book-filter-string"; - String name = "name3373707"; - - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + /** + * Returns the object with the settings used for calls to deleteShelf. + */ + public UnaryCallSettings deleteShelfSettings() { + return deleteShelfSettings; } - @Test - @SuppressWarnings("all") - public void listBooksTest2() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String filter = "book-filter-string"; - ProjectName name = ProjectName.of("[PROJECT]"); - - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, ProjectName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the object with the settings used for calls to mergeShelves. + */ + public UnaryCallSettings mergeShelvesSettings() { + return mergeShelvesSettings; } - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String filter = "book-filter-string"; - ProjectName name = ProjectName.of("[PROJECT]"); + /** + * Returns the object with the settings used for calls to createBook. + */ + public UnaryCallSettings createBookSettings() { + return createBookSettings; + } - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + /** + * Returns the object with the settings used for calls to publishSeries. + */ + public BatchingCallSettings publishSeriesSettings() { + return publishSeriesSettings; } - @Test - @SuppressWarnings("all") - public void listBooksTest3() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns the object with the settings used for calls to getBook. + */ + public UnaryCallSettings getBookSettings() { + return getBookSettings; + } - String filter = "book-filter-string"; - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns the object with the settings used for calls to listBooks. + */ + public PagedCallSettings listBooksSettings() { + return listBooksSettings; + } - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + /** + * Returns the object with the settings used for calls to deleteBook. + */ + public UnaryCallSettings deleteBookSettings() { + return deleteBookSettings; + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + /** + * Returns the object with the settings used for calls to updateBook. + */ + public UnaryCallSettings updateBookSettings() { + return updateBookSettings; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + /** + * Returns the object with the settings used for calls to moveBook. + */ + public UnaryCallSettings moveBookSettings() { + return moveBookSettings; + } - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the object with the settings used for calls to listStrings. + */ + public PagedCallSettings listStringsSettings() { + return listStringsSettings; } - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** + * Returns the object with the settings used for calls to addComments. + */ + public BatchingCallSettings addCommentsSettings() { + return addCommentsSettings; + } - try { - String filter = "book-filter-string"; - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns the object with the settings used for calls to getBookFromArchive. + */ + public UnaryCallSettings getBookFromArchiveSettings() { + return getBookFromArchiveSettings; + } - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + /** + * Returns the object with the settings used for calls to getBookFromAnywhere. + */ + public UnaryCallSettings getBookFromAnywhereSettings() { + return getBookFromAnywhereSettings; } - @Test - @SuppressWarnings("all") - public void listBooksTest4() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns the object with the settings used for calls to getBookFromAbsolutelyAnywhere. + */ + public UnaryCallSettings getBookFromAbsolutelyAnywhereSettings() { + return getBookFromAbsolutelyAnywhereSettings; + } - String filter = "book-filter-string"; - OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + /** + * Returns the object with the settings used for calls to updateBookIndex. + */ + public UnaryCallSettings updateBookIndexSettings() { + return updateBookIndexSettings; + } - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + /** + * Returns the object with the settings used for calls to streamShelves. + */ + public ServerStreamingCallSettings streamShelvesSettings() { + return streamShelvesSettings; + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + /** + * Returns the object with the settings used for calls to streamBooks. + */ + public ServerStreamingCallSettings streamBooksSettings() { + return streamBooksSettings; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + /** + * Returns the object with the settings used for calls to discussBook. + */ + public StreamingCallSettings discussBookSettings() { + return discussBookSettings; + } - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, OrganizationName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the object with the settings used for calls to monologAboutBook. + */ + public StreamingCallSettings monologAboutBookSettings() { + return monologAboutBookSettings; } - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** + * Returns the object with the settings used for calls to babbleAboutBook. + */ + public StreamingCallSettings babbleAboutBookSettings() { + return babbleAboutBookSettings; + } - try { - String filter = "book-filter-string"; - OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + /** + * Returns the object with the settings used for calls to findRelatedBooks. + */ + public PagedCallSettings findRelatedBooksSettings() { + return findRelatedBooksSettings; + } - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + /** + * Returns the object with the settings used for calls to addLabel. + */ + public UnaryCallSettings addLabelSettings() { + return addLabelSettings; } - @Test - @SuppressWarnings("all") - public void listBooksTest5() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns the object with the settings used for calls to getBigBook. + */ + public UnaryCallSettings getBigBookSettings() { + return getBigBookSettings; + } - String filter = "book-filter-string"; - FolderName name = FolderName.of("[FOLDER]"); + /** + * Returns the object with the settings used for calls to getBigBook. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings getBigBookOperationSettings() { + return getBigBookOperationSettings; + } - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + /** + * Returns the object with the settings used for calls to getBigNothing. + */ + public UnaryCallSettings getBigNothingSettings() { + return getBigNothingSettings; + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + /** + * Returns the object with the settings used for calls to getBigNothing. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings getBigNothingOperationSettings() { + return getBigNothingOperationSettings; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + /** + * Returns the object with the settings used for calls to testOptionalRequiredFlatteningParams. + */ + public UnaryCallSettings testOptionalRequiredFlatteningParamsSettings() { + return testOptionalRequiredFlatteningParamsSettings; + } - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, FolderName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the object with the settings used for calls to listPublishers. + */ + public PagedCallSettings listPublishersSettings() { + return listPublishersSettings; } - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest5() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** + * Returns the object with the settings used for calls to privateListShelves. + */ + public UnaryCallSettings privateListShelvesSettings() { + return privateListShelvesSettings; + } - try { - String filter = "book-filter-string"; - FolderName name = FolderName.of("[FOLDER]"); - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LibraryServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcLibraryServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); } } - @Test - @SuppressWarnings("all") - public void listBooksTest6() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } - String filter = "book-filter-string"; - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "library-example.googleapis.com:1234"; + } - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; } - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest6() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } - try { - String filter = "book-filter-string"; - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(LibraryServiceStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - @Test - @SuppressWarnings("all") - public void listBooksTest7() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } - String filter = "book-filter-string"; - ArchiveName name = ArchiveName.of("[ARCHIVE]"); + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + protected LibraryServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createShelfSettings = settingsBuilder.createShelfSettings().build(); + getShelfSettings = settingsBuilder.getShelfSettings().build(); + listShelvesSettings = settingsBuilder.listShelvesSettings().build(); + deleteShelfSettings = settingsBuilder.deleteShelfSettings().build(); + mergeShelvesSettings = settingsBuilder.mergeShelvesSettings().build(); + createBookSettings = settingsBuilder.createBookSettings().build(); + publishSeriesSettings = settingsBuilder.publishSeriesSettings().build(); + getBookSettings = settingsBuilder.getBookSettings().build(); + listBooksSettings = settingsBuilder.listBooksSettings().build(); + deleteBookSettings = settingsBuilder.deleteBookSettings().build(); + updateBookSettings = settingsBuilder.updateBookSettings().build(); + moveBookSettings = settingsBuilder.moveBookSettings().build(); + listStringsSettings = settingsBuilder.listStringsSettings().build(); + addCommentsSettings = settingsBuilder.addCommentsSettings().build(); + getBookFromArchiveSettings = settingsBuilder.getBookFromArchiveSettings().build(); + getBookFromAnywhereSettings = settingsBuilder.getBookFromAnywhereSettings().build(); + getBookFromAbsolutelyAnywhereSettings = settingsBuilder.getBookFromAbsolutelyAnywhereSettings().build(); + updateBookIndexSettings = settingsBuilder.updateBookIndexSettings().build(); + streamShelvesSettings = settingsBuilder.streamShelvesSettings().build(); + streamBooksSettings = settingsBuilder.streamBooksSettings().build(); + discussBookSettings = settingsBuilder.discussBookSettings().build(); + monologAboutBookSettings = settingsBuilder.monologAboutBookSettings().build(); + babbleAboutBookSettings = settingsBuilder.babbleAboutBookSettings().build(); + findRelatedBooksSettings = settingsBuilder.findRelatedBooksSettings().build(); + addLabelSettings = settingsBuilder.addLabelSettings().build(); + getBigBookSettings = settingsBuilder.getBigBookSettings().build(); + getBigBookOperationSettings = settingsBuilder.getBigBookOperationSettings().build(); + getBigNothingSettings = settingsBuilder.getBigNothingSettings().build(); + getBigNothingOperationSettings = settingsBuilder.getBigNothingOperationSettings().build(); + testOptionalRequiredFlatteningParamsSettings = settingsBuilder.testOptionalRequiredFlatteningParamsSettings().build(); + listPublishersSettings = settingsBuilder.listPublishersSettings().build(); + privateListShelvesSettings = settingsBuilder.privateListShelvesSettings().build(); + } + + private static final PagedListDescriptor LIST_SHELVES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListShelvesRequest injectToken(ListShelvesRequest payload, String token) { + return ListShelvesRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListShelvesRequest injectPageSize(ListShelvesRequest payload, int pageSize) { + throw new UnsupportedOperationException("page size is not supported by this API method"); + } + @Override + public Integer extractPageSize(ListShelvesRequest payload) { + throw new UnsupportedOperationException("page size is not supported by this API method"); + } + @Override + public String extractNextToken(ListShelvesResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListShelvesResponse payload) { + return payload.getShelvesList() != null ? payload.getShelvesList() : + ImmutableList.of(); + } + }; + + private static final PagedListDescriptor LIST_BOOKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListBooksRequest injectToken(ListBooksRequest payload, String token) { + return ListBooksRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListBooksRequest injectPageSize(ListBooksRequest payload, int pageSize) { + return ListBooksRequest + .newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListBooksRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(ListBooksResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListBooksResponse payload) { + return payload.getBooksList() != null ? payload.getBooksList() : + ImmutableList.of(); + } + }; + + private static final PagedListDescriptor LIST_STRINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListStringsRequest injectToken(ListStringsRequest payload, String token) { + return ListStringsRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListStringsRequest injectPageSize(ListStringsRequest payload, int pageSize) { + return ListStringsRequest + .newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListStringsRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(ListStringsResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListStringsResponse payload) { + return payload.getStringsList() != null ? payload.getStringsList() : + ImmutableList.of(); + } + }; - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + private static final PagedListDescriptor FIND_RELATED_BOOKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public FindRelatedBooksRequest injectToken(FindRelatedBooksRequest payload, String token) { + return FindRelatedBooksRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public FindRelatedBooksRequest injectPageSize(FindRelatedBooksRequest payload, int pageSize) { + return FindRelatedBooksRequest + .newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + @Override + public Integer extractPageSize(FindRelatedBooksRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(FindRelatedBooksResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(FindRelatedBooksResponse payload) { + return payload.getNamesList() != null ? payload.getNamesList() : + ImmutableList.of(); + } + }; - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, ArchiveName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + private static final PagedListDescriptor LIST_PUBLISHERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + @Override + public ListPublishersRequest injectToken(ListPublishersRequest payload, String token) { + return ListPublishersRequest + .newBuilder(payload) + .setPageToken(token) + .build(); + } + @Override + public ListPublishersRequest injectPageSize(ListPublishersRequest payload, int pageSize) { + return ListPublishersRequest + .newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + @Override + public Integer extractPageSize(ListPublishersRequest payload) { + return payload.getPageSize(); + } + @Override + public String extractNextToken(ListPublishersResponse payload) { + return payload.getNextPageToken(); + } + @Override + public Iterable extractResources(ListPublishersResponse payload) { + return payload.getPublishersList() != null ? payload.getPublishersList() : + ImmutableList.of(); + } + }; - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest7() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + private static final PagedListResponseFactory LIST_SHELVES_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListShelvesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SHELVES_PAGE_STR_DESC, request, context); + return ListShelvesPagedResponse.createAsync(pageContext, futureResponse); + } + }; - try { - String filter = "book-filter-string"; - ArchiveName name = ArchiveName.of("[ARCHIVE]"); + private static final PagedListResponseFactory LIST_BOOKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBooksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BOOKS_PAGE_STR_DESC, request, context); + return ListBooksPagedResponse.createAsync(pageContext, futureResponse); + } + }; - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + private static final PagedListResponseFactory LIST_STRINGS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListStringsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_STRINGS_PAGE_STR_DESC, request, context); + return ListStringsPagedResponse.createAsync(pageContext, futureResponse); + } + }; - @Test - @SuppressWarnings("all") - public void listBooksTest8() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + private static final PagedListResponseFactory FIND_RELATED_BOOKS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + FindRelatedBooksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, FIND_RELATED_BOOKS_PAGE_STR_DESC, request, context); + return FindRelatedBooksPagedResponse.createAsync(pageContext, futureResponse); + } + }; - String filter = "book-filter-string"; - ShelfName name = ShelfName.of("[SHELF_ID]"); + private static final PagedListResponseFactory LIST_PUBLISHERS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPublishersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PUBLISHERS_PAGE_STR_DESC, request, context); + return ListPublishersPagedResponse.createAsync(pageContext, futureResponse); + } + }; - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + private static final BatchingDescriptor PUBLISH_SERIES_BATCHING_DESC = + new BatchingDescriptor() { + @Override + public PartitionKey getBatchPartitionKey(PublishSeriesRequest request) { + return new PartitionKey(request.getEdition(), request.getName()); + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + @Override + public RequestBuilder getRequestBuilder() { + return new RequestBuilder() { + private PublishSeriesRequest.Builder builder; + @Override + public void appendRequest(PublishSeriesRequest request) { + if (builder == null) { + builder = request.toBuilder(); + } else { + builder.addAllBooks(request.getBooksList()); + } + } + @Override + public PublishSeriesRequest build() { + return builder.build(); + } + }; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + @Override + public void splitResponse( + PublishSeriesResponse batchResponse, + Collection> batch) { + int batchMessageIndex = 0; + for (BatchedRequestIssuer responder : batch) { + List subresponseElements = new ArrayList<>(); + long subresponseCount = responder.getMessageCount(); + for (int i = 0; i < subresponseCount; i++) { + subresponseElements.add(batchResponse.getBookNames(batchMessageIndex)); + batchMessageIndex += 1; + } + PublishSeriesResponse response = + PublishSeriesResponse.newBuilder().addAllBookNames(subresponseElements).build(); + responder.setResponse(response); + } + } - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + @Override + public void splitException( + Throwable throwable, + Collection> batch) { + for (BatchedRequestIssuer responder : batch) { + responder.setException(throwable); + } + } - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest8() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + @Override + public long countElements(PublishSeriesRequest request) { + return request.getBooksCount(); + } - try { - String filter = "book-filter-string"; - ShelfName name = ShelfName.of("[SHELF_ID]"); + @Override + public long countBytes(PublishSeriesRequest request) { + return request.getSerializedSize(); + } + }; - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + private static final BatchingDescriptor ADD_COMMENTS_BATCHING_DESC = + new BatchingDescriptor() { + @Override + public PartitionKey getBatchPartitionKey(AddCommentsRequest request) { + return new PartitionKey(request.getName()); + } - @Test - @SuppressWarnings("all") - public void listBooksTest9() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + @Override + public RequestBuilder getRequestBuilder() { + return new RequestBuilder() { + private AddCommentsRequest.Builder builder; + @Override + public void appendRequest(AddCommentsRequest request) { + if (builder == null) { + builder = request.toBuilder(); + } else { + builder.addAllComments(request.getCommentsList()); + } + } + @Override + public AddCommentsRequest build() { + return builder.build(); + } + }; + } - String filter = "book-filter-string"; - BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]"); + @Override + public void splitResponse( + Empty batchResponse, + Collection> batch) { + int batchMessageIndex = 0; + for (BatchedRequestIssuer responder : batch) { + Empty response = + Empty.newBuilder().build(); + responder.setResponse(response); + } + } - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + @Override + public void splitException( + Throwable throwable, + Collection> batch) { + for (BatchedRequestIssuer responder : batch) { + responder.setException(throwable); + } + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + @Override + public long countElements(AddCommentsRequest request) { + return request.getCommentsCount(); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + @Override + public long countBytes(AddCommentsRequest request) { + return request.getSerializedSize(); + } + }; - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, BillingAccountName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + /** + * Builder for LibraryServiceStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest9() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + private final UnaryCallSettings.Builder createShelfSettings; + private final UnaryCallSettings.Builder getShelfSettings; + private final PagedCallSettings.Builder listShelvesSettings; + private final UnaryCallSettings.Builder deleteShelfSettings; + private final UnaryCallSettings.Builder mergeShelvesSettings; + private final UnaryCallSettings.Builder createBookSettings; + private final BatchingCallSettings.Builder publishSeriesSettings; + private final UnaryCallSettings.Builder getBookSettings; + private final PagedCallSettings.Builder listBooksSettings; + private final UnaryCallSettings.Builder deleteBookSettings; + private final UnaryCallSettings.Builder updateBookSettings; + private final UnaryCallSettings.Builder moveBookSettings; + private final PagedCallSettings.Builder listStringsSettings; + private final BatchingCallSettings.Builder addCommentsSettings; + private final UnaryCallSettings.Builder getBookFromArchiveSettings; + private final UnaryCallSettings.Builder getBookFromAnywhereSettings; + private final UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings; + private final UnaryCallSettings.Builder updateBookIndexSettings; + private final ServerStreamingCallSettings.Builder streamShelvesSettings; + private final ServerStreamingCallSettings.Builder streamBooksSettings; + private final StreamingCallSettings.Builder discussBookSettings; + private final StreamingCallSettings.Builder monologAboutBookSettings; + private final StreamingCallSettings.Builder babbleAboutBookSettings; + private final PagedCallSettings.Builder findRelatedBooksSettings; + private final UnaryCallSettings.Builder addLabelSettings; + private final UnaryCallSettings.Builder getBigBookSettings; + private final OperationCallSettings.Builder getBigBookOperationSettings; + private final UnaryCallSettings.Builder getBigNothingSettings; + private final OperationCallSettings.Builder getBigNothingOperationSettings; + private final UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings; + private final PagedCallSettings.Builder listPublishersSettings; + private final UnaryCallSettings.Builder privateListShelvesSettings; - try { - String filter = "book-filter-string"; - BillingAccountName name = BillingAccountName.of("[BILLING_ACCOUNT]"); + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); } - } - @Test - @SuppressWarnings("all") - public void listBooksTest10() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - String filter = "book-filter-string"; - LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.2) + .setMaxRetryDelay(Duration.ofMillis(1000L)) + .setInitialRpcTimeout(Duration.ofMillis(300L)) + .setRpcTimeoutMultiplier(1.3) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + protected Builder() { + this((ClientContext) null); + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + protected Builder(ClientContext clientContext) { + super(clientContext); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + createShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, LocationName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + getShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest10() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + listShelvesSettings = PagedCallSettings.newBuilder( + LIST_SHELVES_PAGE_STR_FACT); - try { - String filter = "book-filter-string"; - LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + deleteShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + mergeShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - @Test - @SuppressWarnings("all") - public void listBooksTest11() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); + createBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - String filter = "book-filter-string"; - String name = "name3373707"; + publishSeriesSettings = BatchingCallSettings.newBuilder( + PUBLISH_SERIES_BATCHING_DESC) + .setBatchingSettings(BatchingSettings.newBuilder().build()); - ListBooksPagedResponse pagedListResponse = client.listBooks(filter, name); + getBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + listBooksSettings = PagedCallSettings.newBuilder( + LIST_BOOKS_PAGE_STR_FACT); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + deleteBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + updateBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest11() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + moveBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - try { - String filter = "book-filter-string"; - String name = "name3373707"; + listStringsSettings = PagedCallSettings.newBuilder( + LIST_STRINGS_PAGE_STR_FACT); - client.listBooks(filter, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + addCommentsSettings = BatchingCallSettings.newBuilder( + ADD_COMMENTS_BATCHING_DESC) + .setBatchingSettings(BatchingSettings.newBuilder().build()); - @Test - @SuppressWarnings("all") - public void deleteBookTest() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); + getBookFromArchiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getBookFromAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + getBookFromAbsolutelyAnywhereSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - client.deleteBook(name); + updateBookIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + streamShelvesSettings = ServerStreamingCallSettings.newBuilder(); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + streamBooksSettings = ServerStreamingCallSettings.newBuilder(); - @Test - @SuppressWarnings("all") - public void deleteBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + discussBookSettings = StreamingCallSettings.newBuilder(); - try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + monologAboutBookSettings = StreamingCallSettings.newBuilder(); - client.deleteBook(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + babbleAboutBookSettings = StreamingCallSettings.newBuilder(); - @Test - @SuppressWarnings("all") - public void deleteBookTest2() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); + findRelatedBooksSettings = PagedCallSettings.newBuilder( + FIND_RELATED_BOOKS_PAGE_STR_FACT); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + addLabelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - client.deleteBook(name); + getBigBookSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + getBigBookOperationSettings = OperationCallSettings.newBuilder(); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + getBigNothingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - @Test - @SuppressWarnings("all") - public void deleteBookExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + getBigNothingOperationSettings = OperationCallSettings.newBuilder(); - try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + testOptionalRequiredFlatteningParamsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - client.deleteBook(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + listPublishersSettings = PagedCallSettings.newBuilder( + LIST_PUBLISHERS_PAGE_STR_FACT); - @Test - @SuppressWarnings("all") - public void updateBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + privateListShelvesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + unaryMethodSettingsBuilders = ImmutableList.>of( + createShelfSettings, + getShelfSettings, + listShelvesSettings, + deleteShelfSettings, + mergeShelvesSettings, + createBookSettings, + publishSeriesSettings, + getBookSettings, + listBooksSettings, + deleteBookSettings, + updateBookSettings, + moveBookSettings, + listStringsSettings, + addCommentsSettings, + getBookFromArchiveSettings, + getBookFromAnywhereSettings, + getBookFromAbsolutelyAnywhereSettings, + updateBookIndexSettings, + findRelatedBooksSettings, + addLabelSettings, + getBigBookSettings, + getBigNothingSettings, + testOptionalRequiredFlatteningParamsSettings, + listPublishersSettings, + privateListShelvesSettings + ); - Book actualResponse = - client.updateBook(book, name); - Assert.assertEquals(expectedResponse, actualResponse); + initDefaults(this); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + private static Builder initDefaults(Builder builder) { - @Test - @SuppressWarnings("all") - public void updateBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + builder.createShelfSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - try { - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + builder.getShelfSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - client.updateBook(book, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + builder.listShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - @Test - @SuppressWarnings("all") - public void updateBookTest2() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + builder.deleteShelfSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + builder.mergeShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - Book actualResponse = - client.updateBook(book, name); - Assert.assertEquals(expectedResponse, actualResponse); + builder.createBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + builder.publishSeriesSettings().setBatchingSettings( + BatchingSettings.newBuilder() + .setElementCountThreshold(6L) + .setRequestByteThreshold(100000L) + .setDelayThreshold(Duration.ofMillis(500)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setLimitExceededBehavior(LimitExceededBehavior.Ignore) + .build()) + .build()); + builder.publishSeriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + builder.getBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - @Test - @SuppressWarnings("all") - public void updateBookExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + builder.listBooksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - try { - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + builder.deleteBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - client.updateBook(book, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + builder.updateBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - @Test - @SuppressWarnings("all") - public void updateBookTest3() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + builder.moveBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - FieldMask physicalMask = FieldMask.newBuilder().build(); - com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); + builder.listStringsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder.addCommentsSettings().setBatchingSettings( + BatchingSettings.newBuilder() + .setElementCountThreshold(6L) + .setRequestByteThreshold(100000L) + .setDelayThreshold(Duration.ofMillis(500)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setLimitExceededBehavior(LimitExceededBehavior.Ignore) + .build()) + .build()); + builder.addCommentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - Book actualResponse = - client.updateBook(optionalFoo, book, name, physicalMask, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); + builder.getBookFromArchiveSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + builder.getBookFromAnywhereSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + builder.getBookFromAbsolutelyAnywhereSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - @Test - @SuppressWarnings("all") - public void updateBookExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + builder.updateBookIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - try { - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - FieldMask physicalMask = FieldMask.newBuilder().build(); - com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); + builder.streamShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - client.updateBook(optionalFoo, book, name, physicalMask, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } + builder.streamBooksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - @Test - @SuppressWarnings("all") - public void updateBookTest4() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + builder.findRelatedBooksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - FieldMask physicalMask = FieldMask.newBuilder().build(); - com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); + builder.addLabelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - Book actualResponse = - client.updateBook(optionalFoo, book, name, physicalMask, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); + builder.getBigBookSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + builder.getBigNothingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + builder.testOptionalRequiredFlatteningParamsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - @Test - @SuppressWarnings("all") - public void updateBookExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + builder.listPublishersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - try { - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - FieldMask physicalMask = FieldMask.newBuilder().build(); - com.google.protobuf.FieldMask updateMask = com.google.protobuf.FieldMask.newBuilder().build(); + builder.privateListShelvesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getBigBookOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Book.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + builder + .getBigNothingOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(GetBigBookMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(600000L)) + .build())); - client.updateBook(optionalFoo, book, name, physicalMask, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + return builder; } - } - - @Test - @SuppressWarnings("all") - public void moveBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + protected Builder(LibraryServiceStubSettings settings) { + super(settings); - Book actualResponse = - client.moveBook(otherShelfName, name); - Assert.assertEquals(expectedResponse, actualResponse); + createShelfSettings = settings.createShelfSettings.toBuilder(); + getShelfSettings = settings.getShelfSettings.toBuilder(); + listShelvesSettings = settings.listShelvesSettings.toBuilder(); + deleteShelfSettings = settings.deleteShelfSettings.toBuilder(); + mergeShelvesSettings = settings.mergeShelvesSettings.toBuilder(); + createBookSettings = settings.createBookSettings.toBuilder(); + publishSeriesSettings = settings.publishSeriesSettings.toBuilder(); + getBookSettings = settings.getBookSettings.toBuilder(); + listBooksSettings = settings.listBooksSettings.toBuilder(); + deleteBookSettings = settings.deleteBookSettings.toBuilder(); + updateBookSettings = settings.updateBookSettings.toBuilder(); + moveBookSettings = settings.moveBookSettings.toBuilder(); + listStringsSettings = settings.listStringsSettings.toBuilder(); + addCommentsSettings = settings.addCommentsSettings.toBuilder(); + getBookFromArchiveSettings = settings.getBookFromArchiveSettings.toBuilder(); + getBookFromAnywhereSettings = settings.getBookFromAnywhereSettings.toBuilder(); + getBookFromAbsolutelyAnywhereSettings = settings.getBookFromAbsolutelyAnywhereSettings.toBuilder(); + updateBookIndexSettings = settings.updateBookIndexSettings.toBuilder(); + streamShelvesSettings = settings.streamShelvesSettings.toBuilder(); + streamBooksSettings = settings.streamBooksSettings.toBuilder(); + discussBookSettings = settings.discussBookSettings.toBuilder(); + monologAboutBookSettings = settings.monologAboutBookSettings.toBuilder(); + babbleAboutBookSettings = settings.babbleAboutBookSettings.toBuilder(); + findRelatedBooksSettings = settings.findRelatedBooksSettings.toBuilder(); + addLabelSettings = settings.addLabelSettings.toBuilder(); + getBigBookSettings = settings.getBigBookSettings.toBuilder(); + getBigBookOperationSettings = settings.getBigBookOperationSettings.toBuilder(); + getBigNothingSettings = settings.getBigNothingSettings.toBuilder(); + getBigNothingOperationSettings = settings.getBigNothingOperationSettings.toBuilder(); + testOptionalRequiredFlatteningParamsSettings = settings.testOptionalRequiredFlatteningParamsSettings.toBuilder(); + listPublishersSettings = settings.listPublishersSettings.toBuilder(); + privateListShelvesSettings = settings.privateListShelvesSettings.toBuilder(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); + unaryMethodSettingsBuilders = ImmutableList.>of( + createShelfSettings, + getShelfSettings, + listShelvesSettings, + deleteShelfSettings, + mergeShelvesSettings, + createBookSettings, + publishSeriesSettings, + getBookSettings, + listBooksSettings, + deleteBookSettings, + updateBookSettings, + moveBookSettings, + listStringsSettings, + addCommentsSettings, + getBookFromArchiveSettings, + getBookFromAnywhereSettings, + getBookFromAbsolutelyAnywhereSettings, + updateBookIndexSettings, + findRelatedBooksSettings, + addLabelSettings, + getBigBookSettings, + getBigNothingSettings, + testOptionalRequiredFlatteningParamsSettings, + listPublishersSettings, + privateListShelvesSettings + ); + } - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } - @Test - @SuppressWarnings("all") - public void moveBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } - try { - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns the builder for the settings used for calls to createShelf. + */ + public UnaryCallSettings.Builder createShelfSettings() { + return createShelfSettings; + } - client.moveBook(otherShelfName, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + /** + * Returns the builder for the settings used for calls to getShelf. + */ + public UnaryCallSettings.Builder getShelfSettings() { + return getShelfSettings; } - } - @Test - @SuppressWarnings("all") - public void moveBookTest2() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns the builder for the settings used for calls to listShelves. + */ + public PagedCallSettings.Builder listShelvesSettings() { + return listShelvesSettings; + } - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns the builder for the settings used for calls to deleteShelf. + */ + public UnaryCallSettings.Builder deleteShelfSettings() { + return deleteShelfSettings; + } - Book actualResponse = - client.moveBook(otherShelfName, name); - Assert.assertEquals(expectedResponse, actualResponse); + /** + * Returns the builder for the settings used for calls to mergeShelves. + */ + public UnaryCallSettings.Builder mergeShelvesSettings() { + return mergeShelvesSettings; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); + /** + * Returns the builder for the settings used for calls to createBook. + */ + public UnaryCallSettings.Builder createBookSettings() { + return createBookSettings; + } - Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + /** + * Returns the builder for the settings used for calls to publishSeries. + */ + public BatchingCallSettings.Builder publishSeriesSettings() { + return publishSeriesSettings; + } - @Test - @SuppressWarnings("all") - public void moveBookExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** + * Returns the builder for the settings used for calls to getBook. + */ + public UnaryCallSettings.Builder getBookSettings() { + return getBookSettings; + } - try { - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns the builder for the settings used for calls to listBooks. + */ + public PagedCallSettings.Builder listBooksSettings() { + return listBooksSettings; + } - client.moveBook(otherShelfName, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + /** + * Returns the builder for the settings used for calls to deleteBook. + */ + public UnaryCallSettings.Builder deleteBookSettings() { + return deleteBookSettings; } - } - @Test - @SuppressWarnings("all") - public void listStringsTest() { - String nextPageToken = ""; - ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); - List strings = Arrays.asList(stringsElement); - ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllStrings(UntypedResourceName.toStringList(strings)) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns the builder for the settings used for calls to updateBook. + */ + public UnaryCallSettings.Builder updateBookSettings() { + return updateBookSettings; + } - ResourceName name = ArchiveName.of("[ARCHIVE]"); + /** + * Returns the builder for the settings used for calls to moveBook. + */ + public UnaryCallSettings.Builder moveBookSettings() { + return moveBookSettings; + } - ListStringsPagedResponse pagedListResponse = client.listStrings(name); + /** + * Returns the builder for the settings used for calls to listStrings. + */ + public PagedCallSettings.Builder listStringsSettings() { + return listStringsSettings; + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); + /** + * Returns the builder for the settings used for calls to addComments. + */ + public BatchingCallSettings.Builder addCommentsSettings() { + return addCommentsSettings; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); + /** + * Returns the builder for the settings used for calls to getBookFromArchive. + */ + public UnaryCallSettings.Builder getBookFromArchiveSettings() { + return getBookFromArchiveSettings; + } - Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + /** + * Returns the builder for the settings used for calls to getBookFromAnywhere. + */ + public UnaryCallSettings.Builder getBookFromAnywhereSettings() { + return getBookFromAnywhereSettings; + } - @Test - @SuppressWarnings("all") - public void listStringsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** + * Returns the builder for the settings used for calls to getBookFromAbsolutelyAnywhere. + */ + public UnaryCallSettings.Builder getBookFromAbsolutelyAnywhereSettings() { + return getBookFromAbsolutelyAnywhereSettings; + } - try { - ResourceName name = ArchiveName.of("[ARCHIVE]"); + /** + * Returns the builder for the settings used for calls to updateBookIndex. + */ + public UnaryCallSettings.Builder updateBookIndexSettings() { + return updateBookIndexSettings; + } - client.listStrings(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + /** + * Returns the builder for the settings used for calls to streamShelves. + */ + public ServerStreamingCallSettings.Builder streamShelvesSettings() { + return streamShelvesSettings; } - } - @Test - @SuppressWarnings("all") - public void listStringsTest2() { - String nextPageToken = ""; - ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); - List strings = Arrays.asList(stringsElement); - ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllStrings(UntypedResourceName.toStringList(strings)) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns the builder for the settings used for calls to streamBooks. + */ + public ServerStreamingCallSettings.Builder streamBooksSettings() { + return streamBooksSettings; + } - ResourceName name = ArchiveName.of("[ARCHIVE]"); + /** + * Returns the builder for the settings used for calls to discussBook. + */ + public StreamingCallSettings.Builder discussBookSettings() { + return discussBookSettings; + } - ListStringsPagedResponse pagedListResponse = client.listStrings(name); + /** + * Returns the builder for the settings used for calls to monologAboutBook. + */ + public StreamingCallSettings.Builder monologAboutBookSettings() { + return monologAboutBookSettings; + } - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); + /** + * Returns the builder for the settings used for calls to babbleAboutBook. + */ + public StreamingCallSettings.Builder babbleAboutBookSettings() { + return babbleAboutBookSettings; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); + /** + * Returns the builder for the settings used for calls to findRelatedBooks. + */ + public PagedCallSettings.Builder findRelatedBooksSettings() { + return findRelatedBooksSettings; + } - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + /** + * Returns the builder for the settings used for calls to addLabel. + */ + public UnaryCallSettings.Builder addLabelSettings() { + return addLabelSettings; + } - @Test - @SuppressWarnings("all") - public void listStringsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** + * Returns the builder for the settings used for calls to getBigBook. + */ + public UnaryCallSettings.Builder getBigBookSettings() { + return getBigBookSettings; + } - try { - ResourceName name = ArchiveName.of("[ARCHIVE]"); + /** + * Returns the builder for the settings used for calls to getBigBook. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder getBigBookOperationSettings() { + return getBigBookOperationSettings; + } - client.listStrings(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + /** + * Returns the builder for the settings used for calls to getBigNothing. + */ + public UnaryCallSettings.Builder getBigNothingSettings() { + return getBigNothingSettings; } - } - @Test - @SuppressWarnings("all") - public void addCommentsTest() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); + /** + * Returns the builder for the settings used for calls to getBigNothing. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder getBigNothingOperationSettings() { + return getBigNothingOperationSettings; + } - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns the builder for the settings used for calls to testOptionalRequiredFlatteningParams. + */ + public UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings() { + return testOptionalRequiredFlatteningParamsSettings; + } - client.addComments(comments, name); + /** + * Returns the builder for the settings used for calls to listPublishers. + */ + public PagedCallSettings.Builder listPublishersSettings() { + return listPublishersSettings; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); + /** + * Returns the builder for the settings used for calls to privateListShelves. + */ + public UnaryCallSettings.Builder privateListShelvesSettings() { + return privateListShelvesSettings; + } - Assert.assertEquals(comments, actualRequest.getCommentsList()); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + @Override + public LibraryServiceStubSettings build() throws IOException { + return new LibraryServiceStubSettings(this); + } } +} +============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStub.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; - @Test - @SuppressWarnings("all") - public void addCommentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import javax.annotation.Generated; - try { - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Google Example Library API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class MyProtoStub implements BackgroundResource { - client.addComments(comments, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + + public UnaryCallable myMethodCallable() { + throw new UnsupportedOperationException("Not implemented: myMethodCallable()"); } - @Test - @SuppressWarnings("all") - public void addCommentsTest2() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); + @Override + public abstract void close(); +} +============== file: src/main/java/com/google/example/library/v1/stub/MyProtoStubSettings.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1.stub; - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.protos.google.example.library.v1.AnotherService.MethodRequest; +import com.google.protos.google.example.library.v1.AnotherService.MethodResponse; +import com.google.protos.google.example.library.v1.MyProtoGrpc; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link MyProtoStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (library-example.googleapis.com) and default port (1234) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. + * When build() is called, the tree of builders is called to create the complete settings + * object. + * + * For example, to set the total timeout of myMethod to 30 seconds: + * + *

+ * 
+ * MyProtoStubSettings.Builder myProtoSettingsBuilder =
+ *     MyProtoStubSettings.newBuilder();
+ * myProtoSettingsBuilder.myMethodSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * MyProtoStubSettings myProtoSettings = myProtoSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class MyProtoStubSettings extends StubSettings { + /** + * The default scopes of the service. + */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/library") .build(); - List comments = Arrays.asList(commentsElement); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.addComments(comments, name); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); + private final UnaryCallSettings myMethodSettings; - Assert.assertEquals(comments, actualRequest.getCommentsList()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the object with the settings used for calls to myMethod. + */ + public UnaryCallSettings myMethodSettings() { + return myMethodSettings; } - @Test - @SuppressWarnings("all") - public void addCommentsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.addComments(comments, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public MyProtoStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMyProtoStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); } } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + /** + * Returns a builder for the default ExecutorProvider for this service. + */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } - BookFromArchive actualResponse = - client.getBookFromArchive(parent, name); - Assert.assertEquals(expectedResponse, actualResponse); + /** + * Returns the default service endpoint. + */ + public static String getDefaultEndpoint() { + return "library-example.googleapis.com:1234"; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns the default service scopes. + */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - client.getBookFromArchive(parent, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + /** + * Returns a builder for the default credentials for this service. + */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + ; } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest2() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } - BookFromArchive actualResponse = - client.getBookFromArchive(parent, name); - Assert.assertEquals(expectedResponse, actualResponse); + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MyProtoStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder() { + return Builder.createDefault(); + } - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + /** + * Returns a new builder for this class. + */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + /** + * Returns a builder containing all the values of this settings class. + */ + public Builder toBuilder() { + return new Builder(this); + } - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + protected MyProtoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); - client.getBookFromArchive(parent, name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + myMethodSettings = settingsBuilder.myMethodSettings().build(); } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest3() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String parent = "parent-995424086"; - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, PublisherNames.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + /** + * Builder for MyProtoStubSettings. + */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + private final UnaryCallSettings.Builder myMethodSettings; - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String parent = "parent-995424086"; + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "non_idempotent", + ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); } - } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest4() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); + protected Builder() { + this((ClientContext) null); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + protected Builder(ClientContext clientContext) { + super(clientContext); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + myMethodSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + unaryMethodSettingsBuilders = ImmutableList.>of( + myMethodSettings + ); - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); + initDefaults(this); + } - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } - } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest5() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + private static Builder initDefaults(Builder builder) { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + builder.myMethodSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); + return builder; + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + protected Builder(MyProtoStubSettings settings) { + super(settings); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, BookNames.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + myMethodSettings = settings.myMethodSettings.toBuilder(); - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest5() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + unaryMethodSettingsBuilders = ImmutableList.>of( + myMethodSettings + ); + } - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BookName parent = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods(ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** + * Returns the builder for the settings used for calls to myMethod. + */ + public UnaryCallSettings.Builder myMethodSettings() { + return myMethodSettings; + } + + @Override + public MyProtoStubSettings build() throws IOException { + return new MyProtoStubSettings(this); } } +} +============== file: src/test/java/com/google/example/library/v1/LibraryClientTest.java ============== +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.example.library.v1; - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest6() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.example.library.v1.Comment; +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; +import com.google.example.library.v1.SomeMessage2; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; +import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.BoolValue; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.DoubleValue; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.FloatValue; +import com.google.protobuf.Int32Value; +import com.google.protobuf.Int64Value; +import com.google.protobuf.ListValue; +import com.google.protobuf.StringValue; +import com.google.protobuf.Struct; +import com.google.protobuf.Timestamp; +import com.google.protobuf.UInt32Value; +import com.google.protobuf.UInt64Value; +import com.google.protobuf.Value; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); +@javax.annotation.Generated("by GAPIC") +public class LibraryClientTest { + private static MockLibraryService mockLibraryService; + private static MockLabeler mockLabeler; + private static MockMyProto mockMyProto; + private static MockServiceHelper serviceHelper; + private LibraryClient client; + private LocalChannelProvider channelProvider; - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); + @BeforeClass + public static void startStaticServer() { + mockLibraryService = new MockLibraryService(); + mockLabeler = new MockLabeler(); + mockMyProto = new MockMyProto(); + serviceHelper = new MockServiceHelper(UUID.randomUUID().toString(), Arrays.asList(mockLibraryService, mockLabeler, mockMyProto)); + serviceHelper.start(); + } - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + LibrarySettings settings = LibrarySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LibraryClient.create(settings); } - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest6() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + @After + public void tearDown() throws Exception { + client.close(); } @Test @SuppressWarnings("all") - public void getBookFromArchiveTest7() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void createShelfTest() { + ShelfName name = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) .build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - FolderName parent = FolderName.of("[FOLDER]"); + Shelf shelf = Shelf.newBuilder().build(); - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); + Shelf actualResponse = + client.createShelf(shelf); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + CreateShelfRequest actualRequest = (CreateShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, FolderName.parse(actualRequest.getParent())); + Assert.assertEquals(shelf, actualRequest.getShelf()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17624,15 +14066,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest7() throws Exception { + public void createShelfExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - FolderName parent = FolderName.of("[FOLDER]"); + Shelf shelf = Shelf.newBuilder().build(); - client.getBookFromArchive(name, parent); + client.createShelf(shelf); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -17641,32 +14082,28 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest8() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() + public void getShelfTest() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + .setTheme(theme) + .setInternalTheme(internalTheme) .build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); + Shelf actualResponse = + client.getShelf(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ArchivedBookName.parse(actualRequest.getParent())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17675,15 +14112,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest8() throws Exception { + public void getShelfExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchivedBookName parent = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - client.getBookFromArchive(name, parent); + client.getShelf(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -17692,32 +14128,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest9() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() + public void getShelfTest2() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + .setTheme(theme) + .setInternalTheme(internalTheme) .build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchiveName parent = ArchiveName.of("[ARCHIVE]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); + Shelf actualResponse = + client.getShelf(name, message); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ArchiveName.parse(actualRequest.getParent())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(message, actualRequest.getMessage()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17726,15 +14160,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest9() throws Exception { + public void getShelfExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ArchiveName parent = ArchiveName.of("[ARCHIVE]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); - client.getBookFromArchive(name, parent); + client.getShelf(name, message); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -17743,32 +14177,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest10() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() + public void getShelfTest3() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + .setTheme(theme) + .setInternalTheme(internalTheme) .build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ShelfName parent = ShelfName.of("[SHELF_ID]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); + Shelf actualResponse = + client.getShelf(name, message, stringBuilder); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ShelfName.parse(actualRequest.getParent())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17777,15 +14211,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest10() throws Exception { + public void getShelfExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ShelfName parent = ShelfName.of("[SHELF_ID]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - client.getBookFromArchive(name, parent); + client.getShelf(name, message, stringBuilder); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -17794,32 +14229,19 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveTest11() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); + public void deleteShelfTest() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteShelf(name); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, BillingAccountName.parse(actualRequest.getParent())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17828,15 +14250,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest11() throws Exception { + public void deleteShelfExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - client.getBookFromArchive(name, parent); + client.deleteShelf(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -17845,36 +14266,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAnywhereTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + public void mergeShelvesTest() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + .setTheme(theme) + .setInternalTheme(internalTheme) .build(); mockLibraryService.addResponse(expectedResponse); - FolderName folder = FolderName.of("[FOLDER]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - BookFromAnywhere actualResponse = - client.getBookFromAnywhere(folder, name, place, altBookName); + Shelf actualResponse = + client.mergeShelves(name, otherShelfName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); + MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); - Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); - Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17883,17 +14298,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAnywhereExceptionTest() throws Exception { + public void mergeShelvesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - FolderName folder = FolderName.of("[FOLDER]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.getBookFromAnywhere(folder, name, place, altBookName); + client.mergeShelves(name, otherShelfName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -17902,12 +14315,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAnywhereTest2() { + public void createBookTest() { BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + Book expectedResponse = Book.newBuilder() .setName(name2.toString()) .setAuthor(author) .setTitle(title) @@ -17915,23 +14328,19 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - FolderName folder = FolderName.of("[FOLDER]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); - BookFromAnywhere actualResponse = - client.getBookFromAnywhere(folder, name, place, altBookName); + Book actualResponse = + client.createBook(name, book); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); + CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); - Assert.assertEquals(folder, actualRequest.getFolder()); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(place, actualRequest.getPlace()); - Assert.assertEquals(altBookName, actualRequest.getAltBookName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17940,17 +14349,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAnywhereExceptionTest2() throws Exception { + public void createBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - FolderName folder = FolderName.of("[FOLDER]"); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); - client.getBookFromAnywhere(folder, name, place, altBookName); + client.createBook(name, book); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -17959,30 +14366,36 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void publishSeriesTest() { + String bookNamesElement = "bookNamesElement1491670575"; + List bookNames = Arrays.asList(bookNamesElement); + PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() + .addAllBookNames(bookNames) .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + String publisher = "publisher1447404028"; - BookFromAnywhere actualResponse = - client.getBookFromAbsolutelyAnywhere(name); + PublishSeriesResponse actualResponse = + client.publishSeries(shelf, books, edition, seriesUuid, publisher); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); + PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertEquals(books, actualRequest.getBooksList()); + Assert.assertEquals(edition, actualRequest.getEdition()); + Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); + Assert.assertEquals(publisher, PublisherNames.parse(actualRequest.getPublisher())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -17991,14 +14404,21 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { + public void publishSeriesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + String publisher = "publisher1447404028"; - client.getBookFromAbsolutelyAnywhere(name); + client.publishSeries(shelf, books, edition, seriesUuid, publisher); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18007,12 +14427,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereTest2() { + public void getBookTest() { BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + Book expectedResponse = Book.newBuilder() .setName(name2.toString()) .setAuthor(author) .setTitle(title) @@ -18022,15 +14442,15 @@ public class LibraryClientTest { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookFromAnywhere actualResponse = - client.getBookFromAbsolutelyAnywhere(name); + Book actualResponse = + client.getBook(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18039,14 +14459,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereExceptionTest2() throws Exception { + public void getBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.getBookFromAbsolutelyAnywhere(name); + client.getBook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18055,25 +14475,31 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookIndexTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void listBooksTest() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - String indexName = "default index"; + ArchiveName name = ArchiveName.of("[ARCHIVE]"); + String filter = "book-filter-string"; + + ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); - client.updateBookIndex(name, indexMap, indexName); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); - Assert.assertEquals(indexName, actualRequest.getIndexName()); + Assert.assertEquals(name, ArchiveName.parse(actualRequest.getName())); + Assert.assertEquals(filter, actualRequest.getFilter()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18082,18 +14508,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookIndexExceptionTest() throws Exception { + public void listBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - String indexName = "default index"; + ArchiveName name = ArchiveName.of("[ARCHIVE]"); + String filter = "book-filter-string"; - client.updateBookIndex(name, indexMap, indexName); + client.listBooks(name, filter); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18102,25 +14525,31 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookIndexTest2() { - Empty expectedResponse = Empty.newBuilder().build(); + public void listBooksTest2() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - String indexName = "default index"; + ShelfName name = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; + + ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); - client.updateBookIndex(name, indexMap, indexName); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); - Assert.assertEquals(indexName, actualRequest.getIndexName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(filter, actualRequest.getFilter()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18129,18 +14558,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookIndexExceptionTest2() throws Exception { + public void listBooksExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - String indexName = "default index"; + ShelfName name = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; - client.updateBookIndex(name, indexMap, indexName); + client.listBooks(name, filter); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18149,202 +14575,69 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void streamShelvesTest() throws Exception { - Shelf shelvesElement = Shelf.newBuilder().build(); - List shelves = Arrays.asList(shelvesElement); - StreamShelvesResponse expectedResponse = StreamShelvesResponse.newBuilder() - .addAllShelves(shelves) - .build(); - mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - StreamShelvesRequest request = StreamShelvesRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamShelvesCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - @SuppressWarnings("all") - public void streamShelvesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - ShelfName name = ShelfName.of("[SHELF_ID]"); - StreamShelvesRequest request = StreamShelvesRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamShelvesCallable(); - callable.serverStreamingCall(request, responseObserver); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void streamBooksTest() throws Exception { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void listBooksTest3() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) .build(); mockLibraryService.addResponse(expectedResponse); - String name = "name3373707"; - StreamBooksRequest request = StreamBooksRequest.newBuilder() - .setName(name) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBooksCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - @Test - @SuppressWarnings("all") - public void streamBooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - String name = "name3373707"; - StreamBooksRequest request = StreamBooksRequest.newBuilder() - .setName(name) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBooksCallable(); - callable.serverStreamingCall(request, responseObserver); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void discussBookTest() throws Exception { - String userName = "userName339340927"; - ByteString comment = ByteString.copyFromUtf8("95"); - Comment expectedResponse = Comment.newBuilder() - .setUserName(userName) - .setComment(comment) - .build(); - mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - DiscussBookRequest request = DiscussBookRequest.newBuilder() - .setName(name.toString()) - .build(); + ProjectName name = ProjectName.of("[PROJECT]"); + String filter = "book-filter-string"; - MockStreamObserver responseObserver = new MockStreamObserver<>(); + ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); - BidiStreamingCallable callable = - client.discussBookCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - requestObserver.onNext(request); - requestObserver.onCompleted(); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); + Assert.assertEquals(name, ProjectName.parse(actualRequest.getName())); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } @Test @SuppressWarnings("all") - public void discussBookExceptionTest() throws Exception { + public void listBooksExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - DiscussBookRequest request = DiscussBookRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.discussBookCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + ProjectName name = ProjectName.of("[PROJECT]"); + String filter = "book-filter-string"; + + client.listBooks(name, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception } } @Test @SuppressWarnings("all") - public void findRelatedBooksTest() { - String nextPageToken = ""; - BookName namesElement2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List names2 = Arrays.asList(namesElement2); - FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllNames(BookName.toStringList(names2)) - .build(); + public void deleteBookTest() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); - - FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(names, formattedShelves); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); + client.deleteBook(name); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); + DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); - Assert.assertEquals(names, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18353,16 +14646,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void findRelatedBooksExceptionTest() throws Exception { + public void deleteBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.findRelatedBooks(names, formattedShelves); + client.deleteBook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18371,36 +14662,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void findRelatedBooksTest2() { - String nextPageToken = ""; - BookName namesElement2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List names2 = Arrays.asList(namesElement2); - FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllNames(BookName.toStringList(names2)) + public void updateBookTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); - - FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(names, formattedShelves); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Book book = Book.newBuilder().build(); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); + Book actualResponse = + client.updateBook(name, book); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(names, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18409,16 +14696,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void findRelatedBooksExceptionTest2() throws Exception { + public void updateBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + Book book = Book.newBuilder().build(); - client.findRelatedBooks(names, formattedShelves); + client.updateBook(name, book); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18427,7 +14713,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigBookTest() throws Exception { + public void updateBookTest2() { BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -18438,25 +14724,27 @@ public class LibraryClientTest { .setTitle(title) .setRead(read) .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigBookTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); + mockLibraryService.addResponse(expectedResponse); BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); Book actualResponse = - client.getBigBookAsync(name).get(); + client.updateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18465,26 +14753,27 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigBookExceptionTest() throws Exception { + public void updateBookExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); - client.getBigBookAsync(name).get(); + client.updateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } - @Test @SuppressWarnings("all") - public void getBigBookTest2() throws Exception { + public void moveBookTest() { BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -18495,25 +14784,21 @@ public class LibraryClientTest { .setTitle(title) .setRead(read) .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigBookTest2") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); + mockLibraryService.addResponse(expectedResponse); BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); Book actualResponse = - client.getBigBookAsync(name).get(); + client.moveBook(name, otherShelfName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18522,46 +14807,50 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigBookExceptionTest2() throws Exception { + public void moveBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.getBigBookAsync(name).get(); + client.moveBook(name, otherShelfName); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } - @Test @SuppressWarnings("all") - public void getBigNothingTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigNothingTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); + public void listStringsTest() { + String nextPageToken = ""; + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); + List strings = Arrays.asList(stringsElement); + ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllStrings(UntypedResourceName.toStringList(strings)) + .build(); + mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); - Empty actualResponse = - client.getBigNothingAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + ListStringsPagedResponse pagedListResponse = client.listStrings(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), + resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18570,46 +14859,45 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigNothingExceptionTest() throws Exception { + public void listStringsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); - client.getBigNothingAsync(name).get(); + client.listStrings(name); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } - @Test @SuppressWarnings("all") - public void getBigNothingTest2() throws Exception { + public void addCommentsTest() { Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigNothingTest2") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); + mockLibraryService.addResponse(expectedResponse); BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); - Empty actualResponse = - client.getBigNothingAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.addComments(name, comments); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(comments, actualRequest.getCommentsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18618,282 +14906,57 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBigNothingExceptionTest2() throws Exception { + public void addCommentsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); - client.getBigNothingAsync(name).get(); + client.addComments(name, comments); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } - @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest() { - TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); + public void getBookFromArchiveTest() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); mockLibraryService.addResponse(expectedResponse); - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedBytesValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - boolean optionalSingularBool = false; - List repeatedListValueValue = new ArrayList<>(); - int optionalSingularFixed32 = 1648847958; - List optionalRepeatedMessage = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - Any anyValue = Any.newBuilder().build(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - List optionalRepeatedBool = new ArrayList<>(); - String optionalSingularString = "optionalSingularString1852995162"; - long optionalSingularInt64 = 1196565628L; - List repeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedValueValue = new ArrayList<>(); - Duration requiredDurationValue = Duration.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedFieldMaskValue = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - boolean requiredSingularBool = true; - float requiredSingularFloat = -7514705.0F; - List requiredRepeatedBytes = new ArrayList<>(); - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - Any requiredAnyValue = Any.newBuilder().build(); - List repeatedInt32Value = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - long requiredSingularFixed64 = 720656810; - String requiredSingularString = "requiredSingularString-1949894503"; - Map optionalMap = new HashMap<>(); - List requiredRepeatedBool = new ArrayList<>(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - List requiredRepeatedStructValue = new ArrayList<>(); - List repeatedAnyValue = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedMessage = new ArrayList<>(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - List repeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - float optionalSingularFloat = -1.19939918E8F; - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - Int32Value int32Value = Int32Value.newBuilder().build(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Value valueValue = Value.newBuilder().build(); - int optionalSingularInt32 = 1196565723; - BoolValue boolValue = BoolValue.newBuilder().build(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - double optionalSingularDouble = 1.41902287E8; - List requiredRepeatedString = new ArrayList<>(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - List optionalRepeatedFloat = new ArrayList<>(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - List requiredRepeatedEnum = new ArrayList<>(); - Value requiredValueValue = Value.newBuilder().build(); - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - StringValue stringValue = StringValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - double requiredSingularDouble = 1.9111005E8; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - long optionalSingularFixed64 = 1648847863; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - List requiredRepeatedBoolValue = new ArrayList<>(); - int requiredSingularInt32 = 72313594; - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - int requiredSingularFixed32 = 720656715; - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - List repeatedDurationValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedValueValue = new ArrayList<>(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - List repeatedStringValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - long requiredSingularInt64 = 72313499L; - List optionalRepeatedEnum = new ArrayList<>(); - com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - List requiredRepeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - Int64Value int64Value = Int64Value.newBuilder().build(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedInt32 = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - FloatValue floatValue = FloatValue.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - Duration durationValue = Duration.newBuilder().build(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); - TestOptionalRequiredFlatteningParamsResponse actualResponse = - client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); - Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); - Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); - Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); - Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); - Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); - Assert.assertEquals(anyValue, actualRequest.getAnyValue()); - Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); - Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); - Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); - Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); - Assert.assertEquals(structValue, actualRequest.getStructValue()); - Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); - Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); - Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); - Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); - Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); - Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); - Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); - Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); - Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); - Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); - Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); - Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); - Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); - Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); - Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); - Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); - Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); - Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); - Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); - Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); - Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); - Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); - Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); - Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); - Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); - Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); - Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); - Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); - Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); - Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); - Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); - Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); - Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); - Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); - Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); - Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); - Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); - Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); - Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); - Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); - Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); - Assert.assertEquals(int32Value, actualRequest.getInt32Value()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); - Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); - Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); - Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(valueValue, actualRequest.getValueValue()); - Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); - Assert.assertEquals(boolValue, actualRequest.getBoolValue()); - Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); - Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); - Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); - Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); - Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); - Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); - Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); - Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); - Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); - Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); - Assert.assertEquals(stringValue, actualRequest.getStringValue()); - Assert.assertEquals(timeValue, actualRequest.getTimeValue()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); - Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); - Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); - Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); - Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); - Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); - Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); - Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); - Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); - Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); - Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); - Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); - Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); - Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); - Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); - Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); - Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); - Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); - Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); - Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); - Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); - Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); - Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); - Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); - Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); - Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); - Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); - Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); - Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); - Assert.assertEquals(int64Value, actualRequest.getInt64Value()); - Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); - Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); - Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); - Assert.assertEquals(floatValue, actualRequest.getFloatValue()); - Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); - Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); - Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); - Assert.assertEquals(durationValue, actualRequest.getDurationValue()); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18902,135 +14965,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { + public void getBookFromArchiveExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedBytesValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - boolean optionalSingularBool = false; - List repeatedListValueValue = new ArrayList<>(); - int optionalSingularFixed32 = 1648847958; - List optionalRepeatedMessage = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - Any anyValue = Any.newBuilder().build(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - List optionalRepeatedBool = new ArrayList<>(); - String optionalSingularString = "optionalSingularString1852995162"; - long optionalSingularInt64 = 1196565628L; - List repeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedValueValue = new ArrayList<>(); - Duration requiredDurationValue = Duration.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedFieldMaskValue = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - boolean requiredSingularBool = true; - float requiredSingularFloat = -7514705.0F; - List requiredRepeatedBytes = new ArrayList<>(); - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - Any requiredAnyValue = Any.newBuilder().build(); - List repeatedInt32Value = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - long requiredSingularFixed64 = 720656810; - String requiredSingularString = "requiredSingularString-1949894503"; - Map optionalMap = new HashMap<>(); - List requiredRepeatedBool = new ArrayList<>(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - List requiredRepeatedStructValue = new ArrayList<>(); - List repeatedAnyValue = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedMessage = new ArrayList<>(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - List repeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - float optionalSingularFloat = -1.19939918E8F; - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - Int32Value int32Value = Int32Value.newBuilder().build(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Value valueValue = Value.newBuilder().build(); - int optionalSingularInt32 = 1196565723; - BoolValue boolValue = BoolValue.newBuilder().build(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - double optionalSingularDouble = 1.41902287E8; - List requiredRepeatedString = new ArrayList<>(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - List optionalRepeatedFloat = new ArrayList<>(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - List requiredRepeatedEnum = new ArrayList<>(); - Value requiredValueValue = Value.newBuilder().build(); - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - StringValue stringValue = StringValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - double requiredSingularDouble = 1.9111005E8; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - long optionalSingularFixed64 = 1648847863; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - List requiredRepeatedBoolValue = new ArrayList<>(); - int requiredSingularInt32 = 72313594; - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - int requiredSingularFixed32 = 720656715; - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - List repeatedDurationValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedValueValue = new ArrayList<>(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - List repeatedStringValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - long requiredSingularInt64 = 72313499L; - List optionalRepeatedEnum = new ArrayList<>(); - com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - List requiredRepeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - Int64Value int64Value = Int64Value.newBuilder().build(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedInt32 = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - FloatValue floatValue = FloatValue.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - Duration durationValue = Duration.newBuilder().build(); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); - client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); + client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19039,263 +14982,130 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest2() { - TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); + public void getBookFromAnywhereTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); mockLibraryService.addResponse(expectedResponse); - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedBytesValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - boolean optionalSingularBool = false; - List repeatedListValueValue = new ArrayList<>(); - int optionalSingularFixed32 = 1648847958; - List optionalRepeatedMessage = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - Any anyValue = Any.newBuilder().build(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - List optionalRepeatedBool = new ArrayList<>(); - String optionalSingularString = "optionalSingularString1852995162"; - long optionalSingularInt64 = 1196565628L; - List repeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedValueValue = new ArrayList<>(); - Duration requiredDurationValue = Duration.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedFieldMaskValue = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - boolean requiredSingularBool = true; - float requiredSingularFloat = -7514705.0F; - List requiredRepeatedBytes = new ArrayList<>(); - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - Any requiredAnyValue = Any.newBuilder().build(); - List repeatedInt32Value = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - long requiredSingularFixed64 = 720656810; - String requiredSingularString = "requiredSingularString-1949894503"; - Map optionalMap = new HashMap<>(); - List requiredRepeatedBool = new ArrayList<>(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - List requiredRepeatedStructValue = new ArrayList<>(); - List repeatedAnyValue = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedMessage = new ArrayList<>(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - List repeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - float optionalSingularFloat = -1.19939918E8F; - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - Int32Value int32Value = Int32Value.newBuilder().build(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Value valueValue = Value.newBuilder().build(); - int optionalSingularInt32 = 1196565723; - BoolValue boolValue = BoolValue.newBuilder().build(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - double optionalSingularDouble = 1.41902287E8; - List requiredRepeatedString = new ArrayList<>(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - List optionalRepeatedFloat = new ArrayList<>(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - List requiredRepeatedEnum = new ArrayList<>(); - Value requiredValueValue = Value.newBuilder().build(); - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - StringValue stringValue = StringValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - double requiredSingularDouble = 1.9111005E8; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - long optionalSingularFixed64 = 1648847863; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - List requiredRepeatedBoolValue = new ArrayList<>(); - int requiredSingularInt32 = 72313594; - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - int requiredSingularFixed32 = 720656715; - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - List repeatedDurationValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedValueValue = new ArrayList<>(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - List repeatedStringValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - long requiredSingularInt64 = 72313499L; - List optionalRepeatedEnum = new ArrayList<>(); - com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - List requiredRepeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - Int64Value int64Value = Int64Value.newBuilder().build(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedInt32 = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - FloatValue floatValue = FloatValue.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - Duration durationValue = Duration.newBuilder().build(); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); - TestOptionalRequiredFlatteningParamsResponse actualResponse = - client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); + BookFromAnywhere actualResponse = + client.getBookFromAnywhere(name, altBookName, place, folder); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); + GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); - Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); - Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); - Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); - Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); - Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); - Assert.assertEquals(anyValue, actualRequest.getAnyValue()); - Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); - Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); - Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); - Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); - Assert.assertEquals(structValue, actualRequest.getStructValue()); - Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); - Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); - Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); - Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); - Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); - Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); - Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); - Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); - Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); - Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); - Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); - Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); - Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); - Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); - Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); - Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); - Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); - Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); - Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); - Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); - Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); - Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); - Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); - Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); - Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); - Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); - Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); - Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); - Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); - Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); - Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); - Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); - Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); - Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); - Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); - Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); - Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); - Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); - Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); - Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); - Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); - Assert.assertEquals(int32Value, actualRequest.getInt32Value()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); - Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); - Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); - Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(valueValue, actualRequest.getValueValue()); - Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); - Assert.assertEquals(boolValue, actualRequest.getBoolValue()); - Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); - Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); - Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); - Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); - Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); - Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); - Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); - Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); - Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); - Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); - Assert.assertEquals(stringValue, actualRequest.getStringValue()); - Assert.assertEquals(timeValue, actualRequest.getTimeValue()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); - Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); - Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); - Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); - Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); - Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); - Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); - Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); - Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); - Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); - Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); - Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); - Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); - Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); - Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); - Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); - Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); - Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); - Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); - Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); - Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); - Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); - Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); - Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); - Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); - Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); - Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); - Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); - Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); - Assert.assertEquals(int64Value, actualRequest.getInt64Value()); - Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); - Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); - Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); - Assert.assertEquals(floatValue, actualRequest.getFloatValue()); - Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); - Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); - Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); - Assert.assertEquals(durationValue, actualRequest.getDurationValue()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); + Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); + Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookFromAnywhereExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); + + client.getBookFromAnywhere(name, altBookName, place, folder); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBookFromAbsolutelyAnywhereTest() { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + BookFromAnywhere actualResponse = + client.getBookFromAbsolutelyAnywhere(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBookFromAbsolutelyAnywhere(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookIndexTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String indexName = "default index"; + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + + client.updateBookIndex(name, indexName, indexMap); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(indexName, actualRequest.getIndexName()); + Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19304,170 +15114,222 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { + public void updateBookIndexExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String indexName = "default index"; + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + + client.updateBookIndex(name, indexName, indexMap); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void streamShelvesTest() throws Exception { + Shelf shelvesElement = Shelf.newBuilder().build(); + List shelves = Arrays.asList(shelvesElement); + StreamShelvesResponse expectedResponse = StreamShelvesResponse.newBuilder() + .addAllShelves(shelves) + .build(); + mockLibraryService.addResponse(expectedResponse); + ShelfName name = ShelfName.of("[SHELF_ID]"); + StreamShelvesRequest request = StreamShelvesRequest.newBuilder() + .setName(name.toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamShelvesCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void streamShelvesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); + ShelfName name = ShelfName.of("[SHELF_ID]"); + StreamShelvesRequest request = StreamShelvesRequest.newBuilder() + .setName(name.toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamShelvesCallable(); + callable.serverStreamingCall(request, responseObserver); try { - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedBytesValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - boolean optionalSingularBool = false; - List repeatedListValueValue = new ArrayList<>(); - int optionalSingularFixed32 = 1648847958; - List optionalRepeatedMessage = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - Any anyValue = Any.newBuilder().build(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - List optionalRepeatedBool = new ArrayList<>(); - String optionalSingularString = "optionalSingularString1852995162"; - long optionalSingularInt64 = 1196565628L; - List repeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedValueValue = new ArrayList<>(); - Duration requiredDurationValue = Duration.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - com.google.protobuf.FieldMask fieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedFieldMaskValue = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - boolean requiredSingularBool = true; - float requiredSingularFloat = -7514705.0F; - List requiredRepeatedBytes = new ArrayList<>(); - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - Any requiredAnyValue = Any.newBuilder().build(); - List repeatedInt32Value = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - long requiredSingularFixed64 = 720656810; - String requiredSingularString = "requiredSingularString-1949894503"; - Map optionalMap = new HashMap<>(); - List requiredRepeatedBool = new ArrayList<>(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - List requiredRepeatedStructValue = new ArrayList<>(); - List repeatedAnyValue = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List requiredRepeatedMessage = new ArrayList<>(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - List repeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - float optionalSingularFloat = -1.19939918E8F; - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - Int32Value int32Value = Int32Value.newBuilder().build(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Value valueValue = Value.newBuilder().build(); - int optionalSingularInt32 = 1196565723; - BoolValue boolValue = BoolValue.newBuilder().build(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - double optionalSingularDouble = 1.41902287E8; - List requiredRepeatedString = new ArrayList<>(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - List optionalRepeatedFloat = new ArrayList<>(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - List requiredRepeatedEnum = new ArrayList<>(); - Value requiredValueValue = Value.newBuilder().build(); - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - StringValue stringValue = StringValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - double requiredSingularDouble = 1.9111005E8; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - long optionalSingularFixed64 = 1648847863; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - List requiredRepeatedBoolValue = new ArrayList<>(); - int requiredSingularInt32 = 72313594; - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - int requiredSingularFixed32 = 720656715; - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - List repeatedDurationValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedValueValue = new ArrayList<>(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - List repeatedStringValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - long requiredSingularInt64 = 72313499L; - List optionalRepeatedEnum = new ArrayList<>(); - com.google.protobuf.FieldMask requiredFieldMaskValue = com.google.protobuf.FieldMask.newBuilder().build(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - List requiredRepeatedFloatValue = new ArrayList<>(); - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - Int64Value int64Value = Int64Value.newBuilder().build(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedInt32 = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - FloatValue floatValue = FloatValue.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - Duration durationValue = Duration.newBuilder().build(); + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } - client.testOptionalRequiredFlatteningParams(requiredSingularResourceName, requiredRepeatedBytesValue, requiredRepeatedDurationValue, optionalSingularBool, repeatedListValueValue, optionalSingularFixed32, optionalRepeatedMessage, repeatedUint32Value, anyValue, optionalRepeatedInt64, optionalRepeatedFixed32, requiredDoubleValue, listValueValue, structValue, requiredInt64Value, requiredSingularResourceNameCommon, optionalRepeatedBool, optionalSingularString, optionalSingularInt64, repeatedFloatValue, optionalSingularMessage, requiredSingularResourceNameOneof, requiredRepeatedValueValue, requiredDurationValue, requiredRepeatedAnyValue, requiredBytesValue, requiredRepeatedInt64, optionalRepeatedDouble, fieldMaskValue, repeatedFieldMaskValue, requiredMap, requiredUint64Value, requiredSingularBool, requiredSingularFloat, requiredRepeatedBytes, optionalSingularBytes, requiredSingularMessage, requiredAnyValue, repeatedInt32Value, requiredRepeatedFixed64, repeatedUint64Value, requiredSingularFixed64, requiredSingularString, optionalMap, requiredRepeatedBool, requiredBoolValue, requiredRepeatedStructValue, repeatedAnyValue, optionalRepeatedString, optionalSingularResourceNameOneof, requiredRepeatedMessage, doubleValue, repeatedDoubleValue, requiredRepeatedUint32Value, optionalSingularFloat, optionalRepeatedBytes, optionalRepeatedFixed64, requiredRepeatedInt32Value, optionalSingularResourceNameCommon, int32Value, formattedRequiredRepeatedResourceName, requiredRepeatedFloat, requiredRepeatedStringValue, repeatedInt64Value, requiredFloatValue, optionalSingularResourceName, valueValue, optionalSingularInt32, boolValue, requiredRepeatedFieldMaskValue, optionalSingularDouble, requiredRepeatedString, requiredInt32Value, optionalRepeatedFloat, uint64Value, requiredRepeatedEnum, requiredValueValue, requiredRepeatedInt32, requiredRepeatedResourceNameCommon, stringValue, timeValue, formattedOptionalRepeatedResourceNameOneof, requiredSingularDouble, requiredSingularBytes, optionalSingularFixed64, requiredSingularEnum, requiredRepeatedBoolValue, requiredSingularInt32, formattedOptionalRepeatedResourceName, requiredTimeValue, requiredSingularFixed32, uint32Value, requiredStructValue, repeatedDurationValue, requiredRepeatedDoubleValue, bytesValue, repeatedValueValue, requiredStringValue, repeatedStringValue, requiredRepeatedTimeValue, optionalRepeatedResourceNameCommon, formattedRequiredRepeatedResourceNameOneof, requiredSingularInt64, optionalRepeatedEnum, requiredFieldMaskValue, repeatedTimeValue, repeatedStructValue, requiredRepeatedListValueValue, repeatedBytesValue, requiredRepeatedInt64Value, requiredListValueValue, requiredRepeatedFloatValue, optionalSingularEnum, int64Value, requiredRepeatedFixed32, optionalRepeatedInt32, repeatedBoolValue, floatValue, requiredUint32Value, requiredRepeatedDouble, requiredRepeatedUint64Value, durationValue); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + @Test + @SuppressWarnings("all") + public void streamBooksTest() throws Exception { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + String name = "name3373707"; + StreamBooksRequest request = StreamBooksRequest.newBuilder() + .setName(name) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBooksCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void streamBooksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + String name = "name3373707"; + StreamBooksRequest request = StreamBooksRequest.newBuilder() + .setName(name) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBooksCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void discussBookTest() throws Exception { + String userName = "userName339340927"; + ByteString comment = ByteString.copyFromUtf8("95"); + Comment expectedResponse = Comment.newBuilder() + .setUserName(userName) + .setComment(comment) + .build(); + mockLibraryService.addResponse(expectedResponse); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + DiscussBookRequest request = DiscussBookRequest.newBuilder() + .setName(name.toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.discussBookCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void discussBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + DiscussBookRequest request = DiscussBookRequest.newBuilder() + .setName(name.toString()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.discussBookCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void listPublishersTest() { + public void findRelatedBooksTest() { String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() + BookName namesElement2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List names2 = Arrays.asList(namesElement2); + FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + .addAllNames(BookName.toStringList(names2)) .build(); mockLibraryService.addResponse(expectedResponse); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); + String namesElement = "namesElement-249113339"; + List names = Arrays.asList(namesElement); + List formattedShelves = new ArrayList<>(); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(additionalDestinations, parent, destination); + FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(formattedNames, formattedShelves); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), + resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedNames, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19476,16 +15338,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest() throws Exception { + public void findRelatedBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); + String namesElement = "namesElement-249113339"; + List names = Arrays.asList(namesElement); + List formattedShelves = new ArrayList<>(); - client.listPublishers(additionalDestinations, parent, destination); + client.findRelatedBooks(formattedNames, formattedShelves); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19494,33 +15356,368 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest2() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + public void getBigBookTest() throws Exception { + BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); - mockLibraryService.addResponse(expectedResponse); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigBookTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); + + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + Book actualResponse = + client.getBigBookAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBigBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBigBookAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + + @Test + @SuppressWarnings("all") + public void getBigNothingTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigNothingTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); + + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + Empty actualResponse = + client.getBigNothingAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBigNothingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + + client.getBigNothingAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); + @Test + @SuppressWarnings("all") + public void testOptionalRequiredFlatteningParamsTest() { + TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(additionalDestinations, parent, destination); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0F; + double requiredSingularDouble = 1.9111005E8; + boolean requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedInt64 = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedBool = new ArrayList<>(); + List requiredRepeatedEnum = new ArrayList<>(); + List requiredRepeatedString = new ArrayList<>(); + List requiredRepeatedBytes = new ArrayList<>(); + List requiredRepeatedMessage = new ArrayList<>(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + Any requiredAnyValue = Any.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + Value requiredValueValue = Value.newBuilder().build(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + Duration requiredDurationValue = Duration.newBuilder().build(); + FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + List requiredRepeatedStructValue = new ArrayList<>(); + List requiredRepeatedValueValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + List requiredRepeatedFloatValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List requiredRepeatedBoolValue = new ArrayList<>(); + List requiredRepeatedBytesValue = new ArrayList<>(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8F; + double optionalSingularDouble = 1.41902287E8; + boolean optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + List optionalRepeatedInt32 = new ArrayList<>(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFloat = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + List optionalRepeatedBool = new ArrayList<>(); + List optionalRepeatedEnum = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedMessage = new ArrayList<>(); + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + Map optionalMap = new HashMap<>(); + Any anyValue = Any.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Value valueValue = Value.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + Duration durationValue = Duration.newBuilder().build(); + FieldMask fieldMaskValue = FieldMask.newBuilder().build(); + Int32Value int32Value = Int32Value.newBuilder().build(); + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Int64Value int64Value = Int64Value.newBuilder().build(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + FloatValue floatValue = FloatValue.newBuilder().build(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + StringValue stringValue = StringValue.newBuilder().build(); + BoolValue boolValue = BoolValue.newBuilder().build(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedAnyValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List repeatedValueValue = new ArrayList<>(); + List repeatedListValueValue = new ArrayList<>(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedDurationValue = new ArrayList<>(); + List repeatedFieldMaskValue = new ArrayList<>(); + List repeatedInt32Value = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + List repeatedFloatValue = new ArrayList<>(); + List repeatedDoubleValue = new ArrayList<>(); + List repeatedStringValue = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + TestOptionalRequiredFlatteningParamsResponse actualResponse = + client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); + Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); + Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); + Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); + Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); + Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); + Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); + Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); + Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); + Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); + Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); + Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); + Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); + Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); + Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); + Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); + Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); + Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); + Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); + Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); + Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); + Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); + Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); + Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); + Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); + Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); + Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); + Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); + Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); + Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); + Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); + Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); + Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); + Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); + Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); + Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); + Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); + Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); + Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); + Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); + Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); + Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); + Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); + Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); + Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); + Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); + Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); + Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); + Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); + Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); + Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); + Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); + Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); + Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); + Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); + Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); + Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); + Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); + Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); + Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); + Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); + Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); + Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); + Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); + Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); + Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); + Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); + Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); + Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); + Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); + Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); + Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); + Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); + Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); + Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); + Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); + Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); + Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); + Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); + Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); + Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); + Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); + Assert.assertEquals(anyValue, actualRequest.getAnyValue()); + Assert.assertEquals(structValue, actualRequest.getStructValue()); + Assert.assertEquals(valueValue, actualRequest.getValueValue()); + Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); + Assert.assertEquals(timeValue, actualRequest.getTimeValue()); + Assert.assertEquals(durationValue, actualRequest.getDurationValue()); + Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); + Assert.assertEquals(int32Value, actualRequest.getInt32Value()); + Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); + Assert.assertEquals(int64Value, actualRequest.getInt64Value()); + Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); + Assert.assertEquals(floatValue, actualRequest.getFloatValue()); + Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); + Assert.assertEquals(stringValue, actualRequest.getStringValue()); + Assert.assertEquals(boolValue, actualRequest.getBoolValue()); + Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); + Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); + Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); + Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); + Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); + Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); + Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); + Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); + Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); + Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); + Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); + Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); + Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); + Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); + Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); + Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); + Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19529,16 +15726,135 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest2() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - LocationName destination = LocationName.of("[PROJECT]", "[LOCATION]"); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0F; + double requiredSingularDouble = 1.9111005E8; + boolean requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedInt64 = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedBool = new ArrayList<>(); + List requiredRepeatedEnum = new ArrayList<>(); + List requiredRepeatedString = new ArrayList<>(); + List requiredRepeatedBytes = new ArrayList<>(); + List requiredRepeatedMessage = new ArrayList<>(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + Any requiredAnyValue = Any.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + Value requiredValueValue = Value.newBuilder().build(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + Duration requiredDurationValue = Duration.newBuilder().build(); + FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + List requiredRepeatedStructValue = new ArrayList<>(); + List requiredRepeatedValueValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + List requiredRepeatedFloatValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List requiredRepeatedBoolValue = new ArrayList<>(); + List requiredRepeatedBytesValue = new ArrayList<>(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8F; + double optionalSingularDouble = 1.41902287E8; + boolean optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + List optionalRepeatedInt32 = new ArrayList<>(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFloat = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + List optionalRepeatedBool = new ArrayList<>(); + List optionalRepeatedEnum = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedMessage = new ArrayList<>(); + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + Map optionalMap = new HashMap<>(); + Any anyValue = Any.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Value valueValue = Value.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + Duration durationValue = Duration.newBuilder().build(); + FieldMask fieldMaskValue = FieldMask.newBuilder().build(); + Int32Value int32Value = Int32Value.newBuilder().build(); + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Int64Value int64Value = Int64Value.newBuilder().build(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + FloatValue floatValue = FloatValue.newBuilder().build(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + StringValue stringValue = StringValue.newBuilder().build(); + BoolValue boolValue = BoolValue.newBuilder().build(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedAnyValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List repeatedValueValue = new ArrayList<>(); + List repeatedListValueValue = new ArrayList<>(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedDurationValue = new ArrayList<>(); + List repeatedFieldMaskValue = new ArrayList<>(); + List repeatedInt32Value = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + List repeatedFloatValue = new ArrayList<>(); + List repeatedDoubleValue = new ArrayList<>(); + List repeatedStringValue = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); - client.listPublishers(additionalDestinations, parent, destination); + client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19547,33 +15863,263 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest3() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) - .build(); + public void testOptionalRequiredFlatteningParamsTest2() { + TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - String destination = "destination-1429847026"; - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0F; + double requiredSingularDouble = 1.9111005E8; + boolean requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedInt64 = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedBool = new ArrayList<>(); + List requiredRepeatedEnum = new ArrayList<>(); + List requiredRepeatedString = new ArrayList<>(); + List requiredRepeatedBytes = new ArrayList<>(); + List requiredRepeatedMessage = new ArrayList<>(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + Any requiredAnyValue = Any.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + Value requiredValueValue = Value.newBuilder().build(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + Duration requiredDurationValue = Duration.newBuilder().build(); + FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + List requiredRepeatedStructValue = new ArrayList<>(); + List requiredRepeatedValueValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + List requiredRepeatedFloatValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List requiredRepeatedBoolValue = new ArrayList<>(); + List requiredRepeatedBytesValue = new ArrayList<>(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8F; + double optionalSingularDouble = 1.41902287E8; + boolean optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + List optionalRepeatedInt32 = new ArrayList<>(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFloat = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + List optionalRepeatedBool = new ArrayList<>(); + List optionalRepeatedEnum = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedMessage = new ArrayList<>(); + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + Map optionalMap = new HashMap<>(); + Any anyValue = Any.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Value valueValue = Value.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + Duration durationValue = Duration.newBuilder().build(); + FieldMask fieldMaskValue = FieldMask.newBuilder().build(); + Int32Value int32Value = Int32Value.newBuilder().build(); + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Int64Value int64Value = Int64Value.newBuilder().build(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + FloatValue floatValue = FloatValue.newBuilder().build(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + StringValue stringValue = StringValue.newBuilder().build(); + BoolValue boolValue = BoolValue.newBuilder().build(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedAnyValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List repeatedValueValue = new ArrayList<>(); + List repeatedListValueValue = new ArrayList<>(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedDurationValue = new ArrayList<>(); + List repeatedFieldMaskValue = new ArrayList<>(); + List repeatedInt32Value = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + List repeatedFloatValue = new ArrayList<>(); + List repeatedDoubleValue = new ArrayList<>(); + List repeatedStringValue = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + TestOptionalRequiredFlatteningParamsResponse actualResponse = + client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); + Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); + Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); + Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); + Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); + Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); + Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); + Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); + Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); + Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); + Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); + Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); + Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); + Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); + Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); + Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); + Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); + Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); + Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); + Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); + Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); + Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); + Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); + Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); + Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); + Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); + Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); + Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); + Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); + Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); + Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); + Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); + Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); + Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); + Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); + Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); + Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); + Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); + Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); + Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); + Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); + Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); + Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); + Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); + Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); + Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); + Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); + Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); + Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); + Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); + Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); + Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); + Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); + Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); + Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); + Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); + Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); + Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); + Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); + Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); + Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); + Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); + Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); + Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); + Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); + Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); + Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); + Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); + Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); + Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); + Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); + Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); + Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); + Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); + Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); + Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); + Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); + Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); + Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); + Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); + Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); + Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); + Assert.assertEquals(anyValue, actualRequest.getAnyValue()); + Assert.assertEquals(structValue, actualRequest.getStructValue()); + Assert.assertEquals(valueValue, actualRequest.getValueValue()); + Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); + Assert.assertEquals(timeValue, actualRequest.getTimeValue()); + Assert.assertEquals(durationValue, actualRequest.getDurationValue()); + Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); + Assert.assertEquals(int32Value, actualRequest.getInt32Value()); + Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); + Assert.assertEquals(int64Value, actualRequest.getInt64Value()); + Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); + Assert.assertEquals(floatValue, actualRequest.getFloatValue()); + Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); + Assert.assertEquals(stringValue, actualRequest.getStringValue()); + Assert.assertEquals(boolValue, actualRequest.getBoolValue()); + Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); + Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); + Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); + Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); + Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); + Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); + Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); + Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); + Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); + Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); + Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); + Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); + Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); + Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); + Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); + Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); + Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19582,16 +16128,135 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest3() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - String destination = "destination-1429847026"; - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0F; + double requiredSingularDouble = 1.9111005E8; + boolean requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedInt64 = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedBool = new ArrayList<>(); + List requiredRepeatedEnum = new ArrayList<>(); + List requiredRepeatedString = new ArrayList<>(); + List requiredRepeatedBytes = new ArrayList<>(); + List requiredRepeatedMessage = new ArrayList<>(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + Any requiredAnyValue = Any.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + Value requiredValueValue = Value.newBuilder().build(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + Duration requiredDurationValue = Duration.newBuilder().build(); + FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + List requiredRepeatedStructValue = new ArrayList<>(); + List requiredRepeatedValueValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + List requiredRepeatedFloatValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List requiredRepeatedBoolValue = new ArrayList<>(); + List requiredRepeatedBytesValue = new ArrayList<>(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8F; + double optionalSingularDouble = 1.41902287E8; + boolean optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + List optionalRepeatedInt32 = new ArrayList<>(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFloat = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + List optionalRepeatedBool = new ArrayList<>(); + List optionalRepeatedEnum = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedMessage = new ArrayList<>(); + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + Map optionalMap = new HashMap<>(); + Any anyValue = Any.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Value valueValue = Value.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + Duration durationValue = Duration.newBuilder().build(); + FieldMask fieldMaskValue = FieldMask.newBuilder().build(); + Int32Value int32Value = Int32Value.newBuilder().build(); + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Int64Value int64Value = Int64Value.newBuilder().build(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + FloatValue floatValue = FloatValue.newBuilder().build(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + StringValue stringValue = StringValue.newBuilder().build(); + BoolValue boolValue = BoolValue.newBuilder().build(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedAnyValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List repeatedValueValue = new ArrayList<>(); + List repeatedListValueValue = new ArrayList<>(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedDurationValue = new ArrayList<>(); + List repeatedFieldMaskValue = new ArrayList<>(); + List repeatedInt32Value = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + List repeatedFloatValue = new ArrayList<>(); + List repeatedDoubleValue = new ArrayList<>(); + List repeatedStringValue = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); - client.listPublishers(destination, additionalDestinations, parent); + client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19600,7 +16265,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest4() { + public void listPublishersTest() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -19610,11 +16275,11 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); + ProjectName parent = ProjectName.of("[PROJECT]"); ProjectName destination = ProjectName.of("[PROJECT]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + List formattedAdditionalDestinations = new ArrayList<>(); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); @@ -19624,9 +16289,9 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19635,69 +16300,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest4() throws Exception { + public void listPublishersExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { + ProjectName parent = ProjectName.of("[PROJECT]"); ProjectName destination = ProjectName.of("[PROJECT]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - client.listPublishers(destination, additionalDestinations, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listPublishersTest5() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) - .build(); - mockLibraryService.addResponse(expectedResponse); - - BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listPublishersExceptionTest5() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName destination = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + List formattedAdditionalDestinations = new ArrayList<>(); - client.listPublishers(destination, additionalDestinations, parent); + client.listPublishers(parent, destination, formattedAdditionalDestinations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19706,7 +16318,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest6() { + public void listPublishersTest2() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -19716,11 +16328,11 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - OrganizationName destination = OrganizationName.of("[ORGANIZATION]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedAdditionalDestinations = new ArrayList<>(); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); @@ -19730,9 +16342,9 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19741,16 +16353,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest6() throws Exception { + public void listPublishersExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - OrganizationName destination = OrganizationName.of("[ORGANIZATION]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedAdditionalDestinations = new ArrayList<>(); - client.listPublishers(destination, additionalDestinations, parent); + client.listPublishers(parent, destination, formattedAdditionalDestinations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19759,7 +16371,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest7() { + public void listPublishersTest3() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -19769,11 +16381,11 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - FolderName destination = FolderName.of("[FOLDER]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + ProjectName parent = ProjectName.of("[PROJECT]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedAdditionalDestinations = new ArrayList<>(); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); @@ -19783,9 +16395,9 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19794,16 +16406,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest7() throws Exception { + public void listPublishersExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - FolderName destination = FolderName.of("[FOLDER]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + ProjectName parent = ProjectName.of("[PROJECT]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedAdditionalDestinations = new ArrayList<>(); - client.listPublishers(destination, additionalDestinations, parent); + client.listPublishers(parent, destination, formattedAdditionalDestinations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19812,7 +16424,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest8() { + public void listPublishersTest4() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -19822,11 +16434,11 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - ArchivedBookName destination = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + ProjectName parent = ProjectName.of("[PROJECT]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedAdditionalDestinations = new ArrayList<>(); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); @@ -19836,9 +16448,9 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(destination, ShelfName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19847,16 +16459,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest8() throws Exception { + public void listPublishersExceptionTest4() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchivedBookName destination = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + ProjectName parent = ProjectName.of("[PROJECT]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedAdditionalDestinations = new ArrayList<>(); - client.listPublishers(destination, additionalDestinations, parent); + client.listPublishers(parent, destination, formattedAdditionalDestinations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19865,7 +16477,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest9() { + public void listPublishersTest5() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -19875,11 +16487,11 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + List formattedAdditionalDestinations = new ArrayList<>(); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); @@ -19889,9 +16501,9 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19900,16 +16512,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest9() throws Exception { + public void listPublishersExceptionTest5() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + List formattedAdditionalDestinations = new ArrayList<>(); - client.listPublishers(destination, additionalDestinations, parent); + client.listPublishers(parent, destination, formattedAdditionalDestinations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -19918,7 +16530,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest10() { + public void listPublishersTest6() { String nextPageToken = ""; Publisher publishersElement = Publisher.newBuilder().build(); List publishers = Arrays.asList(publishersElement); @@ -19928,11 +16540,11 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ShelfName destination = ShelfName.of("[SHELF_ID]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; + List formattedAdditionalDestinations = new ArrayList<>(); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); + ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); @@ -19942,9 +16554,9 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(destination, ShelfName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -19953,69 +16565,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest10() throws Exception { + public void listPublishersExceptionTest6() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ShelfName destination = ShelfName.of("[SHELF_ID]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - client.listPublishers(destination, additionalDestinations, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listPublishersTest11() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) - .build(); - mockLibraryService.addResponse(expectedResponse); - - BillingAccountName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(destination, additionalDestinations, parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); - - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(additionalDestinations, actualRequest.getAdditionalDestinationsList()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listPublishersExceptionTest11() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + List formattedAdditionalDestinations = new ArrayList<>(); - try { - BillingAccountName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); - List additionalDestinations = new ArrayList<>(); - String parent = "parent-995424086"; - - client.listPublishers(destination, additionalDestinations, parent); + client.listPublishers(parent, destination, formattedAdditionalDestinations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -20074,13 +16633,13 @@ public class LibrarySmokeTest { public static void executeNoCatch() throws Exception { try (LibraryClient client = LibraryClient.create()) { + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); Book.Rating rating = Book.Rating.GOOD; Book book = Book.newBuilder() .setRating(rating) .build(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Book response = client.updateBook(book, name); + Book response = client.updateBook(name, book); } } diff --git a/src/test/java/com/google/api/codegen/testsrc/common/library.proto b/src/test/java/com/google/api/codegen/testsrc/common/library.proto index 9f488d825e..c935e2964b 100644 --- a/src/test/java/com/google/api/codegen/testsrc/common/library.proto +++ b/src/test/java/com/google/api/codegen/testsrc/common/library.proto @@ -1114,8 +1114,7 @@ message Publisher { option (google.api.resource) = { type: "library.googleapis.com/Publisher", pattern: "projects/{project}/locations/{location}/publishers/{publisher}", - pattern: "projects/{project}/publishers/{publisher}", - pattern: "*" + pattern: "projects/{project}/publishers/{publisher}" }; string name = 1; From ebac8dbb35898a86d9d4eb18223402927cea5d69 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 23 Jan 2020 15:42:44 -0800 Subject: [PATCH 07/36] wip --- .../java/JavaApiMethodTransformer.java | 22 +- .../testdata/java_library.baseline | 298 ------------------ 2 files changed, 11 insertions(+), 309 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java index 8745b3ad85..d91346f4bb 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java @@ -189,17 +189,17 @@ private List generateLongRunningMethods( interfaceContext .asFlattenedMethodContext(methodContext, flatteningGroup) .withCallingForms(Collections.singletonList(CallingForm.LongRunningFlattenedAsync)); - if (FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { - flattenedMethodContext = flattenedMethodContext.withResourceNamesInSamplesOnly(); - } + // if (FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { + // flattenedMethodContext = flattenedMethodContext.withResourceNamesInSamplesOnly(); + // } apiMethods.add( generateAsyncOperationFlattenedMethod(flattenedMethodContext, sampleContext)); - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - apiMethods.add( - generateAsyncOperationFlattenedMethod( - flattenedMethodContext.withResourceNamesInSamplesOnly(), sampleContext)); - } + // if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { + // apiMethods.add( + // generateAsyncOperationFlattenedMethod( + // flattenedMethodContext.withResourceNamesInSamplesOnly(), sampleContext)); + // } } } apiMethods.add( @@ -230,9 +230,9 @@ private List generatePagedStreamingMethods( interfaceContext .asFlattenedMethodContext(methodContext, flatteningGroup) .withCallingForms(ImmutableList.of(CallingForm.FlattenedPaged)); - if (!FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { - apiMethods.add(generatePagedFlattenedMethod(flattenedMethodContext, sampleContext)); - } + // if (!FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { + // apiMethods.add(generatePagedFlattenedMethod(flattenedMethodContext, sampleContext)); + // } if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { apiMethods.add( generatePagedFlattenedMethod( diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index ce8ddf3bbf..29d6c9bef8 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -5463,34 +5463,6 @@ public class LibraryClient implements BackgroundResource { return stub.getBookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
-   *   String filter = "book-filter-string";
-   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param name The name of the shelf whose books we'd like to list. - * @param filter To test python built-in wrapping. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(ArchiveName name, String filter) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setFilter(filter) - .build(); - return listBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -5519,34 +5491,6 @@ public class LibraryClient implements BackgroundResource { return listBooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ShelfName name = ShelfName.of("[SHELF_ID]");
-   *   String filter = "book-filter-string";
-   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param name The name of the shelf whose books we'd like to list. - * @param filter To test python built-in wrapping. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(ShelfName name, String filter) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setFilter(filter) - .build(); - return listBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -5575,34 +5519,6 @@ public class LibraryClient implements BackgroundResource { return listBooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   String filter = "book-filter-string";
-   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param name The name of the shelf whose books we'd like to list. - * @param filter To test python built-in wrapping. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(ProjectName name, String filter) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setFilter(filter) - .build(); - return listBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -5962,31 +5878,6 @@ public class LibraryClient implements BackgroundResource { return stub.moveBookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists a primitive resource. To test go page streaming. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
-   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListStringsPagedResponse listStrings(ResourceName name) { - ListStringsRequest request = - ListStringsRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return listStrings(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists a primitive resource. To test go page streaming. @@ -8091,37 +7982,6 @@ public class LibraryClient implements BackgroundResource { return stub.testOptionalRequiredFlatteningParamsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   ProjectName destination = ProjectName.of("[PROJECT]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param parent - * @param destination - * @param additionalDestinations - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(ProjectName parent, ProjectName destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setDestination(destination == null ? null : destination.toString()) - .addAllAdditionalDestinations(additionalDestinations) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -8153,37 +8013,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ProjectName destination = ProjectName.of("[PROJECT]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param parent - * @param destination - * @param additionalDestinations - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(LocationName parent, ProjectName destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setDestination(destination == null ? null : destination.toString()) - .addAllAdditionalDestinations(additionalDestinations) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -8215,37 +8044,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param parent - * @param destination - * @param additionalDestinations - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(ProjectName parent, ArchiveName destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setDestination(destination == null ? null : destination.toString()) - .addAllAdditionalDestinations(additionalDestinations) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -8277,37 +8075,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param parent - * @param destination - * @param additionalDestinations - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(ProjectName parent, ShelfName destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setDestination(destination == null ? null : destination.toString()) - .addAllAdditionalDestinations(additionalDestinations) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -8339,37 +8106,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param parent - * @param destination - * @param additionalDestinations - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(LocationName parent, ArchiveName destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setDestination(destination == null ? null : destination.toString()) - .addAllAdditionalDestinations(additionalDestinations) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -8401,37 +8137,6 @@ public class LibraryClient implements BackgroundResource { return listPublishers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent, destination, formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param parent - * @param destination - * @param additionalDestinations - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPublishersPagedResponse listPublishers(LocationName parent, ShelfName destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setDestination(destination == null ? null : destination.toString()) - .addAllAdditionalDestinations(additionalDestinations) - .build(); - return listPublishers(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -10375,7 +10080,6 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -10562,7 +10266,6 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -11740,7 +11443,6 @@ import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; import com.google.example.library.v1.AddCommentsRequest; -import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; From 637eb3fdfa36fd9498b23362717a1d663becb709 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 23 Jan 2020 16:35:30 -0800 Subject: [PATCH 08/36] wip --- .../testdata/java_library.baseline | 2440 ++++++++++++----- .../api/codegen/testsrc/common/library.proto | 88 +- 2 files changed, 1754 insertions(+), 774 deletions(-) diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 29d6c9bef8..82852caa86 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -711,7 +711,7 @@ public class DeleteShelfRequestEmptyResponseTypeWithoutResponseHandling { package com.google.example.examples.library.v1; -import com.google.example.library.v1.ArchiveName; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; @@ -725,7 +725,7 @@ public class FindRelatedBooksCallableCallableListOdyssey { /* * Please include the following imports to run this sample. * - * import com.google.example.library.v1.ArchiveName; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; @@ -738,12 +738,12 @@ public class FindRelatedBooksCallableCallableListOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - ArchiveName namesElement = ArchiveName.of("[ARCHIVE]"); - List names = Arrays.asList(namesElement); + BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(ArchiveName.toStringList(names)) + .addAllNames(BookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); while (true) { @@ -863,7 +863,7 @@ public class FindRelatedBooksFlattenedPagedOdyssey { package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.ArchiveName; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; @@ -878,7 +878,7 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.ArchiveName; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; @@ -891,12 +891,12 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - ArchiveName namesElement = ArchiveName.of("[ARCHIVE]"); - List names = Arrays.asList(namesElement); + BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(ArchiveName.toStringList(names)) + .addAllNames(BookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); ApiFuture future = libraryClient.findRelatedBooksPagedCallable().futureCall(request); @@ -941,7 +941,7 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { package com.google.example.examples.library.v1; -import com.google.example.library.v1.ArchiveName; +import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.LibraryClient; @@ -954,7 +954,7 @@ public class FindRelatedBooksRequestPagedOdyssey { /* * Please include the following imports to run this sample. * - * import com.google.example.library.v1.ArchiveName; + * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.LibraryClient; @@ -966,12 +966,12 @@ public class FindRelatedBooksRequestPagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - ArchiveName namesElement = ArchiveName.of("[ARCHIVE]"); - List names = Arrays.asList(namesElement); + BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(ArchiveName.toStringList(names)) + .addAllNames(BookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); for (BookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) { @@ -1050,7 +1050,7 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap { public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigBookAsync(name.toString()); + OperationFuture future = libraryClient.getBigBookAsync(name); System.out.println("Waiting for operation to complete..."); Book response = future.get(); @@ -1159,7 +1159,7 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap2 { public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigBookAsync(name.toString()); + OperationFuture future = libraryClient.getBigBookAsync(name); System.out.println("Waiting for operation to complete..."); Book response = future.get(); @@ -1882,7 +1882,7 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithRes public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigNothingAsync(name.toString()); + OperationFuture future = libraryClient.getBigNothingAsync(name); System.out.println("Waiting for operation to complete..."); future.get(); @@ -1946,7 +1946,7 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithout public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigNothingAsync(name.toString()); + OperationFuture future = libraryClient.getBigNothingAsync(name); System.out.println("Waiting for operation to complete..."); future.get(); @@ -2894,6 +2894,7 @@ import org.apache.commons.cli.Options; import com.google.example.library.v1.Book; import com.google.example.library.v1.LibraryClient; import com.google.example.library.v1.PublishSeriesResponse; +import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; import java.util.ArrayList; @@ -2907,6 +2908,7 @@ public class PublishSeriesFlattenedPiVersion { * import com.google.example.library.v1.Book; * import com.google.example.library.v1.LibraryClient; * import com.google.example.library.v1.PublishSeriesResponse; + * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.SeriesUuid; * import com.google.example.library.v1.Shelf; * import java.util.ArrayList; @@ -2936,7 +2938,7 @@ public class PublishSeriesFlattenedPiVersion { SeriesUuid seriesUuid = SeriesUuid.newBuilder() .setSeriesString(seriesString) .build(); - String publisher = ""; + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher); // % % % output handling % % % % // fourScoreAndSevenYears ago @@ -3014,6 +3016,7 @@ package com.google.example.examples.library.v1; import com.google.example.library.v1.Book; import com.google.example.library.v1.LibraryClient; import com.google.example.library.v1.PublishSeriesResponse; +import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; import java.util.ArrayList; @@ -3027,6 +3030,7 @@ public class PublishSeriesFlattenedSecondEdition { * import com.google.example.library.v1.Book; * import com.google.example.library.v1.LibraryClient; * import com.google.example.library.v1.PublishSeriesResponse; + * import com.google.example.library.v1.PublisherName; * import com.google.example.library.v1.SeriesUuid; * import com.google.example.library.v1.Shelf; * import java.util.ArrayList; @@ -3040,7 +3044,7 @@ public class PublishSeriesFlattenedSecondEdition { List books = new ArrayList<>(); int edition = 2; SeriesUuid seriesUuid = SeriesUuid.newBuilder().build(); - String publisher = ""; + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher); System.out.println(response); } catch (Exception exception) { @@ -4490,6 +4494,9 @@ public class LibraryClient implements BackgroundResource { private static final PathTemplate PROJECT_BOOK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/books/{book}"); + private static final PathTemplate PUBLISHER_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/publishers/{publisher}"); + private static final PathTemplate SHELF_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("shelves/{shelf_id}"); @@ -4594,6 +4601,20 @@ public class LibraryClient implements BackgroundResource { "book", book); } + /** + * Formats a string containing the fully-qualified path to represent + * a publisher resource. + * + * @deprecated Use the {@link PublisherName} class instead. + */ + @Deprecated + public static final String formatPublisherName(String project, String location, String publisher) { + return PUBLISHER_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "publisher", publisher); + } + /** * Formats a string containing the fully-qualified path to represent * a shelf resource. @@ -4749,6 +4770,39 @@ public class LibraryClient implements BackgroundResource { return PROJECT_BOOK_PATH_TEMPLATE.parse(projectBookName).get("book"); } + /** + * Parses the project from the given fully-qualified path which + * represents a publisher resource. + * + * @deprecated Use the {@link PublisherName} class instead. + */ + @Deprecated + public static final String parseProjectFromPublisherName(String publisherName) { + return PUBLISHER_PATH_TEMPLATE.parse(publisherName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which + * represents a publisher resource. + * + * @deprecated Use the {@link PublisherName} class instead. + */ + @Deprecated + public static final String parseLocationFromPublisherName(String publisherName) { + return PUBLISHER_PATH_TEMPLATE.parse(publisherName).get("location"); + } + + /** + * Parses the publisher from the given fully-qualified path which + * represents a publisher resource. + * + * @deprecated Use the {@link PublisherName} class instead. + */ + @Deprecated + public static final String parsePublisherFromPublisherName(String publisherName) { + return PUBLISHER_PATH_TEMPLATE.parse(publisherName).get("publisher"); + } + /** * Parses the shelf_id from the given fully-qualified path which * represents a shelf resource. @@ -5316,7 +5370,7 @@ public class LibraryClient implements BackgroundResource { * SeriesUuid seriesUuid = SeriesUuid.newBuilder() * .setSeriesString(seriesString) * .build(); - * String publisher = ""; + * PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); * PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher); * } *
@@ -5463,34 +5517,6 @@ public class LibraryClient implements BackgroundResource { return stub.getBookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
-   *   String filter = "book-filter-string";
-   *   for (Book element : libraryClient.listBooks(name.toString(), filter).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param name The name of the shelf whose books we'd like to list. - * @param filter To test python built-in wrapping. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String name, String filter) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setName(name) - .setFilter(filter) - .build(); - return listBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -5526,35 +5552,7 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   String filter = "book-filter-string";
-   *   for (Book element : libraryClient.listBooks(name.toString(), filter).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param name The name of the shelf whose books we'd like to list. - * @param filter To test python built-in wrapping. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBooksPagedResponse listBooks(String name, String filter) { - ListBooksRequest request = - ListBooksRequest.newBuilder() - .setName(name) - .setFilter(filter) - .build(); - return listBooks(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists books in a shelf. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
    *   ListBooksRequest request = ListBooksRequest.newBuilder()
    *     .setName(name.toString())
@@ -5581,7 +5579,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
    *   ListBooksRequest request = ListBooksRequest.newBuilder()
    *     .setName(name.toString())
@@ -5606,7 +5604,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName name = ArchiveName.of("[ARCHIVE]");
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
    *   String filter = "book-filter-string";
    *   ListBooksRequest request = ListBooksRequest.newBuilder()
    *     .setName(name.toString())
@@ -6570,11 +6568,11 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName namesElement = ArchiveName.of("[ARCHIVE]");
-   *   List<ArchiveName> names = Arrays.asList(namesElement);
+   *   BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<BookName> names = Arrays.asList(namesElement);
    *   List<ShelfName> shelves = new ArrayList<>();
    *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(ArchiveName.toStringList(names))
+   *     .addAllNames(BookName.toStringList(names))
    *     .addAllShelves(ShelfName.toStringList(shelves))
    *     .build();
    *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
@@ -6598,11 +6596,11 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName namesElement = ArchiveName.of("[ARCHIVE]");
-   *   List<ArchiveName> names = Arrays.asList(namesElement);
+   *   BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<BookName> names = Arrays.asList(namesElement);
    *   List<ShelfName> shelves = new ArrayList<>();
    *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(ArchiveName.toStringList(names))
+   *     .addAllNames(BookName.toStringList(names))
    *     .addAllShelves(ShelfName.toStringList(shelves))
    *     .build();
    *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
@@ -6624,11 +6622,11 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveName namesElement = ArchiveName.of("[ARCHIVE]");
-   *   List<ArchiveName> names = Arrays.asList(namesElement);
+   *   BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   List<BookName> names = Arrays.asList(namesElement);
    *   List<ShelfName> shelves = new ArrayList<>();
    *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
-   *     .addAllNames(ArchiveName.toStringList(names))
+   *     .addAllNames(BookName.toStringList(names))
    *     .addAllShelves(ShelfName.toStringList(shelves))
    *     .build();
    *   while (true) {
@@ -6723,30 +6721,6 @@ public class LibraryClient implements BackgroundResource {
     return getBigBookAsync(request);
   }
 
-  // AUTO-GENERATED DOCUMENTATION AND METHOD
-  /**
-   * Test long-running operations
-   *
-   * Sample code:
-   * 

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigBookAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name) - .build(); - return getBigBookAsync(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Test long-running operations @@ -6837,30 +6811,6 @@ public class LibraryClient implements BackgroundResource { return getBigNothingAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Test long-running operations with empty return type. - * - * Sample code: - *

-   * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   libraryClient.getBigNothingAsync(name.toString()).get();
-   * }
-   * 
- * - * @param name The name of the book to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture getBigNothingAsync(String name) { - GetBookRequest request = - GetBookRequest.newBuilder() - .setName(name) - .build(); - return getBigNothingAsync(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Test long-running operations with empty return type. @@ -7989,28 +7939,29 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    *   ProjectName destination = ProjectName.of("[PROJECT]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
* - * @param parent + * @param source * @param destination - * @param additionalDestinations + * @param publishers + * @param project * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent) - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) + public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) .build(); - return listPublishers(request); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8020,28 +7971,29 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ShelfName source = ShelfName.of("[SHELF_ID]");
    *   ProjectName destination = ProjectName.of("[PROJECT]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
* - * @param parent + * @param source * @param destination - * @param additionalDestinations + * @param publishers + * @param project * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent) - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) + public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) .build(); - return listPublishers(request); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8051,28 +8003,61 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ProjectName source = ProjectName.of("[PROJECT]");
+   *   ProjectName destination = ProjectName.of("[PROJECT]");
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
+   * }
+   * 
+ * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
* - * @param parent + * @param source * @param destination - * @param additionalDestinations + * @param publishers + * @param project * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent) - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) + public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) .build(); - return listPublishers(request); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8082,28 +8067,29 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    *   ShelfName destination = ShelfName.of("[SHELF_ID]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
* - * @param parent + * @param source * @param destination - * @param additionalDestinations + * @param publishers + * @param project * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent) - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) + public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) .build(); - return listPublishers(request); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8113,28 +8099,29 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ShelfName source = ShelfName.of("[SHELF_ID]");
    *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
* - * @param parent + * @param source * @param destination - * @param additionalDestinations + * @param publishers + * @param project * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent) - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) + public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) .build(); - return listPublishers(request); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8144,28 +8131,29 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ShelfName source = ShelfName.of("[SHELF_ID]");
    *   ShelfName destination = ShelfName.of("[SHELF_ID]");
-   *   List<String> formattedAdditionalDestinations = new ArrayList<>();
-   *   for (Publisher element : libraryClient.listPublishers(parent.toString(), destination.toString(), formattedAdditionalDestinations).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
* - * @param parent + * @param source * @param destination - * @param additionalDestinations + * @param publishers + * @param project * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListPublishersPagedResponse listPublishers(String parent, String destination, List additionalDestinations) { - ListPublishersRequest request = - ListPublishersRequest.newBuilder() - .setParent(parent) - .setDestination(destination) - .addAllAdditionalDestinations(additionalDestinations) + public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) .build(); - return listPublishers(request); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8175,22 +8163,29 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Publisher element : libraryClient.listPublishers(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   ProjectName source = ProjectName.of("[PROJECT]");
+   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param source + * @param destination + * @param publishers + * @param project * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListPublishersPagedResponse listPublishers(ListPublishersRequest request) { - return listPublishersPagedCallable() - .call(request); + public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8200,20 +8195,29 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListPublishersPagedResponse> future = libraryClient.listPublishersPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Publisher element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   ProjectName source = ProjectName.of("[PROJECT]");
+   *   ShelfName destination = ShelfName.of("[SHELF_ID]");
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    * }
    * 
+ * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listPublishersPagedCallable() { - return stub.listPublishersPagedCallable(); + public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers)) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -8223,73 +8227,387 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   ListPublishersRequest request = ListPublishersRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListPublishersResponse response = libraryClient.listPublishersCallable().call(request);
-   *     for (Publisher element : response.getPublishersList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
+   *   ProjectName destination = ProjectName.of("[PROJECT]");
+   *   List<String> formattedPublishers = new ArrayList<>();
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   MoveBooksResponse response = libraryClient.moveBooks(source.toString(), destination.toString(), formattedPublishers, project.toString());
    * }
    * 
+ * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listPublishersCallable() { - return stub.listPublishersCallable(); + public final MoveBooksResponse moveBooks(String source, String destination, List publishers, String project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source) + .setDestination(destination) + .addAllPublishers(publishers) + .setProject(project) + .build(); + return moveBooks(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * This method is not exposed in the GAPIC config. It should be generated. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
-   *   Book response = libraryClient.privateListShelves(request);
+   *   MoveBooksRequest request = MoveBooksRequest.newBuilder().build();
+   *   MoveBooksResponse response = libraryClient.moveBooks(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book privateListShelves(ListShelvesRequest request) { - return privateListShelvesCallable().call(request); + public final MoveBooksResponse moveBooks(MoveBooksRequest request) { + return moveBooksCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * This method is not exposed in the GAPIC config. It should be generated. + * * * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
-   *   ApiFuture<Book> future = libraryClient.privateListShelvesCallable().futureCall(request);
+   *   MoveBooksRequest request = MoveBooksRequest.newBuilder().build();
+   *   ApiFuture<MoveBooksResponse> future = libraryClient.moveBooksCallable().futureCall(request);
    *   // Do something
-   *   Book response = future.get();
+   *   MoveBooksResponse response = future.get();
    * }
    * 
*/ - public final UnaryCallable privateListShelvesCallable() { - return stub.privateListShelvesCallable(); + public final UnaryCallable moveBooksCallable() { + return stub.moveBooksCallable(); } - @Override - public final void close() { - stub.close(); + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.archiveBooks(source, archive);
+   * }
+   * 
+ * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ArchiveName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); } - @Override - public void shutdown() { + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName source = ShelfName.of("[SHELF_ID]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.archiveBooks(source, archive);
+   * }
+   * 
+ * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ShelfName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ProjectName source = ProjectName.of("[PROJECT]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.archiveBooks(source, archive);
+   * }
+   * 
+ * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ProjectName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
+   *   ArchiveBooksResponse response = libraryClient.archiveBooks(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ArchiveBooksRequest request) { + return archiveBooksCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
+   *   ApiFuture<ArchiveBooksResponse> future = libraryClient.archiveBooksCallable().futureCall(request);
+   *   // Do something
+   *   ArchiveBooksResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable archiveBooksCallable() { + return stub.archiveBooksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source, archive).get();
+   * }
+   * 
+ * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ArchiveName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName source = ShelfName.of("[SHELF_ID]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source, archive).get();
+   * }
+   * 
+ * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ShelfName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ProjectName source = ProjectName.of("[PROJECT]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source, archive).get();
+   * }
+   * 
+ * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ProjectName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
+   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ArchiveBooksRequest request) { + return longRunningArchiveBooksOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
+   *   OperationFuture<ArchiveBooksResponse, ArchiveBooksMetadata> future = libraryClient.longRunningArchiveBooksOperationCallable().futureCall(request);
+   *   // Do something
+   *   ArchiveBooksResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable longRunningArchiveBooksOperationCallable() { + return stub.longRunningArchiveBooksOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
+   *   ApiFuture<Operation> future = libraryClient.longRunningArchiveBooksCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable longRunningArchiveBooksCallable() { + return stub.longRunningArchiveBooksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BidiStream<ArchiveBooksRequest, ArchiveBooksResponse> bidiStream =
+   *       libraryClient.streamingArchiveBooksCallable().call();
+   *
+   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
+   *   bidiStream.send(request);
+   *   for (ArchiveBooksResponse response : bidiStream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final BidiStreamingCallable streamingArchiveBooksCallable() { + return stub.streamingArchiveBooksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * This method is not exposed in the GAPIC config. It should be generated. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
+   *   Book response = libraryClient.privateListShelves(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book privateListShelves(ListShelvesRequest request) { + return privateListShelvesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * This method is not exposed in the GAPIC config. It should be generated. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ListShelvesRequest request = ListShelvesRequest.newBuilder().build();
+   *   ApiFuture<Book> future = libraryClient.privateListShelvesCallable().futureCall(request);
+   *   // Do something
+   *   Book response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable privateListShelvesCallable() { + return stub.privateListShelvesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { stub.shutdown(); } @@ -8728,94 +9046,6 @@ public class LibraryClient implements BackgroundResource { ); } - } - public static class ListPublishersPagedResponse extends AbstractPagedListResponse< - ListPublishersRequest, - ListPublishersResponse, - Publisher, - ListPublishersPage, - ListPublishersFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListPublishersPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListPublishersPagedResponse apply(ListPublishersPage input) { - return new ListPublishersPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); - } - - private ListPublishersPagedResponse(ListPublishersPage page) { - super(page, ListPublishersFixedSizeCollection.createEmptyCollection()); - } - - - } - - public static class ListPublishersPage extends AbstractPage< - ListPublishersRequest, - ListPublishersResponse, - Publisher, - ListPublishersPage> { - - private ListPublishersPage( - PageContext context, - ListPublishersResponse response) { - super(context, response); - } - - private static ListPublishersPage createEmptyPage() { - return new ListPublishersPage(null, null); - } - - @Override - protected ListPublishersPage createPage( - PageContext context, - ListPublishersResponse response) { - return new ListPublishersPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - - - - - } - - public static class ListPublishersFixedSizeCollection extends AbstractFixedSizeCollection< - ListPublishersRequest, - ListPublishersResponse, - Publisher, - ListPublishersPage, - ListPublishersFixedSizeCollection> { - - private ListPublishersFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListPublishersFixedSizeCollection createEmptyCollection() { - return new ListPublishersFixedSizeCollection(null, 0); - } - - @Override - protected ListPublishersFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListPublishersFixedSizeCollection(pages, collectionSize); - } - - } } ============== file: src/main/java/com/google/example/library/v1/LibrarySettings.java ============== @@ -8886,7 +9116,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; import com.google.example.library.v1.stub.LibraryServiceStubSettings; @@ -9147,10 +9376,39 @@ public class LibrarySettings extends ClientSettings { } /** - * Returns the object with the settings used for calls to listPublishers. + * Returns the object with the settings used for calls to moveBooks. + */ + public UnaryCallSettings moveBooksSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).moveBooksSettings(); + } + + /** + * Returns the object with the settings used for calls to archiveBooks. + */ + public UnaryCallSettings archiveBooksSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).archiveBooksSettings(); + } + + /** + * Returns the object with the settings used for calls to longRunningArchiveBooks. + */ + public UnaryCallSettings longRunningArchiveBooksSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).longRunningArchiveBooksSettings(); + } + + /** + * Returns the object with the settings used for calls to longRunningArchiveBooks. + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings longRunningArchiveBooksOperationSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).longRunningArchiveBooksOperationSettings(); + } + + /** + * Returns the object with the settings used for calls to streamingArchiveBooks. */ - public PagedCallSettings listPublishersSettings() { - return ((LibraryServiceStubSettings) getStubSettings()).listPublishersSettings(); + public StreamingCallSettings streamingArchiveBooksSettings() { + return ((LibraryServiceStubSettings) getStubSettings()).streamingArchiveBooksSettings(); } /** @@ -9487,10 +9745,39 @@ public class LibrarySettings extends ClientSettings { } /** - * Returns the builder for the settings used for calls to listPublishers. + * Returns the builder for the settings used for calls to moveBooks. + */ + public UnaryCallSettings.Builder moveBooksSettings() { + return getStubSettingsBuilder().moveBooksSettings(); + } + + /** + * Returns the builder for the settings used for calls to archiveBooks. + */ + public UnaryCallSettings.Builder archiveBooksSettings() { + return getStubSettingsBuilder().archiveBooksSettings(); + } + + /** + * Returns the builder for the settings used for calls to longRunningArchiveBooks. + */ + public UnaryCallSettings.Builder longRunningArchiveBooksSettings() { + return getStubSettingsBuilder().longRunningArchiveBooksSettings(); + } + + /** + * Returns the builder for the settings used for calls to longRunningArchiveBooks. + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder longRunningArchiveBooksOperationSettings() { + return getStubSettingsBuilder().longRunningArchiveBooksOperationSettings(); + } + + /** + * Returns the builder for the settings used for calls to streamingArchiveBooks. */ - public PagedCallSettings.Builder listPublishersSettings() { - return getStubSettingsBuilder().listPublishersSettings(); + public StreamingCallSettings.Builder streamingArchiveBooksSettings() { + return getStubSettingsBuilder().streamingArchiveBooksSettings(); } /** @@ -10080,6 +10367,10 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveBooksMetadata; +import com.google.example.library.v1.ArchiveBooksRequest; +import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -10102,14 +10393,11 @@ import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.GetShelfRequest; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; import com.google.example.library.v1.LibrarySettings; import com.google.example.library.v1.ListBooksRequest; import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListPublishersRequest; -import com.google.example.library.v1.ListPublishersResponse; import com.google.example.library.v1.ListShelvesRequest; import com.google.example.library.v1.ListShelvesResponse; import com.google.example.library.v1.ListStringsRequest; @@ -10117,10 +10405,11 @@ import com.google.example.library.v1.ListStringsResponse; import com.google.example.library.v1.LocationName; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.MoveBooksRequest; +import com.google.example.library.v1.MoveBooksResponse; import com.google.example.library.v1.ProjectName; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.Publisher; import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; @@ -10266,6 +10555,10 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveBooksMetadata; +import com.google.example.library.v1.ArchiveBooksRequest; +import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -10288,14 +10581,11 @@ import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.GetShelfRequest; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; import com.google.example.library.v1.LibrarySettings; import com.google.example.library.v1.ListBooksRequest; import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListPublishersRequest; -import com.google.example.library.v1.ListPublishersResponse; import com.google.example.library.v1.ListShelvesRequest; import com.google.example.library.v1.ListShelvesResponse; import com.google.example.library.v1.ListStringsRequest; @@ -10303,10 +10593,11 @@ import com.google.example.library.v1.ListStringsResponse; import com.google.example.library.v1.LocationName; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.MoveBooksRequest; +import com.google.example.library.v1.MoveBooksResponse; import com.google.example.library.v1.ProjectName; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.Publisher; import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; @@ -10557,12 +10848,33 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(TestOptionalRequiredFlatteningParamsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(TestOptionalRequiredFlatteningParamsResponse.getDefaultInstance())) .build(); - private static final MethodDescriptor listPublishersMethodDescriptor = - MethodDescriptor.newBuilder() + private static final MethodDescriptor moveBooksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/MoveBooks") + .setRequestMarshaller(ProtoUtils.marshaller(MoveBooksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(MoveBooksResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor archiveBooksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.example.library.v1.LibraryService/ArchiveBooks") + .setRequestMarshaller(ProtoUtils.marshaller(ArchiveBooksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ArchiveBooksResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor longRunningArchiveBooksMethodDescriptor = + MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.example.library.v1.LibraryService/ListPublishers") - .setRequestMarshaller(ProtoUtils.marshaller(ListPublishersRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListPublishersResponse.getDefaultInstance())) + .setFullMethodName("google.example.library.v1.LibraryService/LongRunningArchiveBooks") + .setRequestMarshaller(ProtoUtils.marshaller(ArchiveBooksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor streamingArchiveBooksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.example.library.v1.LibraryService/StreamingArchiveBooks") + .setRequestMarshaller(ProtoUtils.marshaller(ArchiveBooksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ArchiveBooksResponse.getDefaultInstance())) .build(); private static final MethodDescriptor privateListShelvesMethodDescriptor = MethodDescriptor.newBuilder() @@ -10610,8 +10922,11 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { private final UnaryCallable getBigNothingCallable; private final OperationCallable getBigNothingOperationCallable; private final UnaryCallable testOptionalRequiredFlatteningParamsCallable; - private final UnaryCallable listPublishersCallable; - private final UnaryCallable listPublishersPagedCallable; + private final UnaryCallable moveBooksCallable; + private final UnaryCallable archiveBooksCallable; + private final UnaryCallable longRunningArchiveBooksCallable; + private final OperationCallable longRunningArchiveBooksOperationCallable; + private final BidiStreamingCallable streamingArchiveBooksCallable; private final UnaryCallable privateListShelvesCallable; private final GrpcStubCallableFactory callableFactory; @@ -10921,9 +11236,48 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { GrpcCallSettings.newBuilder() .setMethodDescriptor(testOptionalRequiredFlatteningParamsMethodDescriptor) .build(); - GrpcCallSettings listPublishersTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listPublishersMethodDescriptor) + GrpcCallSettings moveBooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(moveBooksMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MoveBooksRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("source", String.valueOf(request.getSource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings archiveBooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(archiveBooksMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ArchiveBooksRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("source", String.valueOf(request.getSource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings longRunningArchiveBooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(longRunningArchiveBooksMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ArchiveBooksRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("source", String.valueOf(request.getSource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings streamingArchiveBooksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamingArchiveBooksMethodDescriptor) .build(); GrpcCallSettings privateListShelvesTransportSettings = GrpcCallSettings.newBuilder() @@ -10966,8 +11320,12 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { this.getBigNothingOperationCallable = callableFactory.createOperationCallable( getBigNothingTransportSettings,settings.getBigNothingOperationSettings(), clientContext, this.operationsStub); this.testOptionalRequiredFlatteningParamsCallable = callableFactory.createUnaryCallable(testOptionalRequiredFlatteningParamsTransportSettings,settings.testOptionalRequiredFlatteningParamsSettings(), clientContext); - this.listPublishersCallable = callableFactory.createUnaryCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); - this.listPublishersPagedCallable = callableFactory.createPagedCallable(listPublishersTransportSettings,settings.listPublishersSettings(), clientContext); + this.moveBooksCallable = callableFactory.createUnaryCallable(moveBooksTransportSettings,settings.moveBooksSettings(), clientContext); + this.archiveBooksCallable = callableFactory.createUnaryCallable(archiveBooksTransportSettings,settings.archiveBooksSettings(), clientContext); + this.longRunningArchiveBooksCallable = callableFactory.createUnaryCallable(longRunningArchiveBooksTransportSettings,settings.longRunningArchiveBooksSettings(), clientContext); + this.longRunningArchiveBooksOperationCallable = callableFactory.createOperationCallable( + longRunningArchiveBooksTransportSettings,settings.longRunningArchiveBooksOperationSettings(), clientContext, this.operationsStub); + this.streamingArchiveBooksCallable = callableFactory.createBidiStreamingCallable(streamingArchiveBooksTransportSettings,settings.streamingArchiveBooksSettings(), clientContext); this.privateListShelvesCallable = callableFactory.createUnaryCallable(privateListShelvesTransportSettings,settings.privateListShelvesSettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -11116,12 +11474,25 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { return testOptionalRequiredFlatteningParamsCallable; } - public UnaryCallable listPublishersPagedCallable() { - return listPublishersPagedCallable; + public UnaryCallable moveBooksCallable() { + return moveBooksCallable; + } + + public UnaryCallable archiveBooksCallable() { + return archiveBooksCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable longRunningArchiveBooksOperationCallable() { + return longRunningArchiveBooksOperationCallable; + } + + public UnaryCallable longRunningArchiveBooksCallable() { + return longRunningArchiveBooksCallable; } - public UnaryCallable listPublishersCallable() { - return listPublishersCallable; + public BidiStreamingCallable streamingArchiveBooksCallable() { + return streamingArchiveBooksCallable; } public UnaryCallable privateListShelvesCallable() { @@ -11443,6 +11814,10 @@ import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveBooksMetadata; +import com.google.example.library.v1.ArchiveBooksRequest; +import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -11465,13 +11840,10 @@ import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.GetShelfRequest; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; import com.google.example.library.v1.ListBooksRequest; import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListPublishersRequest; -import com.google.example.library.v1.ListPublishersResponse; import com.google.example.library.v1.ListShelvesRequest; import com.google.example.library.v1.ListShelvesResponse; import com.google.example.library.v1.ListStringsRequest; @@ -11479,10 +11851,11 @@ import com.google.example.library.v1.ListStringsResponse; import com.google.example.library.v1.LocationName; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.MoveBooksRequest; +import com.google.example.library.v1.MoveBooksResponse; import com.google.example.library.v1.ProjectName; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.Publisher; import com.google.example.library.v1.PublisherName; import com.google.example.library.v1.SeriesUuid; import com.google.example.library.v1.Shelf; @@ -11676,12 +12049,25 @@ public abstract class LibraryServiceStub implements BackgroundResource { throw new UnsupportedOperationException("Not implemented: testOptionalRequiredFlatteningParamsCallable()"); } - public UnaryCallable listPublishersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listPublishersPagedCallable()"); + public UnaryCallable moveBooksCallable() { + throw new UnsupportedOperationException("Not implemented: moveBooksCallable()"); + } + + public UnaryCallable archiveBooksCallable() { + throw new UnsupportedOperationException("Not implemented: archiveBooksCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable longRunningArchiveBooksOperationCallable() { + throw new UnsupportedOperationException("Not implemented: longRunningArchiveBooksOperationCallable()"); + } + + public UnaryCallable longRunningArchiveBooksCallable() { + throw new UnsupportedOperationException("Not implemented: longRunningArchiveBooksCallable()"); } - public UnaryCallable listPublishersCallable() { - throw new UnsupportedOperationException("Not implemented: listPublishersCallable()"); + public BidiStreamingCallable streamingArchiveBooksCallable() { + throw new UnsupportedOperationException("Not implemented: streamingArchiveBooksCallable()"); } public UnaryCallable privateListShelvesCallable() { @@ -11758,6 +12144,9 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.google.example.library.v1.AddCommentsRequest; +import com.google.example.library.v1.ArchiveBooksMetadata; +import com.google.example.library.v1.ArchiveBooksRequest; +import com.google.example.library.v1.ArchiveBooksResponse; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; import com.google.example.library.v1.BookFromArchive; @@ -11777,23 +12166,21 @@ import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.GetShelfRequest; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; import com.google.example.library.v1.LibraryServiceGrpc; import com.google.example.library.v1.ListBooksRequest; import com.google.example.library.v1.ListBooksResponse; -import com.google.example.library.v1.ListPublishersRequest; -import com.google.example.library.v1.ListPublishersResponse; import com.google.example.library.v1.ListShelvesRequest; import com.google.example.library.v1.ListShelvesResponse; import com.google.example.library.v1.ListStringsRequest; import com.google.example.library.v1.ListStringsResponse; import com.google.example.library.v1.MergeShelvesRequest; import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.MoveBooksRequest; +import com.google.example.library.v1.MoveBooksResponse; import com.google.example.library.v1.PublishSeriesRequest; import com.google.example.library.v1.PublishSeriesResponse; -import com.google.example.library.v1.Publisher; import com.google.example.library.v1.Shelf; import com.google.example.library.v1.StreamBooksRequest; import com.google.example.library.v1.StreamShelvesRequest; @@ -11884,7 +12271,11 @@ public class LibraryServiceStubSettings extends StubSettings getBigNothingSettings; private final OperationCallSettings getBigNothingOperationSettings; private final UnaryCallSettings testOptionalRequiredFlatteningParamsSettings; - private final PagedCallSettings listPublishersSettings; + private final UnaryCallSettings moveBooksSettings; + private final UnaryCallSettings archiveBooksSettings; + private final UnaryCallSettings longRunningArchiveBooksSettings; + private final OperationCallSettings longRunningArchiveBooksOperationSettings; + private final StreamingCallSettings streamingArchiveBooksSettings; private final UnaryCallSettings privateListShelvesSettings; /** @@ -12100,10 +12491,39 @@ public class LibraryServiceStubSettings extends StubSettings moveBooksSettings() { + return moveBooksSettings; + } + + /** + * Returns the object with the settings used for calls to archiveBooks. */ - public PagedCallSettings listPublishersSettings() { - return listPublishersSettings; + public UnaryCallSettings archiveBooksSettings() { + return archiveBooksSettings; + } + + /** + * Returns the object with the settings used for calls to longRunningArchiveBooks. + */ + public UnaryCallSettings longRunningArchiveBooksSettings() { + return longRunningArchiveBooksSettings; + } + + /** + * Returns the object with the settings used for calls to longRunningArchiveBooks. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings longRunningArchiveBooksOperationSettings() { + return longRunningArchiveBooksOperationSettings; + } + + /** + * Returns the object with the settings used for calls to streamingArchiveBooks. + */ + public StreamingCallSettings streamingArchiveBooksSettings() { + return streamingArchiveBooksSettings; } /** @@ -12229,7 +12649,11 @@ public class LibraryServiceStubSettings extends StubSettings LIST_PUBLISHERS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - @Override - public ListPublishersRequest injectToken(ListPublishersRequest payload, String token) { - return ListPublishersRequest - .newBuilder(payload) - .setPageToken(token) - .build(); - } - @Override - public ListPublishersRequest injectPageSize(ListPublishersRequest payload, int pageSize) { - return ListPublishersRequest - .newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - @Override - public Integer extractPageSize(ListPublishersRequest payload) { - return payload.getPageSize(); - } - @Override - public String extractNextToken(ListPublishersResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListPublishersResponse payload) { - return payload.getPublishersList() != null ? payload.getPublishersList() : - ImmutableList.of(); - } - }; - private static final PagedListResponseFactory LIST_SHELVES_PAGE_STR_FACT = new PagedListResponseFactory() { @Override @@ -12461,20 +12850,6 @@ public class LibraryServiceStubSettings extends StubSettings LIST_PUBLISHERS_PAGE_STR_FACT = - new PagedListResponseFactory() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListPublishersRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_PUBLISHERS_PAGE_STR_DESC, request, context); - return ListPublishersPagedResponse.createAsync(pageContext, futureResponse); - } - }; - private static final BatchingDescriptor PUBLISH_SERIES_BATCHING_DESC = new BatchingDescriptor() { @Override @@ -12633,7 +13008,11 @@ public class LibraryServiceStubSettings extends StubSettings getBigNothingSettings; private final OperationCallSettings.Builder getBigNothingOperationSettings; private final UnaryCallSettings.Builder testOptionalRequiredFlatteningParamsSettings; - private final PagedCallSettings.Builder listPublishersSettings; + private final UnaryCallSettings.Builder moveBooksSettings; + private final UnaryCallSettings.Builder archiveBooksSettings; + private final UnaryCallSettings.Builder longRunningArchiveBooksSettings; + private final OperationCallSettings.Builder longRunningArchiveBooksOperationSettings; + private final StreamingCallSettings.Builder streamingArchiveBooksSettings; private final UnaryCallSettings.Builder privateListShelvesSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -12742,8 +13121,15 @@ public class LibraryServiceStubSettings extends StubSettingsnewUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(ArchiveBooksResponse.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(ArchiveBooksMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); return builder; } @@ -12993,7 +13409,11 @@ public class LibraryServiceStubSettings extends StubSettings>of( @@ -13020,7 +13440,9 @@ public class LibraryServiceStubSettings extends StubSettings moveBooksSettings() { + return moveBooksSettings; + } + + /** + * Returns the builder for the settings used for calls to archiveBooks. + */ + public UnaryCallSettings.Builder archiveBooksSettings() { + return archiveBooksSettings; + } + + /** + * Returns the builder for the settings used for calls to longRunningArchiveBooks. + */ + public UnaryCallSettings.Builder longRunningArchiveBooksSettings() { + return longRunningArchiveBooksSettings; + } + + /** + * Returns the builder for the settings used for calls to longRunningArchiveBooks. + */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder longRunningArchiveBooksOperationSettings() { + return longRunningArchiveBooksOperationSettings; + } + + /** + * Returns the builder for the settings used for calls to streamingArchiveBooks. */ - public PagedCallSettings.Builder listPublishersSettings() { - return listPublishersSettings; + public StreamingCallSettings.Builder streamingArchiveBooksSettings() { + return streamingArchiveBooksSettings; } /** @@ -13654,7 +14105,6 @@ import com.google.common.collect.Lists; import com.google.example.library.v1.Comment; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; -import static com.google.example.library.v1.LibraryClient.ListPublishersPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; import com.google.example.library.v1.SomeMessage2; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; @@ -14083,7 +14533,7 @@ public class LibraryClientTest { SeriesUuid seriesUuid = SeriesUuid.newBuilder() .setSeriesString(seriesString) .build(); - String publisher = "publisher1447404028"; + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); PublishSeriesResponse actualResponse = client.publishSeries(shelf, books, edition, seriesUuid, publisher); @@ -14097,7 +14547,7 @@ public class LibraryClientTest { Assert.assertEquals(books, actualRequest.getBooksList()); Assert.assertEquals(edition, actualRequest.getEdition()); Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(publisher, PublisherNames.parse(actualRequest.getPublisher())); + Assert.assertEquals(publisher, PublisherName.parse(actualRequest.getPublisher())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14118,7 +14568,7 @@ public class LibraryClientTest { SeriesUuid seriesUuid = SeriesUuid.newBuilder() .setSeriesString(seriesString) .build(); - String publisher = "publisher1447404028"; + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); client.publishSeries(shelf, books, edition, seriesUuid, publisher); Assert.fail("No exception raised"); @@ -14161,114 +14611,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - - client.getBook(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listBooksTest() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchiveName name = ArchiveName.of("[ARCHIVE]"); - String filter = "book-filter-string"; - - ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(name, ArchiveName.parse(actualRequest.getName())); - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchiveName name = ArchiveName.of("[ARCHIVE]"); - String filter = "book-filter-string"; - - client.listBooks(name, filter); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void listBooksTest2() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; - - ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listBooksExceptionTest2() throws Exception { + public void getBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; + BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - client.listBooks(name, filter); + client.getBook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14277,7 +14627,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksTest3() { + public void listBooksTest() { String nextPageToken = ""; Book booksElement = Book.newBuilder().build(); List books = Arrays.asList(booksElement); @@ -14287,7 +14637,7 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - ProjectName name = ProjectName.of("[PROJECT]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); String filter = "book-filter-string"; ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); @@ -14300,7 +14650,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - Assert.assertEquals(name, ProjectName.parse(actualRequest.getName())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertEquals(filter, actualRequest.getFilter()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -14310,12 +14660,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest3() throws Exception { + public void listBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ProjectName name = ProjectName.of("[PROJECT]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); String filter = "book-filter-string"; client.listBooks(name, filter); @@ -15958,7 +16308,415 @@ public class LibraryClientTest { List repeatedBoolValue = new ArrayList<>(); List repeatedBytesValue = new ArrayList<>(); - client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest2() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName source = ShelfName.of("[SHELF_ID]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName source = ShelfName.of("[SHELF_ID]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest3() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ProjectName source = ProjectName.of("[PROJECT]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ProjectName source = ProjectName.of("[PROJECT]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest4() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest5() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest6() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName source = ShelfName.of("[SHELF_ID]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName source = ShelfName.of("[SHELF_ID]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest7() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName source = ShelfName.of("[SHELF_ID]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest7() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName source = ShelfName.of("[SHELF_ID]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBooksTest8() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ProjectName source = ProjectName.of("[PROJECT]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBooksExceptionTest8() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ProjectName source = ProjectName.of("[PROJECT]"); + ArchiveName destination = ArchiveName.of("[ARCHIVE]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); + + client.moveBooks(source, destination, formattedPublishers, project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15967,33 +16725,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + public void moveBooksTest9() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) .build(); mockLibraryService.addResponse(expectedResponse); - ProjectName parent = ProjectName.of("[PROJECT]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedAdditionalDestinations = new ArrayList<>(); - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); + ProjectName source = ProjectName.of("[PROJECT]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); - Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16002,16 +16757,17 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest() throws Exception { + public void moveBooksExceptionTest9() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ProjectName parent = ProjectName.of("[PROJECT]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedAdditionalDestinations = new ArrayList<>(); + ProjectName source = ProjectName.of("[PROJECT]"); + ShelfName destination = ShelfName.of("[SHELF_ID]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - client.listPublishers(parent, destination, formattedAdditionalDestinations); + client.moveBooks(source, destination, formattedPublishers, project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -16020,33 +16776,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest2() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + public void moveBooksTest10() { + boolean success = false; + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() + .setSuccess(success) .build(); mockLibraryService.addResponse(expectedResponse); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ArchiveName source = ArchiveName.of("[ARCHIVE]"); ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedAdditionalDestinations = new ArrayList<>(); - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); - Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16055,16 +16808,17 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest2() throws Exception { + public void moveBooksExceptionTest10() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ArchiveName source = ArchiveName.of("[ARCHIVE]"); ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedAdditionalDestinations = new ArrayList<>(); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - client.listPublishers(parent, destination, formattedAdditionalDestinations); + client.moveBooks(source, destination, formattedPublishers, project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -16073,33 +16827,26 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest3() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + public void archiveBooksTest() { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) .build(); mockLibraryService.addResponse(expectedResponse); - ProjectName parent = ProjectName.of("[PROJECT]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedAdditionalDestinations = new ArrayList<>(); + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + ArchiveBooksResponse actualResponse = + client.archiveBooks(source, archive); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); - Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16108,16 +16855,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest3() throws Exception { + public void archiveBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ProjectName parent = ProjectName.of("[PROJECT]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedAdditionalDestinations = new ArrayList<>(); + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - client.listPublishers(parent, destination, formattedAdditionalDestinations); + client.archiveBooks(source, archive); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -16126,33 +16872,26 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest4() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + public void archiveBooksTest2() { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) .build(); mockLibraryService.addResponse(expectedResponse); - ProjectName parent = ProjectName.of("[PROJECT]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedAdditionalDestinations = new ArrayList<>(); - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); + ShelfName source = ShelfName.of("[SHELF_ID]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + ArchiveBooksResponse actualResponse = + client.archiveBooks(source, archive); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); - Assert.assertEquals(destination, ShelfName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(source, ShelfName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16161,16 +16900,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest4() throws Exception { + public void archiveBooksExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ProjectName parent = ProjectName.of("[PROJECT]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedAdditionalDestinations = new ArrayList<>(); + ShelfName source = ShelfName.of("[SHELF_ID]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - client.listPublishers(parent, destination, formattedAdditionalDestinations); + client.archiveBooks(source, archive); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -16179,33 +16917,26 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest5() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + public void archiveBooksTest3() { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) .build(); mockLibraryService.addResponse(expectedResponse); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedAdditionalDestinations = new ArrayList<>(); - - ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); + ProjectName source = ProjectName.of("[PROJECT]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + ArchiveBooksResponse actualResponse = + client.archiveBooks(source, archive); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); - Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(source, ProjectName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16214,16 +16945,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest5() throws Exception { + public void archiveBooksExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedAdditionalDestinations = new ArrayList<>(); + ProjectName source = ProjectName.of("[PROJECT]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - client.listPublishers(parent, destination, formattedAdditionalDestinations); + client.archiveBooks(source, archive); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -16232,33 +16962,86 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersTest6() { - String nextPageToken = ""; - Publisher publishersElement = Publisher.newBuilder().build(); - List publishers = Arrays.asList(publishersElement); - ListPublishersResponse expectedResponse = ListPublishersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllPublishers(publishers) + public void longRunningArchiveBooksTest() throws Exception { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) .build(); - mockLibraryService.addResponse(expectedResponse); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningArchiveBooksTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedAdditionalDestinations = new ArrayList<>(); + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + ArchiveBooksResponse actualResponse = + client.longRunningArchiveBooksAsync(source, archive).get(); + Assert.assertEquals(expectedResponse, actualResponse); - ListPublishersPagedResponse pagedListResponse = client.listPublishers(parent, destination, formattedAdditionalDestinations); + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPublishersList().get(0), resources.get(0)); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void longRunningArchiveBooksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + client.longRunningArchiveBooksAsync(source, archive).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + + @Test + @SuppressWarnings("all") + public void longRunningArchiveBooksTest2() throws Exception { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningArchiveBooksTest2") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); + + ShelfName source = ShelfName.of("[SHELF_ID]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + ArchiveBooksResponse actualResponse = + client.longRunningArchiveBooksAsync(source, archive).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPublishersRequest actualRequest = (ListPublishersRequest)actualRequests.get(0); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); - Assert.assertEquals(destination, ShelfName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedAdditionalDestinations, actualRequest.getAdditionalDestinationsList()); + Assert.assertEquals(source, ShelfName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16267,19 +17050,126 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listPublishersExceptionTest6() throws Exception { + public void longRunningArchiveBooksExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedAdditionalDestinations = new ArrayList<>(); + ShelfName source = ShelfName.of("[SHELF_ID]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - client.listPublishers(parent, destination, formattedAdditionalDestinations); + client.longRunningArchiveBooksAsync(source, archive).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + + @Test + @SuppressWarnings("all") + public void longRunningArchiveBooksTest3() throws Exception { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningArchiveBooksTest3") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); + + ProjectName source = ProjectName.of("[PROJECT]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + ArchiveBooksResponse actualResponse = + client.longRunningArchiveBooksAsync(source, archive).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, ProjectName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void longRunningArchiveBooksExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ProjectName source = ProjectName.of("[PROJECT]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + client.longRunningArchiveBooksAsync(source, archive).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + + @Test + @SuppressWarnings("all") + public void streamingArchiveBooksTest() throws Exception { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingArchiveBooksCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void streamingArchiveBooksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingArchiveBooksCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @@ -16715,21 +17605,6 @@ public class MockLibraryServiceImpl extends LibraryServiceImplBase { } } - @Override - public void listPublishers(ListPublishersRequest request, - StreamObserver responseObserver) { - Object response = responses.remove(); - if (response instanceof ListPublishersResponse) { - requests.add(request); - responseObserver.onNext((ListPublishersResponse) response); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); - } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); - } - } - @Override public void getBook(GetBookRequest request, StreamObserver responseObserver) { @@ -17060,6 +17935,81 @@ public class MockLibraryServiceImpl extends LibraryServiceImplBase { } } + @Override + public void moveBooks(MoveBooksRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof MoveBooksResponse) { + requests.add(request); + responseObserver.onNext((MoveBooksResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void archiveBooks(ArchiveBooksRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ArchiveBooksResponse) { + requests.add(request); + responseObserver.onNext((ArchiveBooksResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void longRunningArchiveBooks(ArchiveBooksRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public StreamObserver streamingArchiveBooks( + final StreamObserver responseObserver) { + final Object response = responses.remove(); + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(ArchiveBooksRequest value) { + if (response instanceof ArchiveBooksResponse) { + responseObserver.onNext((ArchiveBooksResponse) response); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + @Override public void testOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest request, StreamObserver responseObserver) { diff --git a/src/test/java/com/google/api/codegen/testsrc/common/library.proto b/src/test/java/com/google/api/codegen/testsrc/common/library.proto index c935e2964b..772f3bb819 100644 --- a/src/test/java/com/google/api/codegen/testsrc/common/library.proto +++ b/src/test/java/com/google/api/codegen/testsrc/common/library.proto @@ -27,6 +27,11 @@ option java_outer_classname = "LibraryProto"; option java_package = "com.google.example.library.v1"; option go_package = "google.golang.org/genproto/googleapis/example/library/v1;library"; +option (google.api.resource_definition) = { + type: "library.googleapis.com/Publisher", + pattern: "projects/{project}/locations/{location}/publishers/{publisher}" +}; + option (google.api.resource_definition) = { type: "library.googleapis.com/Archive", pattern: "archives/{archive}" @@ -114,10 +119,6 @@ service LibraryService { option (google.api.method_signature) = "shelf,books,edition,series_uuid,publisher"; } - rpc ListPublishers(ListPublishersRequest) returns (ListPublishersResponse) { - option (google.api.method_signature) = "parent,destination,additional_destinations"; - } - // Gets a book. rpc GetBook(GetBookRequest) returns (Book) { option (google.api.http) = { get: "/v1/{name=bookShelves/*/books/*}" }; @@ -259,6 +260,29 @@ service LibraryService { }; } + rpc MoveBooks(MoveBooksRequest) returns (MoveBooksResponse) { + option (google.api.http) = {post: "/v1/{source=**}:move" body: "*"}; + option (google.api.method_signature) = "source,destination,publishers,project"; + } + + rpc ArchiveBooks(ArchiveBooksRequest) returns (ArchiveBooksResponse) { + option (google.api.http) = {post: "/v1/{source=**}:archive" body: "*"}; + option (google.api.method_signature) = "source,archive"; + } + + rpc LongRunningArchiveBooks(ArchiveBooksRequest) returns (google.longrunning.Operation) { + option (google.api.http) = {post: "/v1/{source=**}:longrunningmove" body: "*"}; + option (google.api.method_signature) = "source,archive"; + option (google.longrunning.operation_info) = { + response_type: "ArchiveBooksResponse", + metadata_type: "ArchiveBooksMetadata" + }; + } + + rpc StreamingArchiveBooks(stream ArchiveBooksRequest) returns (stream ArchiveBooksResponse) { + option (google.api.method_signature) = "source,archive"; + } + // Test optional flattening parameters of all types rpc TestOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest) returns (TestOptionalRequiredFlatteningParamsResponse) { option (google.api.http) = { post: "/v1/testofp" body: "*" }; @@ -717,7 +741,7 @@ message ListBooksRequest { // The name of the shelf whose books we'd like to list. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; + (google.api.resource_reference).type = "library.googleapis.com/Shelf"]; // Requested page size. Server may return fewer books than requested. // If unspecified, server will pick an appropriate default. @@ -922,7 +946,7 @@ message DiscussBookRequest { message FindRelatedBooksRequest { repeated string names = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; + (google.api.resource_reference).type = "library.googleapis.com/Book"]; repeated string shelves = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "library.googleapis.com/Shelf"]; @@ -1109,38 +1133,44 @@ message TestOptionalRequiredFlatteningParamsRequest { message TestOptionalRequiredFlatteningParamsResponse { } -message Publisher { - - option (google.api.resource) = { - type: "library.googleapis.com/Publisher", - pattern: "projects/{project}/locations/{location}/publishers/{publisher}", - pattern: "projects/{project}/publishers/{publisher}" - }; - - string name = 1; -} - -message ListPublishersRequest { +message MoveBooksRequest { - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).child_type = "library.googleapis.com/Publisher"]; + string source = 1 [ + (google.api.resource_reference).child_type = "library.googleapis.com/Book" + ]; string destination = 2 [ - (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; + (google.api.resource_reference).child_type = "library.googleapis.com/Book" + ]; - repeated string additional_destinations = 3 [ - (google.api.resource_reference).child_type = "library.googleapis.com/Book"]; + repeated string publishers = 3 [ + (google.api.resource_reference).type = "library.googleapis.com/Publisher" + ]; - int32 page_size = 4; + string project = 4 [ + (google.api.resource_reference).type = "cloudresourcemanager.googleapis.com/Project" + ]; +} - string page_token = 5; +message MoveBooksResponse { + bool success = 1; } -message ListPublishersResponse { +message ArchiveBooksRequest { - repeated Publisher publishers = 1; + string source = 1 [ + (google.api.resource_reference).child_type = "library.googleapis.com/Book" + ]; - string next_page_token = 2; + string archive = 2 [ + (google.api.resource_reference).type = "library.googleapis.com/Archive" + ]; +} + +message ArchiveBooksResponse { + bool success = 1; +} +message ArchiveBooksMetadata { + double percentage = 1; } \ No newline at end of file From 78983eba048423b772fb31e1956a361a083d3e61 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 23 Jan 2020 16:51:20 -0800 Subject: [PATCH 09/36] wip --- .../api/codegen/config/FlatteningConfig.java | 9 +- .../testdata/java_library.baseline | 2494 ++++++++++++++--- .../testsrc/common/library_v2_gapic.yaml | 2 +- 3 files changed, 2116 insertions(+), 389 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index f56811e07d..7291d344be 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -280,7 +280,7 @@ private static List createFlatteningsFromProtoFile( } // We also generate an overload that all resource names are treated as strings - if (hasBothSingularAndRepeatedResourceNameParameters(flatteningConfigs)) { + if (hasSingularResourceNameParameters(flatteningConfigs)) { flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0))); } @@ -448,11 +448,8 @@ private static boolean hasAnyRepeatedResourceNameParameter( .anyMatch(f -> f.getField().isRepeated() && f.useResourceNameType()); } - private static boolean hasBothSingularAndRepeatedResourceNameParameters( + private static boolean hasSingularResourceNameParameters( List> flatteningGroups) { - return flatteningGroups - .stream() - .anyMatch( - f -> (hasSingularResourceNameParameter(f) && hasAnyRepeatedResourceNameParameter(f))); + return flatteningGroups.stream().anyMatch(FlatteningConfig::hasSingularResourceNameParameter); } } diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 82852caa86..21d15cb12c 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -209,10 +209,10 @@ public class Babbage { package com.google.example.examples.library.v1; import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWithResponseHandling { // [START sample] @@ -220,10 +220,10 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.ApiStreamObserver; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ /** Test response handling for methods that return empty */ @@ -250,7 +250,7 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith ApiStreamObserver requestObserver = libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -290,10 +290,10 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith package com.google.example.examples.library.v1; import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWithoutResponseHandling { // [START sample] @@ -301,10 +301,10 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.ApiStreamObserver; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ /** Test default response handling is turned off for methods that return empty */ @@ -328,7 +328,7 @@ public class BabbleAboutBookCallableCallableStreamingClientEmptyResponseTypeWith ApiStreamObserver requestObserver = libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -509,7 +509,7 @@ public class DeleteShelfFlattenedEmptyResponseTypeWithResponseHandling { public static void sampleDeleteShelf() { try (LibraryClient libraryClient = LibraryClient.create()) { ShelfName name = ShelfName.of("[SHELF_ID]"); - libraryClient.deleteShelf(name); + libraryClient.deleteShelf(name.toString()); // Shelf deleted System.out.println("Shelf deleted."); } catch (Exception exception) { @@ -562,7 +562,7 @@ public class DeleteShelfFlattenedEmptyResponseTypeWithoutResponseHandling { public static void sampleDeleteShelf() { try (LibraryClient libraryClient = LibraryClient.create()) { ShelfName name = ShelfName.of("[SHELF_ID]"); - libraryClient.deleteShelf(name); + libraryClient.deleteShelf(name.toString()); } catch (Exception exception) { System.err.println("Failed to create the client due to: " + exception); } @@ -711,11 +711,11 @@ public class DeleteShelfRequestEmptyResponseTypeWithoutResponseHandling { package com.google.example.examples.library.v1; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -725,11 +725,11 @@ public class FindRelatedBooksCallableCallableListOdyssey { /* * Please include the following imports to run this sample. * - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -738,7 +738,7 @@ public class FindRelatedBooksCallableCallableListOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName namesElement = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); @@ -863,11 +863,11 @@ public class FindRelatedBooksFlattenedPagedOdyssey { package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -878,11 +878,11 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -891,7 +891,7 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName namesElement = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); @@ -941,10 +941,10 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { package com.google.example.examples.library.v1; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.example.library.v1.ShelfName; import java.util.Arrays; import java.util.List; @@ -954,10 +954,10 @@ public class FindRelatedBooksRequestPagedOdyssey { /* * Please include the following imports to run this sample. * - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.example.library.v1.ShelfName; * import java.util.Arrays; * import java.util.List; @@ -966,7 +966,7 @@ public class FindRelatedBooksRequestPagedOdyssey { /** Testing calling forms */ public static void sampleFindRelatedBooks() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName namesElement = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); List names = Arrays.asList(namesElement); ShelfName shelvesElement = ShelfName.of("[SHELF_ID]"); List shelves = Arrays.asList(shelvesElement); @@ -1018,10 +1018,10 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -1032,10 +1032,10 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -1049,8 +1049,8 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigBookAsync(name); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); + OperationFuture future = libraryClient.getBigBookAsync(name.toString()); System.out.println("Waiting for operation to complete..."); Book response = future.get(); @@ -1124,10 +1124,10 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class GetBigBookAsyncLongRunningFlattenedAsyncWap2 { // [START hopper] @@ -1136,10 +1136,10 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap2 { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBigBook() { @@ -1158,8 +1158,8 @@ public class GetBigBookAsyncLongRunningFlattenedAsyncWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigBookAsync(name); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); + OperationFuture future = libraryClient.getBigBookAsync(name.toString()); System.out.println("Waiting for operation to complete..."); Book response = future.get(); @@ -1222,11 +1222,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -1237,11 +1237,11 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -1255,7 +1255,7 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1333,11 +1333,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class GetBigBookAsyncLongRunningRequestAsyncWap2 { // [START hopper] @@ -1346,11 +1346,11 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap2 { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBigBook() { @@ -1369,7 +1369,7 @@ public class GetBigBookAsyncLongRunningRequestAsyncWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1435,10 +1435,10 @@ import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; import com.google.protobuf.ListValue; import java.util.Map; @@ -1449,10 +1449,10 @@ public class GetBigBookCallableCallableWap { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; * import com.google.protobuf.ListValue; * import java.util.Map; @@ -1467,7 +1467,7 @@ public class GetBigBookCallableCallableWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1545,10 +1545,10 @@ import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; public class GetBigBookCallableCallableWap2 { @@ -1557,10 +1557,10 @@ public class GetBigBookCallableCallableWap2 { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; */ @@ -1580,7 +1580,7 @@ public class GetBigBookCallableCallableWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1648,11 +1648,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -1663,11 +1663,11 @@ public class GetBigBookOperationCallableLongRunningCallableWap { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -1681,7 +1681,7 @@ public class GetBigBookOperationCallableLongRunningCallableWap { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1760,11 +1760,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class GetBigBookOperationCallableLongRunningCallableWap2 { // [START hopper] @@ -1773,11 +1773,11 @@ public class GetBigBookOperationCallableLongRunningCallableWap2 { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBigBook() { @@ -1796,7 +1796,7 @@ public class GetBigBookOperationCallableLongRunningCallableWap2 { */ public static void sampleGetBigBook(String shelf, String bigBookName) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -1859,10 +1859,10 @@ public class GetBigBookOperationCallableLongRunningCallableWap2 { package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithResponseHandling { @@ -1871,18 +1871,18 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithRes * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigNothingAsync(name); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + OperationFuture future = libraryClient.getBigNothingAsync(name.toString()); System.out.println("Waiting for operation to complete..."); future.get(); @@ -1923,10 +1923,10 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithRes package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithoutResponseHandling { @@ -1935,18 +1935,18 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithout * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - OperationFuture future = libraryClient.getBigNothingAsync(name); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + OperationFuture future = libraryClient.getBigNothingAsync(name.toString()); System.out.println("Waiting for operation to complete..."); future.get(); @@ -1985,11 +1985,11 @@ public class GetBigNothingAsyncLongRunningFlattenedAsyncEmptyResponseTypeWithout package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithResponseHandling { @@ -1998,18 +1998,18 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithRespo * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2054,11 +2054,11 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithRespo package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithoutResponseHandling { @@ -2067,18 +2067,18 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithoutRe * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2121,10 +2121,10 @@ public class GetBigNothingAsyncLongRunningRequestAsyncEmptyResponseTypeWithoutRe package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; public class GetBigNothingCallableCallableEmptyResponseTypeWithResponseHandling { @@ -2133,17 +2133,17 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithResponseHandling * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2189,10 +2189,10 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithResponseHandling package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.longrunning.Operation; public class GetBigNothingCallableCallableEmptyResponseTypeWithoutResponseHandling { @@ -2201,17 +2201,17 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithoutResponseHandli * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.longrunning.Operation; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2255,11 +2255,11 @@ public class GetBigNothingCallableCallableEmptyResponseTypeWithoutResponseHandli package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeWithResponseHandling { @@ -2268,18 +2268,18 @@ public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeW * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test response handling for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2325,11 +2325,11 @@ public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeW package com.google.example.examples.library.v1; import com.google.api.gax.longrunning.OperationFuture; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.Empty; public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeWithoutResponseHandling { @@ -2338,18 +2338,18 @@ public class GetBigNothingOperationCallableLongRunningCallableEmptyResponseTypeW * Please include the following imports to run this sample. * * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.Empty; */ /** Test default response handling is turned off for methods that return empty */ public static void sampleGetBigNothing() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2396,10 +2396,10 @@ package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class GetBookCallableCallableTestOnSuccessMap { // [START sample] @@ -2408,15 +2408,15 @@ public class GetBookCallableCallableTestOnSuccessMap { * * import com.google.api.core.ApiFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBook() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2466,9 +2466,9 @@ public class GetBookCallableCallableTestOnSuccessMap { package com.google.example.examples.library.v1; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class GetBookFlattenedTestOnSuccessMap { // [START sample] @@ -2476,15 +2476,15 @@ public class GetBookFlattenedTestOnSuccessMap { * Please include the following imports to run this sample. * * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBook() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - Book response = libraryClient.getBook(name); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + Book response = libraryClient.getBook(name.toString()); String intKeyVal = response.getMapStringValueMap().get(123); String booleanKeyVal = response.getMapBoolKeyMap().get(true); int mapValueField = response.getMapMessageValueMap().get("key").getField(); @@ -2526,10 +2526,10 @@ public class GetBookFlattenedTestOnSuccessMap { package com.google.example.examples.library.v1; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class GetBookRequestTestOnSuccessMap { // [START sample] @@ -2537,15 +2537,15 @@ public class GetBookRequestTestOnSuccessMap { * Please include the following imports to run this sample. * * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBook() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2590,11 +2590,11 @@ public class GetBookRequestTestOnSuccessMap { package com.google.example.examples.library.v1; import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.Comment; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class MonologAboutBookCallableCallableStreamingClientProg { // [START sample] @@ -2602,11 +2602,11 @@ public class MonologAboutBookCallableCallableStreamingClientProg { * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.ApiStreamObserver; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.Comment; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ /** Testing calling forms */ @@ -2632,7 +2632,7 @@ public class MonologAboutBookCallableCallableStreamingClientProg { ApiStreamObserver requestObserver = libraryClient.monologAboutBookCallable().clientStreamingCall(responseObserver); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -2939,7 +2939,7 @@ public class PublishSeriesFlattenedPiVersion { .setSeriesString(seriesString) .build(); PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher); + PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher.toString()); // % % % output handling % % % % // fourScoreAndSevenYears ago // @@ -3045,7 +3045,7 @@ public class PublishSeriesFlattenedSecondEdition { int edition = 2; SeriesUuid seriesUuid = SeriesUuid.newBuilder().build(); PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher); + PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher.toString()); System.out.println(response); } catch (Exception exception) { System.err.println("Failed to create the client due to: " + exception); @@ -3660,9 +3660,9 @@ import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; @@ -3693,9 +3693,9 @@ public class TestFloatAndInt64 { /* * Please include the following imports to run this sample. * - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; * import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest.InnerMessage; * import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsResponse; @@ -3738,8 +3738,8 @@ public class TestFloatAndInt64 { String requiredSingularString = ""; ByteString requiredSingularBytes = ByteString.copyFromUtf8(""); TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String requiredSingularResourceNameCommon = ""; int requiredSingularFixed32 = 0; long requiredSingularFixed64 = 0L; @@ -3913,10 +3913,10 @@ public class TestFloatAndInt64 { package com.google.example.examples.library.v1; import com.google.example.library.v1.BookFromAnywhere; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class TestResourceNameOneof { // [START test_resource_name_oneof] @@ -3924,15 +3924,15 @@ public class TestResourceNameOneof { * Please include the following imports to run this sample. * * import com.google.example.library.v1.BookFromAnywhere; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBookFromAbsolutelyAnywhere() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder() .setName(name.toString()) .build(); @@ -3972,10 +3972,10 @@ public class TestResourceNameOneof { package com.google.example.examples.library.v1; import com.google.example.library.v1.BookFromAnywhere; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; public class TestResourceNameOneof2 { // [START test_resource_name_oneof_2] @@ -3983,15 +3983,15 @@ public class TestResourceNameOneof2 { * Please include the following imports to run this sample. * * import com.google.example.library.v1.BookFromAnywhere; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBookFromAbsolutelyAnywhereRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; */ public static void sampleGetBookFromAbsolutelyAnywhere() { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("The Shelf to search for the book", "[BOOK]"); GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder() .setName(name.toString()) .build(); @@ -4106,11 +4106,11 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.longrunning.OperationFuture; import com.google.example.library.v1.Book; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.GetBigBookMetadata; import com.google.example.library.v1.GetBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ListValue; import java.util.Map; @@ -4121,11 +4121,11 @@ public class ThisTagShouldBeTheNameOfTheFile { * * import com.google.api.gax.longrunning.OperationFuture; * import com.google.example.library.v1.Book; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.GetBigBookMetadata; * import com.google.example.library.v1.GetBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ListValue; * import java.util.Map; */ @@ -4139,7 +4139,7 @@ public class ThisTagShouldBeTheNameOfTheFile { /** Testing calling forms */ public static void sampleGetBigBook(String shelf) { try (LibraryClient libraryClient = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of(shelf, "[BOOK]"); GetBookRequest request = GetBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -4216,11 +4216,11 @@ import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import com.google.api.gax.rpc.BidiStream; -import com.google.example.library.v1.BookFromArchiveName; import com.google.example.library.v1.BookName; import com.google.example.library.v1.Comment; import com.google.example.library.v1.DiscussBookRequest; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import com.google.protobuf.ByteString; import java.nio.file.Files; import java.nio.file.Path; @@ -4232,11 +4232,11 @@ public class TuringProgCallableStreamingBidi { * Please include the following imports to run this sample. * * import com.google.api.gax.rpc.BidiStream; - * import com.google.example.library.v1.BookFromArchiveName; * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.Comment; * import com.google.example.library.v1.DiscussBookRequest; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import com.google.protobuf.ByteString; * import java.nio.file.Files; * import java.nio.file.Path; @@ -4256,7 +4256,7 @@ public class TuringProgCallableStreamingBidi { BidiStream bidiStream = libraryClient.discussBookCallable().call(); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); Path path = Paths.get("comment_file"); byte[] data = Files.readAllBytes(path); ByteString comment = ByteString.copyFrom(data); @@ -4477,7 +4477,7 @@ public class LibraryClient implements BackgroundResource { PathTemplate.createWithoutUrlEncoding("archives/{archive}/books/{book}"); private static final PathTemplate SHELF_BOOK_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("bookShelves/{book_shelf}/books/{book}"); + PathTemplate.createWithoutUrlEncoding("shelves/{shelf_id}/books/{book}"); private static final PathTemplate BOOK_FROM_ARCHIVE_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("archives/{archive}/books/{book}"); @@ -4532,9 +4532,9 @@ public class LibraryClient implements BackgroundResource { * @deprecated Use the {@link ShelfBookName} class instead. */ @Deprecated - public static final String formatShelfBookName(String bookShelf, String book) { + public static final String formatShelfBookName(String shelfId, String book) { return SHELF_BOOK_PATH_TEMPLATE.instantiate( - "book_shelf", bookShelf, + "shelf_id", shelfId, "book", book); } @@ -4661,14 +4661,14 @@ public class LibraryClient implements BackgroundResource { } /** - * Parses the book_shelf from the given fully-qualified path which + * Parses the shelf_id from the given fully-qualified path which * represents a shelf_book resource. * * @deprecated Use the {@link ShelfBookName} class instead. */ @Deprecated - public static final String parseBookShelfFromShelfBookName(String shelfBookName) { - return SHELF_BOOK_PATH_TEMPLATE.parse(shelfBookName).get("book_shelf"); + public static final String parseShelfIdFromShelfBookName(String shelfBookName) { + return SHELF_BOOK_PATH_TEMPLATE.parse(shelfBookName).get("shelf_id"); } /** @@ -4967,6 +4967,29 @@ public class LibraryClient implements BackgroundResource { return getShelf(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a shelf. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   Shelf response = libraryClient.getShelf(name.toString());
+   * }
+   * 
+ * + * @param name The name of the shelf to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Shelf getShelf(String name) { + GetShelfRequest request = + GetShelfRequest.newBuilder() + .setName(name) + .build(); + return getShelf(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets a shelf. @@ -4993,6 +5016,32 @@ public class LibraryClient implements BackgroundResource { return getShelf(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a shelf. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   SomeMessage message = SomeMessage.newBuilder().build();
+   *   Shelf response = libraryClient.getShelf(name.toString(), message);
+   * }
+   * 
+ * + * @param name The name of the shelf to retrieve. + * @param message Field to verify that message-type query parameter gets flattened. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Shelf getShelf(String name, SomeMessage message) { + GetShelfRequest request = + GetShelfRequest.newBuilder() + .setName(name) + .setMessage(message) + .build(); + return getShelf(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets a shelf. @@ -5022,6 +5071,35 @@ public class LibraryClient implements BackgroundResource { return getShelf(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a shelf. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   SomeMessage message = SomeMessage.newBuilder().build();
+   *   com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build();
+   *   Shelf response = libraryClient.getShelf(name.toString(), message, stringBuilder);
+   * }
+   * 
+ * + * @param name The name of the shelf to retrieve. + * @param message Field to verify that message-type query parameter gets flattened. + * @param stringBuilder + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Shelf getShelf(String name, SomeMessage message, com.google.example.library.v1.StringBuilder stringBuilder) { + GetShelfRequest request = + GetShelfRequest.newBuilder() + .setName(name) + .setMessage(message) + .setStringBuilder(stringBuilder) + .build(); + return getShelf(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets a shelf. @@ -5161,6 +5239,29 @@ public class LibraryClient implements BackgroundResource { deleteShelf(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a shelf. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   libraryClient.deleteShelf(name.toString());
+   * }
+   * 
+ * + * @param name The name of the shelf to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteShelf(String name) { + DeleteShelfRequest request = + DeleteShelfRequest.newBuilder() + .setName(name) + .build(); + deleteShelf(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes a shelf. @@ -5232,6 +5333,34 @@ public class LibraryClient implements BackgroundResource { return mergeShelves(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Merges two shelves by adding all books from the shelf named + * `other_shelf_name` to shelf `name`, and deletes + * `other_shelf_name`. Returns the updated shelf. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   Shelf response = libraryClient.mergeShelves(name.toString(), otherShelfName.toString());
+   * }
+   * 
+ * + * @param name The name of the shelf we're adding books to. + * @param otherShelfName The name of the shelf we're removing books from and deleting. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Shelf mergeShelves(String name, String otherShelfName) { + MergeShelvesRequest request = + MergeShelvesRequest.newBuilder() + .setName(name) + .setOtherShelfName(otherShelfName) + .build(); + return mergeShelves(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Merges two shelves by adding all books from the shelf named @@ -5309,6 +5438,32 @@ public class LibraryClient implements BackgroundResource { return createBook(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   Book book = Book.newBuilder().build();
+   *   Book response = libraryClient.createBook(name.toString(), book);
+   * }
+   * 
+ * + * @param name The name of the shelf in which the book is created. + * @param book The book to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book createBook(String name, Book book) { + CreateBookRequest request = + CreateBookRequest.newBuilder() + .setName(name) + .setBook(book) + .build(); + return createBook(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a book. @@ -5394,6 +5549,44 @@ public class LibraryClient implements BackgroundResource { return publishSeries(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a series of books. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   Shelf shelf = Shelf.newBuilder().build();
+   *   List<Book> books = new ArrayList<>();
+   *   int edition = 0;
+   *   String seriesString = "foobar";
+   *   SeriesUuid seriesUuid = SeriesUuid.newBuilder()
+   *     .setSeriesString(seriesString)
+   *     .build();
+   *   PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]");
+   *   PublishSeriesResponse response = libraryClient.publishSeries(shelf, books, edition, seriesUuid, publisher.toString());
+   * }
+   * 
+ * + * @param shelf The shelf in which the series is created. + * @param books The books to publish in the series. + * @param edition The edition of the series + * @param seriesUuid Uniquely identifies the series to the publishing house. + * @param publisher The publisher of the series. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PublishSeriesResponse publishSeries(Shelf shelf, List books, int edition, SeriesUuid seriesUuid, String publisher) { + PublishSeriesRequest request = + PublishSeriesRequest.newBuilder() + .setShelf(shelf) + .addAllBooks(books) + .setEdition(edition) + .setSeriesUuid(seriesUuid) + .setPublisher(publisher) + .build(); + return publishSeries(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a series of books. @@ -5458,7 +5651,7 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   Book response = libraryClient.getBook(name);
    * }
    * 
@@ -5481,7 +5674,30 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   Book response = libraryClient.getBook(name.toString());
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book getBook(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) + .build(); + return getBook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -5503,7 +5719,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -5636,7 +5852,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   libraryClient.deleteBook(name);
    * }
    * 
@@ -5659,7 +5875,30 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   libraryClient.deleteBook(name.toString());
+   * }
+   * 
+ * + * @param name The name of the book to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBook(String name) { + DeleteBookRequest request = + DeleteBookRequest.newBuilder() + .setName(name) + .build(); + deleteBook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -5681,7 +5920,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   DeleteBookRequest request = DeleteBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -5702,7 +5941,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   Book book = Book.newBuilder().build();
    *   Book response = libraryClient.updateBook(name, book);
    * }
@@ -5728,7 +5967,33 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   Book book = Book.newBuilder().build();
+   *   Book response = libraryClient.updateBook(name.toString(), book);
+   * }
+   * 
+ * + * @param name The name of the book to update. + * @param book The book to update with. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book updateBook(String name, Book book) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setName(name) + .setBook(book) + .build(); + return updateBook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String optionalFoo = "";
    *   Book book = Book.newBuilder().build();
    *   FieldMask updateMask = FieldMask.newBuilder().build();
@@ -5763,20 +6028,55 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   String optionalFoo = "";
    *   Book book = Book.newBuilder().build();
-   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setBook(book)
-   *     .build();
-   *   Book response = libraryClient.updateBook(request);
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build();
+   *   Book response = libraryClient.updateBook(name.toString(), optionalFoo, book, updateMask, physicalMask);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name The name of the book to update. + * @param optionalFoo An optional foo. + * @param book The book to update with. + * @param updateMask A field mask to apply, rendered as an HTTP parameter. + * @param physicalMask To test Python import clash resolution. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Book updateBook(UpdateBookRequest request) { + public final Book updateBook(String name, String optionalFoo, Book book, FieldMask updateMask, com.google.example.library.v1.FieldMask physicalMask) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setName(name) + .setOptionalFoo(optionalFoo) + .setBook(book) + .setUpdateMask(updateMask) + .setPhysicalMask(physicalMask) + .build(); + return updateBook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   Book book = Book.newBuilder().build();
+   *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setBook(book)
+   *     .build();
+   *   Book response = libraryClient.updateBook(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book updateBook(UpdateBookRequest request) { return updateBookCallable().call(request); } @@ -5787,7 +6087,7 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   Book book = Book.newBuilder().build();
    *   UpdateBookRequest request = UpdateBookRequest.newBuilder()
    *     .setName(name.toString())
@@ -5810,7 +6110,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
    *   Book response = libraryClient.moveBook(name, otherShelfName);
    * }
@@ -5836,7 +6136,33 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
+   *   Book response = libraryClient.moveBook(name.toString(), otherShelfName.toString());
+   * }
+   * 
+ * + * @param name The name of the book to move. + * @param otherShelfName The name of the destination shelf. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book moveBook(String name, String otherShelfName) { + MoveBookRequest request = + MoveBookRequest.newBuilder() + .setName(name) + .setOtherShelfName(otherShelfName) + .build(); + return moveBook(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Moves a book to another shelf, and returns the new book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
    *   MoveBookRequest request = MoveBookRequest.newBuilder()
    *     .setName(name.toString())
@@ -5860,7 +6186,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
    *   MoveBookRequest request = MoveBookRequest.newBuilder()
    *     .setName(name.toString())
@@ -5977,7 +6303,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   ByteString comment = ByteString.copyFromUtf8("");
    *   Comment.Stage stage = Comment.Stage.UNSET;
    *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
@@ -6011,7 +6337,41 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   ByteString comment = ByteString.copyFromUtf8("");
+   *   Comment.Stage stage = Comment.Stage.UNSET;
+   *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
+   *   Comment commentsElement = Comment.newBuilder()
+   *     .setComment(comment)
+   *     .setStage(stage)
+   *     .setAlignment(alignment)
+   *     .build();
+   *   List<Comment> comments = Arrays.asList(commentsElement);
+   *   libraryClient.addComments(name.toString(), comments);
+   * }
+   * 
+ * + * @param name + * @param comments + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void addComments(String name, List comments) { + AddCommentsRequest request = + AddCommentsRequest.newBuilder() + .setName(name) + .addAllComments(comments) + .build(); + addComments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds comments to a book + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   ByteString comment = ByteString.copyFromUtf8("");
    *   Comment.Stage stage = Comment.Stage.UNSET;
    *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
@@ -6043,7 +6403,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   ByteString comment = ByteString.copyFromUtf8("");
    *   Comment.Stage stage = Comment.Stage.UNSET;
    *   SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR;
@@ -6093,6 +6453,32 @@ public class LibraryClient implements BackgroundResource {
     return getBookFromArchive(request);
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Gets a book from an archive.
+   *
+   * Sample code:
+   * 

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   BookFromArchive response = libraryClient.getBookFromArchive(name.toString(), parent.toString());
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @param parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromArchive getBookFromArchive(String name, String parent) { + GetBookFromArchiveRequest request = + GetBookFromArchiveRequest.newBuilder() + .setName(name) + .setParent(parent) + .build(); + return getBookFromArchive(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Gets a book from an archive. @@ -6147,8 +6533,8 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
    *   FolderName folder = FolderName.of("[FOLDER]");
    *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(name, altBookName, place, folder);
@@ -6180,8 +6566,41 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   FolderName folder = FolderName.of("[FOLDER]");
+   *   BookFromAnywhere response = libraryClient.getBookFromAnywhere(name.toString(), altBookName.toString(), place.toString(), folder.toString());
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @param altBookName An alternate book name, used to test restricting flattened field to a + * single resource name type in a oneof. + * @param place + * @param folder + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAnywhere(String name, String altBookName, String place, String folder) { + GetBookFromAnywhereRequest request = + GetBookFromAnywhereRequest.newBuilder() + .setName(name) + .setAltBookName(altBookName) + .setPlace(place) + .setFolder(folder) + .build(); + return getBookFromAnywhere(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a book from a shelf or archive. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
    *   FolderName folder = FolderName.of("[FOLDER]");
    *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
@@ -6208,8 +6627,8 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   LocationName place = LocationName.of("[PROJECT]", "[LOCATION]");
    *   FolderName folder = FolderName.of("[FOLDER]");
    *   GetBookFromAnywhereRequest request = GetBookFromAnywhereRequest.newBuilder()
@@ -6235,7 +6654,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name);
    * }
    * 
@@ -6258,7 +6677,30 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookFromAnywhere response = libraryClient.getBookFromAbsolutelyAnywhere(name.toString());
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BookFromAnywhere getBookFromAbsolutelyAnywhere(String name) { + GetBookFromAbsolutelyAnywhereRequest request = + GetBookFromAbsolutelyAnywhereRequest.newBuilder() + .setName(name) + .build(); + return getBookFromAbsolutelyAnywhere(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test proper OneOf-Any resource name mapping + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6280,7 +6722,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookFromAbsolutelyAnywhereRequest request = GetBookFromAbsolutelyAnywhereRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6301,7 +6743,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String indexName = "default index";
    *   String indexMapItem = "";
    *   Map<String, String> indexMap = new HashMap<>();
@@ -6332,7 +6774,38 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   String indexName = "default index";
+   *   String indexMapItem = "";
+   *   Map<String, String> indexMap = new HashMap<>();
+   *   indexMap.put("default_key", indexMapItem);
+   *   libraryClient.updateBookIndex(name.toString(), indexName, indexMap);
+   * }
+   * 
+ * + * @param name The name of the book to update. + * @param indexName The name of the index for the book + * @param indexMap The index to update the book with + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void updateBookIndex(String name, String indexName, Map indexMap) { + UpdateBookIndexRequest request = + UpdateBookIndexRequest.newBuilder() + .setName(name) + .setIndexName(indexName) + .putAllIndexMap(indexMap) + .build(); + updateBookIndex(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the index of a book. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String indexName = "default index";
    *   String indexMapItem = "";
    *   Map<String, String> indexMap = new HashMap<>();
@@ -6360,7 +6833,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String indexName = "default index";
    *   String indexMapItem = "";
    *   Map<String, String> indexMap = new HashMap<>();
@@ -6438,7 +6911,7 @@ public class LibraryClient implements BackgroundResource {
    *   BidiStream<DiscussBookRequest, Comment> bidiStream =
    *       libraryClient.discussBookCallable().call();
    *
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6480,7 +6953,7 @@ public class LibraryClient implements BackgroundResource {
    *   ApiStreamObserver<DiscussBookRequest> requestObserver =
    *       libraryClient.monologAboutBookCallable().clientStreamingCall(responseObserver);
    *
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6520,7 +6993,7 @@ public class LibraryClient implements BackgroundResource {
    *   ApiStreamObserver<DiscussBookRequest> requestObserver =
    *       libraryClient.babbleAboutBookCallable().clientStreamingCall(responseObserver);
    *
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   DiscussBookRequest request = DiscussBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6568,7 +7041,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName namesElement = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   List<BookName> names = Arrays.asList(namesElement);
    *   List<ShelfName> shelves = new ArrayList<>();
    *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
@@ -6596,7 +7069,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName namesElement = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   List<BookName> names = Arrays.asList(namesElement);
    *   List<ShelfName> shelves = new ArrayList<>();
    *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
@@ -6622,7 +7095,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName namesElement = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName namesElement = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   List<BookName> names = Arrays.asList(namesElement);
    *   List<ShelfName> shelves = new ArrayList<>();
    *   FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder()
@@ -6655,7 +7128,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName resource = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String label = "";
    *   AddLabelRequest request = AddLabelRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -6680,7 +7153,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName resource = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName resource = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String label = "";
    *   AddLabelRequest request = AddLabelRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -6704,7 +7177,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   Book response = libraryClient.getBigBookAsync(name).get();
    * }
    * 
@@ -6728,7 +7201,31 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   Book response = libraryClient.getBigBookAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigBookAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) + .build(); + return getBigBookAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test long-running operations + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6751,7 +7248,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6773,7 +7270,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6794,7 +7291,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   libraryClient.getBigNothingAsync(name).get();
    * }
    * 
@@ -6818,7 +7315,31 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   libraryClient.getBigNothingAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name The name of the book to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture getBigNothingAsync(String name) { + GetBookRequest request = + GetBookRequest.newBuilder() + .setName(name) + .build(); + return getBigNothingAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test long-running operations with empty return type. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6841,7 +7362,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6863,7 +7384,7 @@ public class LibraryClient implements BackgroundResource {
    * Sample code:
    * 

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   GetBookRequest request = GetBookRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -6893,8 +7414,8 @@ public class LibraryClient implements BackgroundResource {
    *   String requiredSingularString = "";
    *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
    *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String requiredSingularResourceNameCommon = "";
    *   int requiredSingularFixed32 = 0;
    *   long requiredSingularFixed64 = 0L;
@@ -6954,8 +7475,8 @@ public class LibraryClient implements BackgroundResource {
    *   String optionalSingularString = "";
    *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
    *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String optionalSingularResourceNameCommon = "";
    *   int optionalSingularFixed32 = 0;
    *   long optionalSingularFixed64 = 0L;
@@ -7279,8 +7800,8 @@ public class LibraryClient implements BackgroundResource {
    *   String requiredSingularString = "";
    *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
    *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String requiredSingularResourceNameCommon = "";
    *   int requiredSingularFixed32 = 0;
    *   long requiredSingularFixed64 = 0L;
@@ -7340,8 +7861,8 @@ public class LibraryClient implements BackgroundResource {
    *   String optionalSingularString = "";
    *   ByteString optionalSingularBytes = ByteString.copyFromUtf8("");
    *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String optionalSingularResourceNameCommon = "";
    *   int optionalSingularFixed32 = 0;
    *   long optionalSingularFixed64 = 0L;
@@ -7665,8 +8186,8 @@ public class LibraryClient implements BackgroundResource {
    *   String requiredSingularString = "";
    *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
    *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String requiredSingularResourceNameCommon = "";
    *   int requiredSingularFixed32 = 0;
    *   long requiredSingularFixed64 = 0L;
@@ -7807,8 +8328,8 @@ public class LibraryClient implements BackgroundResource {
    *   String requiredSingularString = "";
    *   ByteString requiredSingularBytes = ByteString.copyFromUtf8("");
    *   TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build();
-   *   BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
-   *   BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]");
+   *   BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
+   *   BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]");
    *   String requiredSingularResourceNameCommon = "";
    *   int requiredSingularFixed32 = 0;
    *   long requiredSingularFixed64 = 0L;
@@ -8367,6 +8888,32 @@ public class LibraryClient implements BackgroundResource {
     return archiveBooks(request);
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   *
+   *
+   * Sample code:
+   * 

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.archiveBooks(source.toString(), archive.toString());
+   * }
+   * 
+ * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(String source, String archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source) + .setArchive(archive) + .build(); + return archiveBooks(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -8492,18 +9039,45 @@ public class LibraryClient implements BackgroundResource { * Sample code: *

    * try (LibraryClient libraryClient = LibraryClient.create()) {
-   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
-   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(request).get();
+   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
+   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source.toString(), archive.toString()).get();
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param source + * @param archive * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture longRunningArchiveBooksAsync(ArchiveBooksRequest request) { - return longRunningArchiveBooksOperationCallable().futureCall(request); - } + public final OperationFuture longRunningArchiveBooksAsync(String source, String archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source) + .setArchive(archive) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder().build();
+   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ArchiveBooksRequest request) { + return longRunningArchiveBooksOperationCallable().futureCall(request); + } // AUTO-GENERATED DOCUMENTATION AND METHOD /** @@ -14292,18 +14866,16 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); Shelf actualResponse = - client.getShelf(name, message); + client.getShelf(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14318,9 +14890,8 @@ public class LibraryClientTest { try { ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - client.getShelf(name, message); + client.getShelf(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14342,10 +14913,9 @@ public class LibraryClientTest { ShelfName name = ShelfName.of("[SHELF_ID]"); SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); Shelf actualResponse = - client.getShelf(name, message, stringBuilder); + client.getShelf(name, message); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); @@ -14354,7 +14924,6 @@ public class LibraryClientTest { Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14370,9 +14939,8 @@ public class LibraryClientTest { try { ShelfName name = ShelfName.of("[SHELF_ID]"); SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - client.getShelf(name, message, stringBuilder); + client.getShelf(name, message); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14381,19 +14949,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void getShelfTest4() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); - client.deleteShelf(name); + Shelf actualResponse = + client.getShelf(name, message); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(message, actualRequest.getMessage()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14402,14 +14981,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfExceptionTest() throws Exception { + public void getShelfExceptionTest4() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); - client.deleteShelf(name); + client.getShelf(name, message); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14418,7 +14998,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesTest() { + public void getShelfTest5() { ShelfName name2 = ShelfName.of("[SHELF_ID]"); String theme = "theme110327241"; String internalTheme = "internalTheme792518087"; @@ -14430,18 +15010,20 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); Shelf actualResponse = - client.mergeShelves(name, otherShelfName); + client.getShelf(name, message, stringBuilder); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14450,15 +15032,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesExceptionTest() throws Exception { + public void getShelfExceptionTest5() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - client.mergeShelves(name, otherShelfName); + client.getShelf(name, message, stringBuilder); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14467,32 +15050,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() + public void getShelfTest6() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + .setTheme(theme) + .setInternalTheme(internalTheme) .build(); mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); - Book book = Book.newBuilder().build(); + SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - Book actualResponse = - client.createBook(name, book); + Shelf actualResponse = + client.getShelf(name, message, stringBuilder); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14501,15 +15084,16 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookExceptionTest() throws Exception { + public void getShelfExceptionTest6() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ShelfName name = ShelfName.of("[SHELF_ID]"); - Book book = Book.newBuilder().build(); + SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - client.createBook(name, book); + client.getShelf(name, message, stringBuilder); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14518,36 +15102,19 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void publishSeriesTest() { - String bookNamesElement = "bookNamesElement1491670575"; - List bookNames = Arrays.asList(bookNamesElement); - PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() - .addAllBookNames(bookNames) - .build(); + public void deleteShelfTest() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - PublishSeriesResponse actualResponse = - client.publishSeries(shelf, books, edition, seriesUuid, publisher); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteShelf(name); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); - Assert.assertEquals(shelf, actualRequest.getShelf()); - Assert.assertEquals(books, actualRequest.getBooksList()); - Assert.assertEquals(edition, actualRequest.getEdition()); - Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(publisher, PublisherName.parse(actualRequest.getPublisher())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14556,21 +15123,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void publishSeriesExceptionTest() throws Exception { + public void deleteShelfExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - client.publishSeries(shelf, books, edition, seriesUuid, publisher); + client.deleteShelf(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14579,30 +15139,19 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); + public void deleteShelfTest2() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - Book actualResponse = - client.getBook(name); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteShelf(name); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14611,14 +15160,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookExceptionTest() throws Exception { + public void deleteShelfExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); - client.getBook(name); + client.deleteShelf(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14627,31 +15176,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksTest() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) + public void mergeShelvesTest() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) .build(); mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; - - ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + Shelf actualResponse = + client.mergeShelves(name, otherShelfName); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14660,15 +15208,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest() throws Exception { + public void mergeShelvesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.listBooks(name, filter); + client.mergeShelves(name, otherShelfName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14677,19 +15225,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void mergeShelvesTest2() { + ShelfName name2 = ShelfName.of("[SHELF_ID]"); + String theme = "theme110327241"; + String internalTheme = "internalTheme792518087"; + Shelf expectedResponse = Shelf.newBuilder() + .setName(name2.toString()) + .setTheme(theme) + .setInternalTheme(internalTheme) + .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.deleteBook(name); + Shelf actualResponse = + client.mergeShelves(name, otherShelfName); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14698,14 +15257,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookExceptionTest() throws Exception { + public void mergeShelvesExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.deleteBook(name); + client.mergeShelves(name, otherShelfName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14714,8 +15274,8 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + public void createBookTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -14727,18 +15287,18 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); Book book = Book.newBuilder().build(); Book actualResponse = - client.updateBook(name, book); + client.createBook(name, book); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -14748,15 +15308,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookExceptionTest() throws Exception { + public void createBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + ShelfName name = ShelfName.of("[SHELF_ID]"); Book book = Book.newBuilder().build(); - client.updateBook(name, book); + client.createBook(name, book); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14765,8 +15325,8 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookTest2() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + public void createBookTest2() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -14778,10 +15338,555 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - String optionalFoo = "optionalFoo1822578535"; + ShelfName name = ShelfName.of("[SHELF_ID]"); Book book = Book.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); + + Book actualResponse = + client.createBook(name, book); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); + + client.createBook(name, book); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void publishSeriesTest() { + String bookNamesElement = "bookNamesElement1491670575"; + List bookNames = Arrays.asList(bookNamesElement); + PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() + .addAllBookNames(bookNames) + .build(); + mockLibraryService.addResponse(expectedResponse); + + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + + PublishSeriesResponse actualResponse = + client.publishSeries(shelf, books, edition, seriesUuid, publisher); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + + Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertEquals(books, actualRequest.getBooksList()); + Assert.assertEquals(edition, actualRequest.getEdition()); + Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); + Assert.assertEquals(publisher, PublisherName.parse(actualRequest.getPublisher())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void publishSeriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + + client.publishSeries(shelf, books, edition, seriesUuid, publisher); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void publishSeriesTest2() { + String bookNamesElement = "bookNamesElement1491670575"; + List bookNames = Arrays.asList(bookNamesElement); + PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() + .addAllBookNames(bookNames) + .build(); + mockLibraryService.addResponse(expectedResponse); + + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + + PublishSeriesResponse actualResponse = + client.publishSeries(shelf, books, edition, seriesUuid, publisher); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + + Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertEquals(books, actualRequest.getBooksList()); + Assert.assertEquals(edition, actualRequest.getEdition()); + Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); + Assert.assertEquals(publisher, actualRequest.getPublisher()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void publishSeriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + + client.publishSeries(shelf, books, edition, seriesUuid, publisher); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBookTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + Book actualResponse = + client.getBook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.getBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBookTest2() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + Book actualResponse = + client.getBook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.getBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBooksTest() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; + + ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; + + client.listBooks(name, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBooksTest2() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; + + ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listBooksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; + + client.listBooks(name, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteBookTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.deleteBook(name); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.deleteBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteBookTest2() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.deleteBook(name); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.deleteBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + Book book = Book.newBuilder().build(); + + Book actualResponse = + client.updateBook(name, book); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + Book book = Book.newBuilder().build(); + + client.updateBook(name, book); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookTest2() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + Book book = Book.newBuilder().build(); + + Book actualResponse = + client.updateBook(name, book); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + Book book = Book.newBuilder().build(); + + client.updateBook(name, book); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookTest3() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); Book actualResponse = @@ -14805,18 +15910,129 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookExceptionTest2() throws Exception { + public void updateBookExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); + + client.updateBook(name, optionalFoo, book, updateMask, physicalMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookTest4() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String optionalFoo = "optionalFoo1822578535"; + Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); + + Book actualResponse = + client.updateBook(name, optionalFoo, book, updateMask, physicalMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); + Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateBookExceptionTest4() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String optionalFoo = "optionalFoo1822578535"; Book book = Book.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); - client.updateBook(name, optionalFoo, book, updateMask, physicalMask); + client.updateBook(name, optionalFoo, book, updateMask, physicalMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void moveBookTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + + Book actualResponse = + client.moveBook(name, otherShelfName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void moveBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + + client.moveBook(name, otherShelfName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -14825,8 +16041,8 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void moveBookTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + public void moveBookTest2() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -14838,7 +16054,7 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); Book actualResponse = @@ -14849,8 +16065,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -14859,12 +16075,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void moveBookExceptionTest() throws Exception { + public void moveBookExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); client.moveBook(name, otherShelfName); @@ -14925,13 +16141,64 @@ public class LibraryClientTest { } } + @Test + @SuppressWarnings("all") + public void listStringsTest2() { + String nextPageToken = ""; + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); + List strings = Arrays.asList(stringsElement); + ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllStrings(UntypedResourceName.toStringList(strings)) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ResourceName name = ArchiveName.of("[ARCHIVE]"); + + ListStringsPagedResponse pagedListResponse = client.listStrings(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), + resourceNames.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listStringsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ResourceName name = ArchiveName.of("[ARCHIVE]"); + + client.listStrings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void addCommentsTest() { Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); ByteString comment = ByteString.copyFromUtf8("95"); Comment.Stage stage = Comment.Stage.UNSET; SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; @@ -14963,7 +16230,63 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); + + client.addComments(name, comments); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void addCommentsTest2() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); + + client.addComments(name, comments); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(comments, actualRequest.getCommentsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void addCommentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); ByteString comment = ByteString.copyFromUtf8("95"); Comment.Stage stage = Comment.Stage.UNSET; SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; @@ -15007,8 +16330,171 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBookFromArchiveTest2() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); + + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookFromArchiveExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.getBookFromArchive(name, parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBookFromAnywhereTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); + + BookFromAnywhere actualResponse = + client.getBookFromAnywhere(name, altBookName, place, folder); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); + + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); + Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); + Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBookFromAnywhereExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); + + client.getBookFromAnywhere(name, altBookName, place, folder); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBookFromAnywhereTest2() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); + + BookFromAnywhere actualResponse = + client.getBookFromAnywhere(name, altBookName, place, folder); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(altBookName, actualRequest.getAltBookName()); + Assert.assertEquals(place, actualRequest.getPlace()); + Assert.assertEquals(folder, actualRequest.getFolder()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15017,15 +16503,17 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest() throws Exception { + public void getBookFromAnywhereExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); - client.getBookFromArchive(name, parent); + client.getBookFromAnywhere(name, altBookName, place, folder); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15034,8 +16522,8 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAnywhereTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + public void getBookFromAbsolutelyAnywhereTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -15047,23 +16535,17 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); BookFromAnywhere actualResponse = - client.getBookFromAnywhere(name, altBookName, place, folder); + client.getBookFromAbsolutelyAnywhere(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); + GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); - Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); - Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15072,17 +16554,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAnywhereExceptionTest() throws Exception { + public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName altBookName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - client.getBookFromAnywhere(name, altBookName, place, folder); + client.getBookFromAbsolutelyAnywhere(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15091,8 +16570,8 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereTest() { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + public void getBookFromAbsolutelyAnywhereTest2() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -15104,7 +16583,7 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); BookFromAnywhere actualResponse = client.getBookFromAbsolutelyAnywhere(name); @@ -15114,7 +16593,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15123,12 +16602,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { + public void getBookFromAbsolutelyAnywhereExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); client.getBookFromAbsolutelyAnywhere(name); Assert.fail("No exception raised"); @@ -15143,7 +16622,7 @@ public class LibraryClientTest { Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String indexName = "default index"; String indexMapItem = "indexMapItem1918721251"; Map indexMap = new HashMap<>(); @@ -15171,7 +16650,54 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String indexName = "default index"; + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + + client.updateBookIndex(name, indexName, indexMap); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBookIndexTest2() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String indexName = "default index"; + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); + + client.updateBookIndex(name, indexName, indexMap); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(indexName, actualRequest.getIndexName()); + Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateBookIndexExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String indexName = "default index"; String indexMapItem = "indexMapItem1918721251"; Map indexMap = new HashMap<>(); @@ -15238,7 +16764,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") public void streamBooksTest() throws Exception { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -15301,7 +16827,7 @@ public class LibraryClientTest { .setComment(comment) .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -15326,7 +16852,7 @@ public class LibraryClientTest { public void discussBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); DiscussBookRequest request = DiscussBookRequest.newBuilder() .setName(name.toString()) .build(); @@ -15354,7 +16880,7 @@ public class LibraryClientTest { @SuppressWarnings("all") public void findRelatedBooksTest() { String nextPageToken = ""; - BookName namesElement2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName namesElement2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); List names2 = Arrays.asList(namesElement2); FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() .setNextPageToken(nextPageToken) @@ -15409,7 +16935,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") public void getBigBookTest() throws Exception { - BookName name2 = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; boolean read = true; @@ -15427,7 +16953,7 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(resultOperation); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); Book actualResponse = client.getBigBookAsync(name).get(); @@ -15451,7 +16977,64 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.getBigBookAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + + @Test + @SuppressWarnings("all") + public void getBigBookTest2() throws Exception { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigBookTest2") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + Book actualResponse = + client.getBigBookAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBigBookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); client.getBigBookAsync(name).get(); Assert.fail("No exception raised"); @@ -15475,7 +17058,7 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(resultOperation); - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); Empty actualResponse = client.getBigNothingAsync(name).get(); @@ -15499,7 +17082,55 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + client.getBigNothingAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + + @Test + @SuppressWarnings("all") + public void getBigNothingTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigNothingTest2") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); + + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + + Empty actualResponse = + client.getBigNothingAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBigNothingExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); client.getBigNothingAsync(name).get(); Assert.fail("No exception raised"); @@ -15526,8 +17157,8 @@ public class LibraryClientTest { String requiredSingularString = "requiredSingularString-1949894503"; ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; int requiredSingularFixed32 = 720656715; long requiredSingularFixed64 = 720656810; @@ -15587,8 +17218,8 @@ public class LibraryClientTest { String optionalSingularString = "optionalSingularString1852995162"; ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; int optionalSingularFixed32 = 1648847958; long optionalSingularFixed64 = 1648847863; @@ -15792,8 +17423,8 @@ public class LibraryClientTest { String requiredSingularString = "requiredSingularString-1949894503"; ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; int requiredSingularFixed32 = 720656715; long requiredSingularFixed64 = 720656810; @@ -15853,8 +17484,8 @@ public class LibraryClientTest { String optionalSingularString = "optionalSingularString1852995162"; ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; int optionalSingularFixed32 = 1648847958; long optionalSingularFixed64 = 1648847863; @@ -15928,8 +17559,8 @@ public class LibraryClientTest { String requiredSingularString = "requiredSingularString-1949894503"; ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; int requiredSingularFixed32 = 720656715; long requiredSingularFixed64 = 720656810; @@ -15989,8 +17620,8 @@ public class LibraryClientTest { String optionalSingularString = "optionalSingularString1852995162"; ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; int optionalSingularFixed32 = 1648847958; long optionalSingularFixed64 = 1648847863; @@ -16194,8 +17825,8 @@ public class LibraryClientTest { String requiredSingularString = "requiredSingularString-1949894503"; ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; int requiredSingularFixed32 = 720656715; long requiredSingularFixed64 = 720656810; @@ -16255,8 +17886,8 @@ public class LibraryClientTest { String optionalSingularString = "optionalSingularString1852995162"; ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; int optionalSingularFixed32 = 1648847958; long optionalSingularFixed64 = 1648847863; @@ -16960,6 +18591,51 @@ public class LibraryClientTest { } } + @Test + @SuppressWarnings("all") + public void archiveBooksTest4() { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + ArchiveBooksResponse actualResponse = + client.archiveBooks(source, archive); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void archiveBooksExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + client.archiveBooks(source, archive); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void longRunningArchiveBooksTest() throws Exception { @@ -17122,6 +18798,60 @@ public class LibraryClientTest { } + @Test + @SuppressWarnings("all") + public void longRunningArchiveBooksTest4() throws Exception { + boolean success = false; + ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + .setSuccess(success) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningArchiveBooksTest4") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); + + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + ArchiveBooksResponse actualResponse = + client.longRunningArchiveBooksAsync(source, archive).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void longRunningArchiveBooksExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + + client.longRunningArchiveBooksAsync(source, archive).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test @SuppressWarnings("all") public void streamingArchiveBooksTest() throws Exception { @@ -17225,7 +18955,7 @@ public class LibrarySmokeTest { public static void executeNoCatch() throws Exception { try (LibraryClient client = LibraryClient.create()) { - BookName name = BookFromArchiveName.of("[ARCHIVE]", "[BOOK]"); + BookName name = ShelfBookName.of("testShelf-" + System.currentTimeMillis(), "[BOOK]"); Book.Rating rating = Book.Rating.GOOD; Book book = Book.newBuilder() .setRating(rating) diff --git a/src/test/java/com/google/api/codegen/testsrc/common/library_v2_gapic.yaml b/src/test/java/com/google/api/codegen/testsrc/common/library_v2_gapic.yaml index 17d094aef1..a0fe9f3706 100644 --- a/src/test/java/com/google/api/codegen/testsrc/common/library_v2_gapic.yaml +++ b/src/test/java/com/google/api/codegen/testsrc/common/library_v2_gapic.yaml @@ -65,7 +65,7 @@ interfaces: - entity_name: book_from_archive name_pattern: "archives/{archive}/books/{book}" - entity_name: book - name_pattern: "bookShelves/{book_shelf}/books/{book}" + name_pattern: "shelves/{shelf_id}/books/{book}" language_overrides: - language: java entity_name: shelf_book From ab26da3dec6bdabf8dc1bf3bfce2e2f19f9c696d Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 23 Jan 2020 17:20:55 -0800 Subject: [PATCH 10/36] wip --- .../api/codegen/config/FlatteningConfig.java | 7 +- .../java/JavaApiMethodTransformer.java | 8 +- .../testdata/java_library.baseline | 317 +++++++++++++++++- .../api/codegen/testsrc/common/library.proto | 2 +- 4 files changed, 317 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 7291d344be..6188e34def 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -30,6 +30,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; @@ -264,6 +265,10 @@ private static List createFlatteningsFromProtoFile( Set oneofNames = new HashSet<>(); List> flatteningConfigs = new ArrayList<>(); + if (flattenedParams.isEmpty()) { + flatteningConfigs.add(Collections.emptyMap()); + } + for (String parameter : flattenedParams) { List fieldConfigs = createFieldConfigsForParameter( @@ -310,8 +315,6 @@ private static void collectFieldConfigs( new LinkedHashMap<>(flatteningConfigs.get(i)); newFlattening.put(parameter, fieldConfigs.get(j)); flatteningConfigs.add(newFlattening); - System.out.println(i); - System.out.println(j); } flatteningConfigs.get(i).put(parameter, fieldConfigs.get(fieldConfigs.size() - 1)); } diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java index d91346f4bb..52f389588b 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java @@ -233,11 +233,9 @@ private List generatePagedStreamingMethods( // if (!FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { // apiMethods.add(generatePagedFlattenedMethod(flattenedMethodContext, sampleContext)); // } - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - apiMethods.add( - generatePagedFlattenedMethod( - flattenedMethodContext.withResourceNamesInSamplesOnly(), sampleContext)); - } + // if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { + apiMethods.add(generatePagedFlattenedMethod(flattenedMethodContext, sampleContext)); + // } } } apiMethods.add( diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 21d15cb12c..006097726e 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -5147,6 +5147,27 @@ public class LibraryClient implements BackgroundResource { return stub.getShelfCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists shelves. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *
+   *   for (Shelf element : libraryClient.listShelves().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListShelvesPagedResponse listShelves() { + ListShelvesRequest request = + ListShelvesRequest.newBuilder().build(); + return listShelves(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists shelves. @@ -5733,6 +5754,34 @@ public class LibraryClient implements BackgroundResource { return stub.getBookCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists books in a shelf. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ShelfName name = ShelfName.of("[SHELF_ID]");
+   *   String filter = "book-filter-string";
+   *   for (Book element : libraryClient.listBooks(name, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param name The name of the shelf whose books we'd like to list. + * @param filter To test python built-in wrapping. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBooksPagedResponse listBooks(ShelfName name, String filter) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setFilter(filter) + .build(); + return listBooks(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists books in a shelf. @@ -6202,6 +6251,52 @@ public class LibraryClient implements BackgroundResource { return stub.moveBookCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists a primitive resource. To test go page streaming. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *
+   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListStringsPagedResponse listStrings() { + ListStringsRequest request = + ListStringsRequest.newBuilder().build(); + return listStrings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists a primitive resource. To test go page streaming. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
+   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListStringsPagedResponse listStrings(ResourceName name) { + ListStringsRequest request = + ListStringsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return listStrings(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists a primitive resource. To test go page streaming. @@ -7025,11 +7120,11 @@ public class LibraryClient implements BackgroundResource { * @param shelves * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { + public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { FindRelatedBooksRequest request = FindRelatedBooksRequest.newBuilder() - .addAllNames(names) - .addAllShelves(shelves) + .addAllNames(names == null ? null : BookName.toStringList(names)) + .addAllShelves(shelves == null ? null : ShelfName.toStringList(shelves)) .build(); return findRelatedBooks(request); } @@ -7398,6 +7493,25 @@ public class LibraryClient implements BackgroundResource { return stub.getBigNothingCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Test optional flattening parameters of all types + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *
+   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams();
+   * }
+   * 
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams() { + TestOptionalRequiredFlatteningParamsRequest request = + TestOptionalRequiredFlatteningParamsRequest.newBuilder().build(); + return testOptionalRequiredFlatteningParams(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Test optional flattening parameters of all types @@ -9138,6 +9252,25 @@ public class LibraryClient implements BackgroundResource { return stub.streamingArchiveBooksCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * This method is not exposed in the GAPIC config. It should be generated. + * + * Sample code: + *

+   * try (LibraryClient libraryClient = LibraryClient.create()) {
+   *
+   *   Book response = libraryClient.privateListShelves();
+   * }
+   * 
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Book privateListShelves() { + ListShelvesRequest request = + ListShelvesRequest.newBuilder().build(); + return privateListShelves(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * This method is not exposed in the GAPIC config. It should be generated. @@ -14679,6 +14812,7 @@ import com.google.common.collect.Lists; import com.google.example.library.v1.Comment; import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; +import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; import com.google.example.library.v1.SomeMessage2; import com.google.example.library.v1.TestOptionalRequiredFlatteningParamsRequest; @@ -15100,6 +15234,48 @@ public class LibraryClientTest { } } + @Test + @SuppressWarnings("all") + public void listShelvesTest() { + String nextPageToken = ""; + Shelf shelvesElement = Shelf.newBuilder().build(); + List shelves = Arrays.asList(shelvesElement); + ListShelvesResponse expectedResponse = ListShelvesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllShelves(shelves) + .build(); + mockLibraryService.addResponse(expectedResponse); + + ListShelvesPagedResponse pagedListResponse = client.listShelves(); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getShelvesList().get(0), resources.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListShelvesRequest actualRequest = (ListShelvesRequest)actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listShelvesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + client.listShelves(); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void deleteShelfTest() { @@ -16102,6 +16278,52 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); + ListStringsPagedResponse pagedListResponse = client.listStrings(); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), + resourceNames.get(0)); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listStringsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + client.listStrings(); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listStringsTest2() { + String nextPageToken = ""; + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); + List strings = Arrays.asList(stringsElement); + ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllStrings(UntypedResourceName.toStringList(strings)) + .build(); + mockLibraryService.addResponse(expectedResponse); + ResourceName name = ArchiveName.of("[ARCHIVE]"); ListStringsPagedResponse pagedListResponse = client.listStrings(name); @@ -16127,7 +16349,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listStringsExceptionTest() throws Exception { + public void listStringsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -16143,7 +16365,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listStringsTest2() { + public void listStringsTest3() { String nextPageToken = ""; ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); List strings = Arrays.asList(stringsElement); @@ -16178,7 +16400,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listStringsExceptionTest2() throws Exception { + public void listStringsExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -17148,6 +17370,40 @@ public class LibraryClientTest { TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); + TestOptionalRequiredFlatteningParamsResponse actualResponse = + client.testOptionalRequiredFlatteningParams(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + client.testOptionalRequiredFlatteningParams(); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testOptionalRequiredFlatteningParamsTest2() { + TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); + mockLibraryService.addResponse(expectedResponse); + int requiredSingularInt32 = 72313594; long requiredSingularInt64 = 72313499L; float requiredSingularFloat = -7514705.0F; @@ -17409,7 +17665,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -17546,7 +17802,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest2() { + public void testOptionalRequiredFlatteningParamsTest3() { TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); @@ -17811,7 +18067,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -18903,6 +19159,49 @@ public class LibraryClientTest { } } + @Test + @SuppressWarnings("all") + public void privateListShelvesTest() { + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); + mockLibraryService.addResponse(expectedResponse); + + Book actualResponse = + client.privateListShelves(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLibraryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListShelvesRequest actualRequest = (ListShelvesRequest)actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void privateListShelvesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); + + try { + client.privateListShelves(); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + } ============== file: src/test/java/com/google/example/library/v1/LibrarySmokeTest.java ============== /* diff --git a/src/test/java/com/google/api/codegen/testsrc/common/library.proto b/src/test/java/com/google/api/codegen/testsrc/common/library.proto index 772f3bb819..19517ff593 100644 --- a/src/test/java/com/google/api/codegen/testsrc/common/library.proto +++ b/src/test/java/com/google/api/codegen/testsrc/common/library.proto @@ -1173,4 +1173,4 @@ message ArchiveBooksResponse { message ArchiveBooksMetadata { double percentage = 1; -} \ No newline at end of file +} From ad8fde799f03b3d653434a2db7b0055295264aa3 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Fri, 24 Jan 2020 11:15:57 -0800 Subject: [PATCH 11/36] wip --- .../java/JavaSurfaceTestTransformer.java | 7 +- .../testdata/java_library.baseline | 4016 ++++------------- 2 files changed, 876 insertions(+), 3147 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index 6387c4bf7a..439f31f63c 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -303,9 +303,10 @@ private List createTestCaseViews(InterfaceContext context) { for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { MethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); - if (FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { - methodContext = methodContext.withResourceNamesInSamplesOnly(); - flatteningGroup = methodContext.getFlatteningConfig(); + if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { + // methodContext = methodContext.withResourceNamesInSamplesOnly(); + // flatteningGroup = methodContext.getFlatteningConfig(); + continue; } InitCodeContext initCodeContext = initCodeTransformer.createRequestInitCodeContext( diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 006097726e..3d0aec90bf 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -14810,7 +14810,6 @@ import com.google.api.gax.rpc.StatusCode; import com.google.api.resourcenames.ResourceName; import com.google.common.collect.Lists; import com.google.example.library.v1.Comment; -import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse; import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse; import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse; @@ -14963,7 +14962,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15000,9 +14999,10 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); Shelf actualResponse = - client.getShelf(name); + client.getShelf(name, message); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); @@ -15010,6 +15010,7 @@ public class LibraryClientTest { GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(message, actualRequest.getMessage()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15024,8 +15025,9 @@ public class LibraryClientTest { try { ShelfName name = ShelfName.of("[SHELF_ID]"); + SomeMessage message = SomeMessage.newBuilder().build(); - client.getShelf(name); + client.getShelf(name, message); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15047,17 +15049,19 @@ public class LibraryClientTest { ShelfName name = ShelfName.of("[SHELF_ID]"); SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); Shelf actualResponse = - client.getShelf(name, message); + client.getShelf(name, message, stringBuilder); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertEquals(message, actualRequest.getMessage()); + Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15073,8 +15077,9 @@ public class LibraryClientTest { try { ShelfName name = ShelfName.of("[SHELF_ID]"); SomeMessage message = SomeMessage.newBuilder().build(); + com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - client.getShelf(name, message); + client.getShelf(name, message, stringBuilder); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15083,30 +15088,26 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfTest4() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) + public void listShelvesTest() { + String nextPageToken = ""; + Shelf shelvesElement = Shelf.newBuilder().build(); + List shelves = Arrays.asList(shelvesElement); + ListShelvesResponse expectedResponse = ListShelvesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllShelves(shelves) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); + ListShelvesPagedResponse pagedListResponse = client.listShelves(); - Shelf actualResponse = - client.getShelf(name, message); - Assert.assertEquals(expectedResponse, actualResponse); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getShelvesList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + ListShelvesRequest actualRequest = (ListShelvesRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(message, actualRequest.getMessage()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15115,15 +15116,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfExceptionTest4() throws Exception { + public void listShelvesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - - client.getShelf(name, message); + client.listShelves(); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15132,32 +15130,19 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfTest5() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); + public void deleteShelfTest() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - Shelf actualResponse = - client.getShelf(name, message, stringBuilder); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteShelf(name); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15166,16 +15151,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfExceptionTest5() throws Exception { + public void deleteShelfExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); - client.getShelf(name, message, stringBuilder); + client.deleteShelf(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15184,7 +15167,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfTest6() { + public void mergeShelvesTest() { ShelfName name2 = ShelfName.of("[SHELF_ID]"); String theme = "theme110327241"; String internalTheme = "internalTheme792518087"; @@ -15196,20 +15179,18 @@ public class LibraryClientTest { mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); Shelf actualResponse = - client.getShelf(name, message, stringBuilder); + client.mergeShelves(name, otherShelfName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); + MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(message, actualRequest.getMessage()); - Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); + Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15218,16 +15199,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getShelfExceptionTest6() throws Exception { + public void mergeShelvesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ShelfName name = ShelfName.of("[SHELF_ID]"); - SomeMessage message = SomeMessage.newBuilder().build(); - com.google.example.library.v1.StringBuilder stringBuilder = com.google.example.library.v1.StringBuilder.newBuilder().build(); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.getShelf(name, message, stringBuilder); + client.mergeShelves(name, otherShelfName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15236,26 +15216,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listShelvesTest() { - String nextPageToken = ""; - Shelf shelvesElement = Shelf.newBuilder().build(); - List shelves = Arrays.asList(shelvesElement); - ListShelvesResponse expectedResponse = ListShelvesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllShelves(shelves) + public void createBookTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ListShelvesPagedResponse pagedListResponse = client.listShelves(); + ShelfName name = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getShelvesList().get(0), resources.get(0)); + Book actualResponse = + client.createBook(name, book); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListShelvesRequest actualRequest = (ListShelvesRequest)actualRequests.get(0); + CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15264,12 +15250,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listShelvesExceptionTest() throws Exception { + public void createBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - client.listShelves(); + ShelfName name = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); + + client.createBook(name, book); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15278,19 +15267,36 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void publishSeriesTest() { + String bookNamesElement = "bookNamesElement1491670575"; + List bookNames = Arrays.asList(bookNamesElement); + PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() + .addAllBookNames(bookNames) + .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - client.deleteShelf(name); + PublishSeriesResponse actualResponse = + client.publishSeries(shelf, books, edition, seriesUuid, publisher); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); + PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(shelf, actualRequest.getShelf()); + Assert.assertEquals(books, actualRequest.getBooksList()); + Assert.assertEquals(edition, actualRequest.getEdition()); + Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); + Assert.assertEquals(publisher, actualRequest.getPublisher()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15299,14 +15305,21 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfExceptionTest() throws Exception { + public void publishSeriesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + Shelf shelf = Shelf.newBuilder().build(); + List books = new ArrayList<>(); + int edition = 1887963714; + String seriesString = "foobar"; + SeriesUuid seriesUuid = SeriesUuid.newBuilder() + .setSeriesString(seriesString) + .build(); + PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - client.deleteShelf(name); + client.publishSeries(shelf, books, edition, seriesUuid, publisher); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15315,17 +15328,28 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfTest2() { - Empty expectedResponse = Empty.newBuilder().build(); + public void getBookTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - client.deleteShelf(name); + Book actualResponse = + client.getBook(name); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -15336,14 +15360,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteShelfExceptionTest2() throws Exception { + public void getBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - client.deleteShelf(name); + client.getBook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15352,30 +15376,31 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesTest() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) + public void listBooksTest() { + String nextPageToken = ""; + Book booksElement = Book.newBuilder().build(); + List books = Arrays.asList(booksElement); + ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBooks(books) .build(); mockLibraryService.addResponse(expectedResponse); ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; - Shelf actualResponse = - client.mergeShelves(name, otherShelfName); - Assert.assertEquals(expectedResponse, actualResponse); + ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); + ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(filter, actualRequest.getFilter()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15384,15 +15409,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesExceptionTest() throws Exception { + public void listBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + String filter = "book-filter-string"; - client.mergeShelves(name, otherShelfName); + client.listBooks(name, filter); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15401,30 +15426,19 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesTest2() { - ShelfName name2 = ShelfName.of("[SHELF_ID]"); - String theme = "theme110327241"; - String internalTheme = "internalTheme792518087"; - Shelf expectedResponse = Shelf.newBuilder() - .setName(name2.toString()) - .setTheme(theme) - .setInternalTheme(internalTheme) - .build(); + public void deleteBookTest() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - Shelf actualResponse = - client.mergeShelves(name, otherShelfName); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteBook(name); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); + DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15433,15 +15447,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void mergeShelvesExceptionTest2() throws Exception { + public void deleteBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - client.mergeShelves(name, otherShelfName); + client.deleteBook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15450,7 +15463,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookTest() { + public void updateBookTest() { BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -15463,18 +15476,18 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); Book book = Book.newBuilder().build(); Book actualResponse = - client.createBook(name, book); + client.updateBook(name, book); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -15484,15 +15497,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookExceptionTest() throws Exception { + public void updateBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); Book book = Book.newBuilder().build(); - client.createBook(name, book); + client.updateBook(name, book); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15501,7 +15514,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookTest2() { + public void updateBookTest2() { BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -15514,19 +15527,25 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String optionalFoo = "optionalFoo1822578535"; Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); Book actualResponse = - client.createBook(name, book); + client.updateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); + UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); Assert.assertEquals(book, actualRequest.getBook()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15535,15 +15554,18 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void createBookExceptionTest2() throws Exception { + public void updateBookExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String optionalFoo = "optionalFoo1822578535"; Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); - client.createBook(name, book); + client.updateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15552,36 +15574,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void publishSeriesTest() { - String bookNamesElement = "bookNamesElement1491670575"; - List bookNames = Arrays.asList(bookNamesElement); - PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() - .addAllBookNames(bookNames) + public void moveBookTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + Book expectedResponse = Book.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - PublishSeriesResponse actualResponse = - client.publishSeries(shelf, books, edition, seriesUuid, publisher); + Book actualResponse = + client.moveBook(name, otherShelfName); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - Assert.assertEquals(shelf, actualRequest.getShelf()); - Assert.assertEquals(books, actualRequest.getBooksList()); - Assert.assertEquals(edition, actualRequest.getEdition()); - Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(publisher, PublisherName.parse(actualRequest.getPublisher())); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15590,21 +15608,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void publishSeriesExceptionTest() throws Exception { + public void moveBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.publishSeries(shelf, books, edition, seriesUuid, publisher); + client.moveBook(name, otherShelfName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15613,36 +15625,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void publishSeriesTest2() { - String bookNamesElement = "bookNamesElement1491670575"; - List bookNames = Arrays.asList(bookNamesElement); - PublishSeriesResponse expectedResponse = PublishSeriesResponse.newBuilder() - .addAllBookNames(bookNames) + public void listStringsTest() { + String nextPageToken = ""; + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); + List strings = Arrays.asList(stringsElement); + ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllStrings(UntypedResourceName.toStringList(strings)) .build(); mockLibraryService.addResponse(expectedResponse); - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + ListStringsPagedResponse pagedListResponse = client.listStrings(); - PublishSeriesResponse actualResponse = - client.publishSeries(shelf, books, edition, seriesUuid, publisher); - Assert.assertEquals(expectedResponse, actualResponse); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), + resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - PublishSeriesRequest actualRequest = (PublishSeriesRequest)actualRequests.get(0); + ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - Assert.assertEquals(shelf, actualRequest.getShelf()); - Assert.assertEquals(books, actualRequest.getBooksList()); - Assert.assertEquals(edition, actualRequest.getEdition()); - Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(publisher, actualRequest.getPublisher()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15651,21 +15657,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void publishSeriesExceptionTest2() throws Exception { + public void listStringsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - Shelf shelf = Shelf.newBuilder().build(); - List books = new ArrayList<>(); - int edition = 1887963714; - String seriesString = "foobar"; - SeriesUuid seriesUuid = SeriesUuid.newBuilder() - .setSeriesString(seriesString) - .build(); - PublisherName publisher = PublisherName.of("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - - client.publishSeries(shelf, books, edition, seriesUuid, publisher); + client.listStrings(); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15674,30 +15671,33 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookTest() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void listStringsTest2() { + String nextPageToken = ""; + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); + List strings = Arrays.asList(stringsElement); + ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllStrings(UntypedResourceName.toStringList(strings)) .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); - Book actualResponse = - client.getBook(name); - Assert.assertEquals(expectedResponse, actualResponse); + ListStringsPagedResponse pagedListResponse = client.listStrings(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); + List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); + Assert.assertEquals(1, resourceNames.size()); + Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), + resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15706,14 +15706,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookExceptionTest() throws Exception { + public void listStringsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); - client.getBook(name); + client.listStrings(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15722,30 +15722,29 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookTest2() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); + public void addCommentsTest() { + Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); - Book actualResponse = - client.getBook(name); - Assert.assertEquals(expectedResponse, actualResponse); + client.addComments(name, comments); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); + AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(comments, actualRequest.getCommentsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15754,14 +15753,23 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void getBookExceptionTest2() throws Exception { + public void addCommentsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + ByteString comment = ByteString.copyFromUtf8("95"); + Comment.Stage stage = Comment.Stage.UNSET; + SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; + Comment commentsElement = Comment.newBuilder() + .setComment(comment) + .setStage(stage) + .setAlignment(alignment) + .build(); + List comments = Arrays.asList(commentsElement); - client.getBook(name); + client.addComments(name, comments); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15770,31 +15778,32 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksTest() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) + public void getBookFromArchiveTest() { + ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromArchive expectedResponse = BookFromArchive.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; - - ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + BookFromArchive actualResponse = + client.getBookFromArchive(name, parent); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); - Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15803,15 +15812,15 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest() throws Exception { + public void getBookFromArchiveExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; - - client.listBooks(name, filter); + ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.getBookFromArchive(name, parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15820,31 +15829,36 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksTest2() { - String nextPageToken = ""; - Book booksElement = Book.newBuilder().build(); - List books = Arrays.asList(booksElement); - ListBooksResponse expectedResponse = ListBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBooks(books) + public void getBookFromAnywhereTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; - - ListBooksPagedResponse pagedListResponse = client.listBooks(name, filter); + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + BookFromAnywhere actualResponse = + client.getBookFromAnywhere(name, altBookName, place, folder); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); + GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(altBookName, actualRequest.getAltBookName()); + Assert.assertEquals(place, actualRequest.getPlace()); + Assert.assertEquals(folder, actualRequest.getFolder()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15853,15 +15867,17 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listBooksExceptionTest2() throws Exception { + public void getBookFromAnywhereExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ShelfName name = ShelfName.of("[SHELF_ID]"); - String filter = "book-filter-string"; + BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); + FolderName folder = FolderName.of("[FOLDER]"); - client.listBooks(name, filter); + client.getBookFromAnywhere(name, altBookName, place, folder); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15870,19 +15886,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void getBookFromAbsolutelyAnywhereTest() { + BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String author = "author-1406328437"; + String title = "title110371416"; + boolean read = true; + BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() + .setName(name2.toString()) + .setAuthor(author) + .setTitle(title) + .setRead(read) + .build(); mockLibraryService.addResponse(expectedResponse); BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - client.deleteBook(name); + BookFromAnywhere actualResponse = + client.getBookFromAbsolutelyAnywhere(name); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15891,14 +15918,14 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookExceptionTest() throws Exception { + public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - client.deleteBook(name); + client.getBookFromAbsolutelyAnywhere(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15907,19 +15934,25 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookTest2() { + public void updateBookIndexTest() { Empty expectedResponse = Empty.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String indexName = "default index"; + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); - client.deleteBook(name); + client.updateBookIndex(name, indexName, indexMap); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); + UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(indexName, actualRequest.getIndexName()); + Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15928,14 +15961,18 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void deleteBookExceptionTest2() throws Exception { + public void updateBookIndexExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String indexName = "default index"; + String indexMapItem = "indexMapItem1918721251"; + Map indexMap = new HashMap<>(); + indexMap.put("default_key", indexMapItem); - client.deleteBook(name); + client.updateBookIndex(name, indexName, indexMap); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -15944,58 +15981,58 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void updateBookTest() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void streamShelvesTest() throws Exception { + Shelf shelvesElement = Shelf.newBuilder().build(); + List shelves = Arrays.asList(shelvesElement); + StreamShelvesResponse expectedResponse = StreamShelvesResponse.newBuilder() + .addAllShelves(shelves) .build(); mockLibraryService.addResponse(expectedResponse); + ShelfName name = ShelfName.of("[SHELF_ID]"); + StreamShelvesRequest request = StreamShelvesRequest.newBuilder() + .setName(name.toString()) + .build(); - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - Book book = Book.newBuilder().build(); - - Book actualResponse = - client.updateBook(name, book); - Assert.assertEquals(expectedResponse, actualResponse); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + ServerStreamingCallable callable = + client.streamShelvesCallable(); + callable.serverStreamingCall(request, responseObserver); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); } @Test @SuppressWarnings("all") - public void updateBookExceptionTest() throws Exception { + public void streamShelvesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); + ShelfName name = ShelfName.of("[SHELF_ID]"); + StreamShelvesRequest request = StreamShelvesRequest.newBuilder() + .setName(name.toString()) + .build(); - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - Book book = Book.newBuilder().build(); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - client.updateBook(name, book); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + ServerStreamingCallable callable = + client.streamShelvesCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void updateBookTest2() { + public void streamBooksTest() throws Exception { BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -16007,166 +16044,110 @@ public class LibraryClientTest { .setRead(read) .build(); mockLibraryService.addResponse(expectedResponse); + String name = "name3373707"; + StreamBooksRequest request = StreamBooksRequest.newBuilder() + .setName(name) + .build(); - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - Book book = Book.newBuilder().build(); - - Book actualResponse = - client.updateBook(name, book); - Assert.assertEquals(expectedResponse, actualResponse); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + ServerStreamingCallable callable = + client.streamBooksCallable(); + callable.serverStreamingCall(request, responseObserver); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); } @Test @SuppressWarnings("all") - public void updateBookExceptionTest2() throws Exception { + public void streamBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); + String name = "name3373707"; + StreamBooksRequest request = StreamBooksRequest.newBuilder() + .setName(name) + .build(); - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - Book book = Book.newBuilder().build(); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - client.updateBook(name, book); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + ServerStreamingCallable callable = + client.streamBooksCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void updateBookTest3() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) + public void discussBookTest() throws Exception { + String userName = "userName339340927"; + ByteString comment = ByteString.copyFromUtf8("95"); + Comment expectedResponse = Comment.newBuilder() + .setUserName(userName) + .setComment(comment) .build(); mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); + DiscussBookRequest request = DiscussBookRequest.newBuilder() + .setName(name.toString()) + .build(); - Book actualResponse = - client.updateBook(name, optionalFoo, book, updateMask, physicalMask); - Assert.assertEquals(expectedResponse, actualResponse); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + BidiStreamingCallable callable = + client.discussBookCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + requestObserver.onNext(request); + requestObserver.onCompleted(); - @Test - @SuppressWarnings("all") - public void updateBookExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); - - client.updateBook(name, optionalFoo, book, updateMask, physicalMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); } @Test @SuppressWarnings("all") - public void updateBookTest4() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - + public void discussBookExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLibraryService.addException(exception); BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); - - Book actualResponse = - client.updateBook(name, optionalFoo, book, updateMask, physicalMask); - Assert.assertEquals(expectedResponse, actualResponse); + DiscussBookRequest request = DiscussBookRequest.newBuilder() + .setName(name.toString()) + .build(); - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); + MockStreamObserver responseObserver = new MockStreamObserver<>(); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); - Assert.assertEquals(book, actualRequest.getBook()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertEquals(physicalMask, actualRequest.getPhysicalMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } + BidiStreamingCallable callable = + client.discussBookCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); - @Test - @SuppressWarnings("all") - public void updateBookExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); + requestObserver.onNext(request); try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalFoo = "optionalFoo1822578535"; - Book book = Book.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - com.google.example.library.v1.FieldMask physicalMask = com.google.example.library.v1.FieldMask.newBuilder().build(); - - client.updateBook(name, optionalFoo, book, updateMask, physicalMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void moveBookTest() { + public void getBigBookTest() throws Exception { BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); String author = "author-1406328437"; String title = "title110371416"; @@ -16177,21 +16158,25 @@ public class LibraryClientTest { .setTitle(title) .setRead(read) .build(); - mockLibraryService.addResponse(expectedResponse); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigBookTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); Book actualResponse = - client.moveBook(name, otherShelfName); + client.getBigBookAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16200,49 +16185,46 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void moveBookExceptionTest() throws Exception { + public void getBigBookExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.moveBook(name, otherShelfName); + client.getBigBookAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + @Test @SuppressWarnings("all") - public void moveBookTest2() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); + public void getBigNothingTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("getBigNothingTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockLibraryService.addResponse(resultOperation); BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - Book actualResponse = - client.moveBook(name, otherShelfName); + Empty actualResponse = + client.getBigNothingAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); + GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16251,96 +16233,37 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void moveBookExceptionTest2() throws Exception { + public void getBigNothingExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); - client.moveBook(name, otherShelfName); + client.getBigNothingAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } - @Test - @SuppressWarnings("all") - public void listStringsTest() { - String nextPageToken = ""; - ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); - List strings = Arrays.asList(stringsElement); - ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllStrings(UntypedResourceName.toStringList(strings)) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ListStringsPagedResponse pagedListResponse = client.listStrings(); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listStringsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - client.listStrings(); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } @Test @SuppressWarnings("all") - public void listStringsTest2() { - String nextPageToken = ""; - ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); - List strings = Arrays.asList(stringsElement); - ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllStrings(UntypedResourceName.toStringList(strings)) - .build(); + public void testOptionalRequiredFlatteningParamsTest() { + TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - ResourceName name = ArchiveName.of("[ARCHIVE]"); - - ListStringsPagedResponse pagedListResponse = client.listStrings(name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); + TestOptionalRequiredFlatteningParamsResponse actualResponse = + client.testOptionalRequiredFlatteningParams(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); + TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16349,14 +16272,12 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listStringsExceptionTest2() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ResourceName name = ArchiveName.of("[ARCHIVE]"); - - client.listStrings(name); + client.testOptionalRequiredFlatteningParams(); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -16365,2328 +16286,263 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void listStringsTest3() { - String nextPageToken = ""; - ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); - List strings = Arrays.asList(stringsElement); - ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllStrings(UntypedResourceName.toStringList(strings)) - .build(); + public void testOptionalRequiredFlatteningParamsTest2() { + TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - ResourceName name = ArchiveName.of("[ARCHIVE]"); - - ListStringsPagedResponse pagedListResponse = client.listStrings(name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listStringsExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ResourceName name = ArchiveName.of("[ARCHIVE]"); - - client.listStrings(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void addCommentsTest() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); - - client.addComments(name, comments); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(comments, actualRequest.getCommentsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void addCommentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); - - client.addComments(name, comments); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void addCommentsTest2() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); - - client.addComments(name, comments); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(comments, actualRequest.getCommentsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void addCommentsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - ByteString comment = ByteString.copyFromUtf8("95"); - Comment.Stage stage = Comment.Stage.UNSET; - SomeMessage2.SomeMessage3.Alignment alignment = SomeMessage2.SomeMessage3.Alignment.CHAR; - Comment commentsElement = Comment.newBuilder() - .setComment(comment) - .setStage(stage) - .setAlignment(alignment) - .build(); - List comments = Arrays.asList(commentsElement); - - client.addComments(name, comments); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); - - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - - Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); - Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveTest2() { - ArchivedBookName name2 = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromArchive expectedResponse = BookFromArchive.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); - - BookFromArchive actualResponse = - client.getBookFromArchive(name, parent); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromArchiveExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchivedBookName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); - ProjectName parent = ProjectName.of("[PROJECT]"); - - client.getBookFromArchive(name, parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromAnywhereTest() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); - - BookFromAnywhere actualResponse = - client.getBookFromAnywhere(name, altBookName, place, folder); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); - - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); - Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); - Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromAnywhereExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); - - client.getBookFromAnywhere(name, altBookName, place, folder); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromAnywhereTest2() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); - - BookFromAnywhere actualResponse = - client.getBookFromAnywhere(name, altBookName, place, folder); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(altBookName, actualRequest.getAltBookName()); - Assert.assertEquals(place, actualRequest.getPlace()); - Assert.assertEquals(folder, actualRequest.getFolder()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromAnywhereExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName altBookName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - LocationName place = LocationName.of("[PROJECT]", "[LOCATION]"); - FolderName folder = FolderName.of("[FOLDER]"); - - client.getBookFromAnywhere(name, altBookName, place, folder); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereTest() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - BookFromAnywhere actualResponse = - client.getBookFromAbsolutelyAnywhere(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - client.getBookFromAbsolutelyAnywhere(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereTest2() { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - BookFromAnywhere expectedResponse = BookFromAnywhere.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - BookFromAnywhere actualResponse = - client.getBookFromAbsolutelyAnywhere(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBookFromAbsolutelyAnywhereExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - client.getBookFromAbsolutelyAnywhere(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void updateBookIndexTest() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String indexName = "default index"; - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - - client.updateBookIndex(name, indexName, indexMap); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); - - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(indexName, actualRequest.getIndexName()); - Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void updateBookIndexExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String indexName = "default index"; - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - - client.updateBookIndex(name, indexName, indexMap); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void updateBookIndexTest2() { - Empty expectedResponse = Empty.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String indexName = "default index"; - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - - client.updateBookIndex(name, indexName, indexMap); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(indexName, actualRequest.getIndexName()); - Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void updateBookIndexExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String indexName = "default index"; - String indexMapItem = "indexMapItem1918721251"; - Map indexMap = new HashMap<>(); - indexMap.put("default_key", indexMapItem); - - client.updateBookIndex(name, indexName, indexMap); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void streamShelvesTest() throws Exception { - Shelf shelvesElement = Shelf.newBuilder().build(); - List shelves = Arrays.asList(shelvesElement); - StreamShelvesResponse expectedResponse = StreamShelvesResponse.newBuilder() - .addAllShelves(shelves) - .build(); - mockLibraryService.addResponse(expectedResponse); - ShelfName name = ShelfName.of("[SHELF_ID]"); - StreamShelvesRequest request = StreamShelvesRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamShelvesCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - @SuppressWarnings("all") - public void streamShelvesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - ShelfName name = ShelfName.of("[SHELF_ID]"); - StreamShelvesRequest request = StreamShelvesRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamShelvesCallable(); - callable.serverStreamingCall(request, responseObserver); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void streamBooksTest() throws Exception { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - mockLibraryService.addResponse(expectedResponse); - String name = "name3373707"; - StreamBooksRequest request = StreamBooksRequest.newBuilder() - .setName(name) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBooksCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - @SuppressWarnings("all") - public void streamBooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - String name = "name3373707"; - StreamBooksRequest request = StreamBooksRequest.newBuilder() - .setName(name) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBooksCallable(); - callable.serverStreamingCall(request, responseObserver); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void discussBookTest() throws Exception { - String userName = "userName339340927"; - ByteString comment = ByteString.copyFromUtf8("95"); - Comment expectedResponse = Comment.newBuilder() - .setUserName(userName) - .setComment(comment) - .build(); - mockLibraryService.addResponse(expectedResponse); - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - DiscussBookRequest request = DiscussBookRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.discussBookCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - @SuppressWarnings("all") - public void discussBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - DiscussBookRequest request = DiscussBookRequest.newBuilder() - .setName(name.toString()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.discussBookCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void findRelatedBooksTest() { - String nextPageToken = ""; - BookName namesElement2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - List names2 = Arrays.asList(namesElement2); - FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllNames(BookName.toStringList(names2)) - .build(); - mockLibraryService.addResponse(expectedResponse); - - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); - - FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(formattedNames, formattedShelves); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - - Assert.assertEquals(formattedNames, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void findRelatedBooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - String namesElement = "namesElement-249113339"; - List names = Arrays.asList(namesElement); - List formattedShelves = new ArrayList<>(); - - client.findRelatedBooks(formattedNames, formattedShelves); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void getBigBookTest() throws Exception { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigBookTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - Book actualResponse = - client.getBigBookAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBigBookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - client.getBigBookAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - - @Test - @SuppressWarnings("all") - public void getBigBookTest2() throws Exception { - BookName name2 = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String author = "author-1406328437"; - String title = "title110371416"; - boolean read = true; - Book expectedResponse = Book.newBuilder() - .setName(name2.toString()) - .setAuthor(author) - .setTitle(title) - .setRead(read) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigBookTest2") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - Book actualResponse = - client.getBigBookAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBigBookExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - client.getBigBookAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - - @Test - @SuppressWarnings("all") - public void getBigNothingTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigNothingTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - Empty actualResponse = - client.getBigNothingAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBigNothingExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - client.getBigNothingAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - - @Test - @SuppressWarnings("all") - public void getBigNothingTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("getBigNothingTest2") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); - - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - Empty actualResponse = - client.getBigNothingAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void getBigNothingExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - BookName name = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - - client.getBigNothingAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - - @Test - @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest() { - TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - TestOptionalRequiredFlatteningParamsResponse actualResponse = - client.testOptionalRequiredFlatteningParams(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - client.testOptionalRequiredFlatteningParams(); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest2() { - TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0F; - double requiredSingularDouble = 1.9111005E8; - boolean requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedInt64 = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedBool = new ArrayList<>(); - List requiredRepeatedEnum = new ArrayList<>(); - List requiredRepeatedString = new ArrayList<>(); - List requiredRepeatedBytes = new ArrayList<>(); - List requiredRepeatedMessage = new ArrayList<>(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - Any requiredAnyValue = Any.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - Value requiredValueValue = Value.newBuilder().build(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - Duration requiredDurationValue = Duration.newBuilder().build(); - FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - List requiredRepeatedStructValue = new ArrayList<>(); - List requiredRepeatedValueValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - List requiredRepeatedFloatValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List requiredRepeatedBoolValue = new ArrayList<>(); - List requiredRepeatedBytesValue = new ArrayList<>(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8F; - double optionalSingularDouble = 1.41902287E8; - boolean optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - List optionalRepeatedInt32 = new ArrayList<>(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFloat = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - List optionalRepeatedBool = new ArrayList<>(); - List optionalRepeatedEnum = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedMessage = new ArrayList<>(); - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - Map optionalMap = new HashMap<>(); - Any anyValue = Any.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Value valueValue = Value.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - Duration durationValue = Duration.newBuilder().build(); - FieldMask fieldMaskValue = FieldMask.newBuilder().build(); - Int32Value int32Value = Int32Value.newBuilder().build(); - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Int64Value int64Value = Int64Value.newBuilder().build(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - FloatValue floatValue = FloatValue.newBuilder().build(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - StringValue stringValue = StringValue.newBuilder().build(); - BoolValue boolValue = BoolValue.newBuilder().build(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedAnyValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List repeatedValueValue = new ArrayList<>(); - List repeatedListValueValue = new ArrayList<>(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedDurationValue = new ArrayList<>(); - List repeatedFieldMaskValue = new ArrayList<>(); - List repeatedInt32Value = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - List repeatedFloatValue = new ArrayList<>(); - List repeatedDoubleValue = new ArrayList<>(); - List repeatedStringValue = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - - TestOptionalRequiredFlatteningParamsResponse actualResponse = - client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - - Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); - Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); - Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); - Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); - Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); - Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); - Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); - Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); - Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); - Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); - Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); - Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); - Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); - Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); - Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); - Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); - Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); - Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); - Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); - Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); - Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); - Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); - Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); - Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); - Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); - Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); - Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); - Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); - Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); - Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); - Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); - Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); - Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); - Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); - Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); - Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); - Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); - Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); - Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); - Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); - Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); - Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); - Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); - Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); - Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); - Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); - Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); - Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); - Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); - Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); - Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); - Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); - Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); - Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); - Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); - Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); - Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); - Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); - Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); - Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); - Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); - Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); - Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); - Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); - Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); - Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); - Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); - Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); - Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); - Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); - Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); - Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); - Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); - Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); - Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); - Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); - Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); - Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); - Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); - Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); - Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); - Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); - Assert.assertEquals(anyValue, actualRequest.getAnyValue()); - Assert.assertEquals(structValue, actualRequest.getStructValue()); - Assert.assertEquals(valueValue, actualRequest.getValueValue()); - Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); - Assert.assertEquals(timeValue, actualRequest.getTimeValue()); - Assert.assertEquals(durationValue, actualRequest.getDurationValue()); - Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); - Assert.assertEquals(int32Value, actualRequest.getInt32Value()); - Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); - Assert.assertEquals(int64Value, actualRequest.getInt64Value()); - Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); - Assert.assertEquals(floatValue, actualRequest.getFloatValue()); - Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); - Assert.assertEquals(stringValue, actualRequest.getStringValue()); - Assert.assertEquals(boolValue, actualRequest.getBoolValue()); - Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); - Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); - Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); - Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); - Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); - Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); - Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); - Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); - Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); - Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); - Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); - Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); - Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); - Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); - Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); - Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); - Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0F; - double requiredSingularDouble = 1.9111005E8; - boolean requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedInt64 = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedBool = new ArrayList<>(); - List requiredRepeatedEnum = new ArrayList<>(); - List requiredRepeatedString = new ArrayList<>(); - List requiredRepeatedBytes = new ArrayList<>(); - List requiredRepeatedMessage = new ArrayList<>(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - Any requiredAnyValue = Any.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - Value requiredValueValue = Value.newBuilder().build(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - Duration requiredDurationValue = Duration.newBuilder().build(); - FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - List requiredRepeatedStructValue = new ArrayList<>(); - List requiredRepeatedValueValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - List requiredRepeatedFloatValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List requiredRepeatedBoolValue = new ArrayList<>(); - List requiredRepeatedBytesValue = new ArrayList<>(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8F; - double optionalSingularDouble = 1.41902287E8; - boolean optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - List optionalRepeatedInt32 = new ArrayList<>(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFloat = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - List optionalRepeatedBool = new ArrayList<>(); - List optionalRepeatedEnum = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedMessage = new ArrayList<>(); - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - Map optionalMap = new HashMap<>(); - Any anyValue = Any.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Value valueValue = Value.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - Duration durationValue = Duration.newBuilder().build(); - FieldMask fieldMaskValue = FieldMask.newBuilder().build(); - Int32Value int32Value = Int32Value.newBuilder().build(); - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Int64Value int64Value = Int64Value.newBuilder().build(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - FloatValue floatValue = FloatValue.newBuilder().build(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - StringValue stringValue = StringValue.newBuilder().build(); - BoolValue boolValue = BoolValue.newBuilder().build(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedAnyValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List repeatedValueValue = new ArrayList<>(); - List repeatedListValueValue = new ArrayList<>(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedDurationValue = new ArrayList<>(); - List repeatedFieldMaskValue = new ArrayList<>(); - List repeatedInt32Value = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - List repeatedFloatValue = new ArrayList<>(); - List repeatedDoubleValue = new ArrayList<>(); - List repeatedStringValue = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - - client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsTest3() { - TestOptionalRequiredFlatteningParamsResponse expectedResponse = TestOptionalRequiredFlatteningParamsResponse.newBuilder().build(); - mockLibraryService.addResponse(expectedResponse); - - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0F; - double requiredSingularDouble = 1.9111005E8; - boolean requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedInt64 = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedBool = new ArrayList<>(); - List requiredRepeatedEnum = new ArrayList<>(); - List requiredRepeatedString = new ArrayList<>(); - List requiredRepeatedBytes = new ArrayList<>(); - List requiredRepeatedMessage = new ArrayList<>(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - Any requiredAnyValue = Any.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - Value requiredValueValue = Value.newBuilder().build(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - Duration requiredDurationValue = Duration.newBuilder().build(); - FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - List requiredRepeatedStructValue = new ArrayList<>(); - List requiredRepeatedValueValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - List requiredRepeatedFloatValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List requiredRepeatedBoolValue = new ArrayList<>(); - List requiredRepeatedBytesValue = new ArrayList<>(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8F; - double optionalSingularDouble = 1.41902287E8; - boolean optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - List optionalRepeatedInt32 = new ArrayList<>(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFloat = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - List optionalRepeatedBool = new ArrayList<>(); - List optionalRepeatedEnum = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedMessage = new ArrayList<>(); - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - Map optionalMap = new HashMap<>(); - Any anyValue = Any.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Value valueValue = Value.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - Duration durationValue = Duration.newBuilder().build(); - FieldMask fieldMaskValue = FieldMask.newBuilder().build(); - Int32Value int32Value = Int32Value.newBuilder().build(); - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Int64Value int64Value = Int64Value.newBuilder().build(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - FloatValue floatValue = FloatValue.newBuilder().build(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - StringValue stringValue = StringValue.newBuilder().build(); - BoolValue boolValue = BoolValue.newBuilder().build(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedAnyValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List repeatedValueValue = new ArrayList<>(); - List repeatedListValueValue = new ArrayList<>(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedDurationValue = new ArrayList<>(); - List repeatedFieldMaskValue = new ArrayList<>(); - List repeatedInt32Value = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - List repeatedFloatValue = new ArrayList<>(); - List repeatedDoubleValue = new ArrayList<>(); - List repeatedStringValue = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - - TestOptionalRequiredFlatteningParamsResponse actualResponse = - client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - - Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); - Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); - Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); - Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); - Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); - Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); - Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); - Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); - Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); - Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); - Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); - Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); - Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); - Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); - Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); - Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); - Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); - Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); - Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); - Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); - Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); - Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); - Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); - Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); - Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); - Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); - Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); - Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); - Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); - Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); - Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); - Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); - Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); - Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); - Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); - Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); - Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); - Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); - Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); - Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); - Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); - Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); - Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); - Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); - Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); - Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); - Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); - Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); - Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); - Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); - Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); - Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); - Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); - Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); - Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); - Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); - Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); - Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); - Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); - Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); - Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); - Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); - Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); - Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); - Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); - Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); - Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); - Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); - Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); - Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); - Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); - Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); - Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); - Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); - Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); - Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); - Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); - Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); - Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); - Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); - Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); - Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); - Assert.assertEquals(anyValue, actualRequest.getAnyValue()); - Assert.assertEquals(structValue, actualRequest.getStructValue()); - Assert.assertEquals(valueValue, actualRequest.getValueValue()); - Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); - Assert.assertEquals(timeValue, actualRequest.getTimeValue()); - Assert.assertEquals(durationValue, actualRequest.getDurationValue()); - Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); - Assert.assertEquals(int32Value, actualRequest.getInt32Value()); - Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); - Assert.assertEquals(int64Value, actualRequest.getInt64Value()); - Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); - Assert.assertEquals(floatValue, actualRequest.getFloatValue()); - Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); - Assert.assertEquals(stringValue, actualRequest.getStringValue()); - Assert.assertEquals(boolValue, actualRequest.getBoolValue()); - Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); - Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); - Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); - Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); - Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); - Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); - Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); - Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); - Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); - Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); - Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); - Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); - Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); - Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); - Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); - Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); - Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void testOptionalRequiredFlatteningParamsExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0F; - double requiredSingularDouble = 1.9111005E8; - boolean requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - List requiredRepeatedInt32 = new ArrayList<>(); - List requiredRepeatedInt64 = new ArrayList<>(); - List requiredRepeatedFloat = new ArrayList<>(); - List requiredRepeatedDouble = new ArrayList<>(); - List requiredRepeatedBool = new ArrayList<>(); - List requiredRepeatedEnum = new ArrayList<>(); - List requiredRepeatedString = new ArrayList<>(); - List requiredRepeatedBytes = new ArrayList<>(); - List requiredRepeatedMessage = new ArrayList<>(); - List formattedRequiredRepeatedResourceName = new ArrayList<>(); - List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); - List requiredRepeatedResourceNameCommon = new ArrayList<>(); - List requiredRepeatedFixed32 = new ArrayList<>(); - List requiredRepeatedFixed64 = new ArrayList<>(); - Map requiredMap = new HashMap<>(); - Any requiredAnyValue = Any.newBuilder().build(); - Struct requiredStructValue = Struct.newBuilder().build(); - Value requiredValueValue = Value.newBuilder().build(); - ListValue requiredListValueValue = ListValue.newBuilder().build(); - Timestamp requiredTimeValue = Timestamp.newBuilder().build(); - Duration requiredDurationValue = Duration.newBuilder().build(); - FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); - Int32Value requiredInt32Value = Int32Value.newBuilder().build(); - UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); - Int64Value requiredInt64Value = Int64Value.newBuilder().build(); - UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); - FloatValue requiredFloatValue = FloatValue.newBuilder().build(); - DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); - StringValue requiredStringValue = StringValue.newBuilder().build(); - BoolValue requiredBoolValue = BoolValue.newBuilder().build(); - BytesValue requiredBytesValue = BytesValue.newBuilder().build(); - List requiredRepeatedAnyValue = new ArrayList<>(); - List requiredRepeatedStructValue = new ArrayList<>(); - List requiredRepeatedValueValue = new ArrayList<>(); - List requiredRepeatedListValueValue = new ArrayList<>(); - List requiredRepeatedTimeValue = new ArrayList<>(); - List requiredRepeatedDurationValue = new ArrayList<>(); - List requiredRepeatedFieldMaskValue = new ArrayList<>(); - List requiredRepeatedInt32Value = new ArrayList<>(); - List requiredRepeatedUint32Value = new ArrayList<>(); - List requiredRepeatedInt64Value = new ArrayList<>(); - List requiredRepeatedUint64Value = new ArrayList<>(); - List requiredRepeatedFloatValue = new ArrayList<>(); - List requiredRepeatedDoubleValue = new ArrayList<>(); - List requiredRepeatedStringValue = new ArrayList<>(); - List requiredRepeatedBoolValue = new ArrayList<>(); - List requiredRepeatedBytesValue = new ArrayList<>(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8F; - double optionalSingularDouble = 1.41902287E8; - boolean optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; - String optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); - String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - List optionalRepeatedInt32 = new ArrayList<>(); - List optionalRepeatedInt64 = new ArrayList<>(); - List optionalRepeatedFloat = new ArrayList<>(); - List optionalRepeatedDouble = new ArrayList<>(); - List optionalRepeatedBool = new ArrayList<>(); - List optionalRepeatedEnum = new ArrayList<>(); - List optionalRepeatedString = new ArrayList<>(); - List optionalRepeatedBytes = new ArrayList<>(); - List optionalRepeatedMessage = new ArrayList<>(); - List formattedOptionalRepeatedResourceName = new ArrayList<>(); - List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); - List optionalRepeatedResourceNameCommon = new ArrayList<>(); - List optionalRepeatedFixed32 = new ArrayList<>(); - List optionalRepeatedFixed64 = new ArrayList<>(); - Map optionalMap = new HashMap<>(); - Any anyValue = Any.newBuilder().build(); - Struct structValue = Struct.newBuilder().build(); - Value valueValue = Value.newBuilder().build(); - ListValue listValueValue = ListValue.newBuilder().build(); - Timestamp timeValue = Timestamp.newBuilder().build(); - Duration durationValue = Duration.newBuilder().build(); - FieldMask fieldMaskValue = FieldMask.newBuilder().build(); - Int32Value int32Value = Int32Value.newBuilder().build(); - UInt32Value uint32Value = UInt32Value.newBuilder().build(); - Int64Value int64Value = Int64Value.newBuilder().build(); - UInt64Value uint64Value = UInt64Value.newBuilder().build(); - FloatValue floatValue = FloatValue.newBuilder().build(); - DoubleValue doubleValue = DoubleValue.newBuilder().build(); - StringValue stringValue = StringValue.newBuilder().build(); - BoolValue boolValue = BoolValue.newBuilder().build(); - BytesValue bytesValue = BytesValue.newBuilder().build(); - List repeatedAnyValue = new ArrayList<>(); - List repeatedStructValue = new ArrayList<>(); - List repeatedValueValue = new ArrayList<>(); - List repeatedListValueValue = new ArrayList<>(); - List repeatedTimeValue = new ArrayList<>(); - List repeatedDurationValue = new ArrayList<>(); - List repeatedFieldMaskValue = new ArrayList<>(); - List repeatedInt32Value = new ArrayList<>(); - List repeatedUint32Value = new ArrayList<>(); - List repeatedInt64Value = new ArrayList<>(); - List repeatedUint64Value = new ArrayList<>(); - List repeatedFloatValue = new ArrayList<>(); - List repeatedDoubleValue = new ArrayList<>(); - List repeatedStringValue = new ArrayList<>(); - List repeatedBoolValue = new ArrayList<>(); - List repeatedBytesValue = new ArrayList<>(); - - client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest2() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName source = ShelfName.of("[SHELF_ID]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName source = ShelfName.of("[SHELF_ID]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest3() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ProjectName source = ProjectName.of("[PROJECT]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ProjectName source = ProjectName.of("[PROJECT]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest4() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest5() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest5() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest6() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName source = ShelfName.of("[SHELF_ID]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest6() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName source = ShelfName.of("[SHELF_ID]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest7() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName source = ShelfName.of("[SHELF_ID]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest7() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName source = ShelfName.of("[SHELF_ID]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest8() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ProjectName source = ProjectName.of("[PROJECT]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest8() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ProjectName source = ProjectName.of("[PROJECT]"); - ArchiveName destination = ArchiveName.of("[ARCHIVE]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest9() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ProjectName source = ProjectName.of("[PROJECT]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void moveBooksExceptionTest9() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ProjectName source = ProjectName.of("[PROJECT]"); - ShelfName destination = ShelfName.of("[SHELF_ID]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); - - client.moveBooks(source, destination, formattedPublishers, project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void moveBooksTest10() { - boolean success = false; - MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0F; + double requiredSingularDouble = 1.9111005E8; + boolean requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedInt64 = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedBool = new ArrayList<>(); + List requiredRepeatedEnum = new ArrayList<>(); + List requiredRepeatedString = new ArrayList<>(); + List requiredRepeatedBytes = new ArrayList<>(); + List requiredRepeatedMessage = new ArrayList<>(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + Any requiredAnyValue = Any.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + Value requiredValueValue = Value.newBuilder().build(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + Duration requiredDurationValue = Duration.newBuilder().build(); + FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + List requiredRepeatedStructValue = new ArrayList<>(); + List requiredRepeatedValueValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + List requiredRepeatedFloatValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List requiredRepeatedBoolValue = new ArrayList<>(); + List requiredRepeatedBytesValue = new ArrayList<>(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8F; + double optionalSingularDouble = 1.41902287E8; + boolean optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + List optionalRepeatedInt32 = new ArrayList<>(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFloat = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + List optionalRepeatedBool = new ArrayList<>(); + List optionalRepeatedEnum = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedMessage = new ArrayList<>(); + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + Map optionalMap = new HashMap<>(); + Any anyValue = Any.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Value valueValue = Value.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + Duration durationValue = Duration.newBuilder().build(); + FieldMask fieldMaskValue = FieldMask.newBuilder().build(); + Int32Value int32Value = Int32Value.newBuilder().build(); + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Int64Value int64Value = Int64Value.newBuilder().build(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + FloatValue floatValue = FloatValue.newBuilder().build(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + StringValue stringValue = StringValue.newBuilder().build(); + BoolValue boolValue = BoolValue.newBuilder().build(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedAnyValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List repeatedValueValue = new ArrayList<>(); + List repeatedListValueValue = new ArrayList<>(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedDurationValue = new ArrayList<>(); + List repeatedFieldMaskValue = new ArrayList<>(); + List repeatedInt32Value = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + List repeatedFloatValue = new ArrayList<>(); + List repeatedDoubleValue = new ArrayList<>(); + List repeatedStringValue = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); - MoveBooksResponse actualResponse = - client.moveBooks(source, destination, formattedPublishers, project); + TestOptionalRequiredFlatteningParamsResponse actualResponse = + client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); + TestOptionalRequiredFlatteningParamsRequest actualRequest = (TestOptionalRequiredFlatteningParamsRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertEquals(requiredSingularInt32, actualRequest.getRequiredSingularInt32()); + Assert.assertEquals(requiredSingularInt64, actualRequest.getRequiredSingularInt64()); + Assert.assertEquals(requiredSingularFloat, actualRequest.getRequiredSingularFloat()); + Assert.assertEquals(requiredSingularDouble, actualRequest.getRequiredSingularDouble()); + Assert.assertEquals(requiredSingularBool, actualRequest.getRequiredSingularBool()); + Assert.assertEquals(requiredSingularEnum, actualRequest.getRequiredSingularEnum()); + Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); + Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); + Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); + Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); + Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); + Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); + Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); + Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); + Assert.assertEquals(requiredRepeatedInt64, actualRequest.getRequiredRepeatedInt64List()); + Assert.assertEquals(requiredRepeatedFloat, actualRequest.getRequiredRepeatedFloatList()); + Assert.assertEquals(requiredRepeatedDouble, actualRequest.getRequiredRepeatedDoubleList()); + Assert.assertEquals(requiredRepeatedBool, actualRequest.getRequiredRepeatedBoolList()); + Assert.assertEquals(requiredRepeatedEnum, actualRequest.getRequiredRepeatedEnumList()); + Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); + Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); + Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); + Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); + Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); + Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); + Assert.assertEquals(requiredAnyValue, actualRequest.getRequiredAnyValue()); + Assert.assertEquals(requiredStructValue, actualRequest.getRequiredStructValue()); + Assert.assertEquals(requiredValueValue, actualRequest.getRequiredValueValue()); + Assert.assertEquals(requiredListValueValue, actualRequest.getRequiredListValueValue()); + Assert.assertEquals(requiredTimeValue, actualRequest.getRequiredTimeValue()); + Assert.assertEquals(requiredDurationValue, actualRequest.getRequiredDurationValue()); + Assert.assertEquals(requiredFieldMaskValue, actualRequest.getRequiredFieldMaskValue()); + Assert.assertEquals(requiredInt32Value, actualRequest.getRequiredInt32Value()); + Assert.assertEquals(requiredUint32Value, actualRequest.getRequiredUint32Value()); + Assert.assertEquals(requiredInt64Value, actualRequest.getRequiredInt64Value()); + Assert.assertEquals(requiredUint64Value, actualRequest.getRequiredUint64Value()); + Assert.assertEquals(requiredFloatValue, actualRequest.getRequiredFloatValue()); + Assert.assertEquals(requiredDoubleValue, actualRequest.getRequiredDoubleValue()); + Assert.assertEquals(requiredStringValue, actualRequest.getRequiredStringValue()); + Assert.assertEquals(requiredBoolValue, actualRequest.getRequiredBoolValue()); + Assert.assertEquals(requiredBytesValue, actualRequest.getRequiredBytesValue()); + Assert.assertEquals(requiredRepeatedAnyValue, actualRequest.getRequiredRepeatedAnyValueList()); + Assert.assertEquals(requiredRepeatedStructValue, actualRequest.getRequiredRepeatedStructValueList()); + Assert.assertEquals(requiredRepeatedValueValue, actualRequest.getRequiredRepeatedValueValueList()); + Assert.assertEquals(requiredRepeatedListValueValue, actualRequest.getRequiredRepeatedListValueValueList()); + Assert.assertEquals(requiredRepeatedTimeValue, actualRequest.getRequiredRepeatedTimeValueList()); + Assert.assertEquals(requiredRepeatedDurationValue, actualRequest.getRequiredRepeatedDurationValueList()); + Assert.assertEquals(requiredRepeatedFieldMaskValue, actualRequest.getRequiredRepeatedFieldMaskValueList()); + Assert.assertEquals(requiredRepeatedInt32Value, actualRequest.getRequiredRepeatedInt32ValueList()); + Assert.assertEquals(requiredRepeatedUint32Value, actualRequest.getRequiredRepeatedUint32ValueList()); + Assert.assertEquals(requiredRepeatedInt64Value, actualRequest.getRequiredRepeatedInt64ValueList()); + Assert.assertEquals(requiredRepeatedUint64Value, actualRequest.getRequiredRepeatedUint64ValueList()); + Assert.assertEquals(requiredRepeatedFloatValue, actualRequest.getRequiredRepeatedFloatValueList()); + Assert.assertEquals(requiredRepeatedDoubleValue, actualRequest.getRequiredRepeatedDoubleValueList()); + Assert.assertEquals(requiredRepeatedStringValue, actualRequest.getRequiredRepeatedStringValueList()); + Assert.assertEquals(requiredRepeatedBoolValue, actualRequest.getRequiredRepeatedBoolValueList()); + Assert.assertEquals(requiredRepeatedBytesValue, actualRequest.getRequiredRepeatedBytesValueList()); + Assert.assertEquals(optionalSingularInt32, actualRequest.getOptionalSingularInt32()); + Assert.assertEquals(optionalSingularInt64, actualRequest.getOptionalSingularInt64()); + Assert.assertEquals(optionalSingularFloat, actualRequest.getOptionalSingularFloat()); + Assert.assertEquals(optionalSingularDouble, actualRequest.getOptionalSingularDouble()); + Assert.assertEquals(optionalSingularBool, actualRequest.getOptionalSingularBool()); + Assert.assertEquals(optionalSingularEnum, actualRequest.getOptionalSingularEnum()); + Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); + Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); + Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); + Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); + Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); + Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); + Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); + Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); + Assert.assertEquals(optionalRepeatedInt64, actualRequest.getOptionalRepeatedInt64List()); + Assert.assertEquals(optionalRepeatedFloat, actualRequest.getOptionalRepeatedFloatList()); + Assert.assertEquals(optionalRepeatedDouble, actualRequest.getOptionalRepeatedDoubleList()); + Assert.assertEquals(optionalRepeatedBool, actualRequest.getOptionalRepeatedBoolList()); + Assert.assertEquals(optionalRepeatedEnum, actualRequest.getOptionalRepeatedEnumList()); + Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); + Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); + Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); + Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); + Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); + Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); + Assert.assertEquals(anyValue, actualRequest.getAnyValue()); + Assert.assertEquals(structValue, actualRequest.getStructValue()); + Assert.assertEquals(valueValue, actualRequest.getValueValue()); + Assert.assertEquals(listValueValue, actualRequest.getListValueValue()); + Assert.assertEquals(timeValue, actualRequest.getTimeValue()); + Assert.assertEquals(durationValue, actualRequest.getDurationValue()); + Assert.assertEquals(fieldMaskValue, actualRequest.getFieldMaskValue()); + Assert.assertEquals(int32Value, actualRequest.getInt32Value()); + Assert.assertEquals(uint32Value, actualRequest.getUint32Value()); + Assert.assertEquals(int64Value, actualRequest.getInt64Value()); + Assert.assertEquals(uint64Value, actualRequest.getUint64Value()); + Assert.assertEquals(floatValue, actualRequest.getFloatValue()); + Assert.assertEquals(doubleValue, actualRequest.getDoubleValue()); + Assert.assertEquals(stringValue, actualRequest.getStringValue()); + Assert.assertEquals(boolValue, actualRequest.getBoolValue()); + Assert.assertEquals(bytesValue, actualRequest.getBytesValue()); + Assert.assertEquals(repeatedAnyValue, actualRequest.getRepeatedAnyValueList()); + Assert.assertEquals(repeatedStructValue, actualRequest.getRepeatedStructValueList()); + Assert.assertEquals(repeatedValueValue, actualRequest.getRepeatedValueValueList()); + Assert.assertEquals(repeatedListValueValue, actualRequest.getRepeatedListValueValueList()); + Assert.assertEquals(repeatedTimeValue, actualRequest.getRepeatedTimeValueList()); + Assert.assertEquals(repeatedDurationValue, actualRequest.getRepeatedDurationValueList()); + Assert.assertEquals(repeatedFieldMaskValue, actualRequest.getRepeatedFieldMaskValueList()); + Assert.assertEquals(repeatedInt32Value, actualRequest.getRepeatedInt32ValueList()); + Assert.assertEquals(repeatedUint32Value, actualRequest.getRepeatedUint32ValueList()); + Assert.assertEquals(repeatedInt64Value, actualRequest.getRepeatedInt64ValueList()); + Assert.assertEquals(repeatedUint64Value, actualRequest.getRepeatedUint64ValueList()); + Assert.assertEquals(repeatedFloatValue, actualRequest.getRepeatedFloatValueList()); + Assert.assertEquals(repeatedDoubleValue, actualRequest.getRepeatedDoubleValueList()); + Assert.assertEquals(repeatedStringValue, actualRequest.getRepeatedStringValueList()); + Assert.assertEquals(repeatedBoolValue, actualRequest.getRepeatedBoolValueList()); + Assert.assertEquals(repeatedBytesValue, actualRequest.getRepeatedBytesValueList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18695,17 +16551,135 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void moveBooksExceptionTest10() throws Exception { + public void testOptionalRequiredFlatteningParamsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ProjectName destination = ProjectName.of("[PROJECT]"); - List formattedPublishers = new ArrayList<>(); - ProjectName project = ProjectName.of("[PROJECT]"); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0F; + double requiredSingularDouble = 1.9111005E8; + boolean requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.copyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName requiredSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + List requiredRepeatedInt32 = new ArrayList<>(); + List requiredRepeatedInt64 = new ArrayList<>(); + List requiredRepeatedFloat = new ArrayList<>(); + List requiredRepeatedDouble = new ArrayList<>(); + List requiredRepeatedBool = new ArrayList<>(); + List requiredRepeatedEnum = new ArrayList<>(); + List requiredRepeatedString = new ArrayList<>(); + List requiredRepeatedBytes = new ArrayList<>(); + List requiredRepeatedMessage = new ArrayList<>(); + List formattedRequiredRepeatedResourceName = new ArrayList<>(); + List formattedRequiredRepeatedResourceNameOneof = new ArrayList<>(); + List requiredRepeatedResourceNameCommon = new ArrayList<>(); + List requiredRepeatedFixed32 = new ArrayList<>(); + List requiredRepeatedFixed64 = new ArrayList<>(); + Map requiredMap = new HashMap<>(); + Any requiredAnyValue = Any.newBuilder().build(); + Struct requiredStructValue = Struct.newBuilder().build(); + Value requiredValueValue = Value.newBuilder().build(); + ListValue requiredListValueValue = ListValue.newBuilder().build(); + Timestamp requiredTimeValue = Timestamp.newBuilder().build(); + Duration requiredDurationValue = Duration.newBuilder().build(); + FieldMask requiredFieldMaskValue = FieldMask.newBuilder().build(); + Int32Value requiredInt32Value = Int32Value.newBuilder().build(); + UInt32Value requiredUint32Value = UInt32Value.newBuilder().build(); + Int64Value requiredInt64Value = Int64Value.newBuilder().build(); + UInt64Value requiredUint64Value = UInt64Value.newBuilder().build(); + FloatValue requiredFloatValue = FloatValue.newBuilder().build(); + DoubleValue requiredDoubleValue = DoubleValue.newBuilder().build(); + StringValue requiredStringValue = StringValue.newBuilder().build(); + BoolValue requiredBoolValue = BoolValue.newBuilder().build(); + BytesValue requiredBytesValue = BytesValue.newBuilder().build(); + List requiredRepeatedAnyValue = new ArrayList<>(); + List requiredRepeatedStructValue = new ArrayList<>(); + List requiredRepeatedValueValue = new ArrayList<>(); + List requiredRepeatedListValueValue = new ArrayList<>(); + List requiredRepeatedTimeValue = new ArrayList<>(); + List requiredRepeatedDurationValue = new ArrayList<>(); + List requiredRepeatedFieldMaskValue = new ArrayList<>(); + List requiredRepeatedInt32Value = new ArrayList<>(); + List requiredRepeatedUint32Value = new ArrayList<>(); + List requiredRepeatedInt64Value = new ArrayList<>(); + List requiredRepeatedUint64Value = new ArrayList<>(); + List requiredRepeatedFloatValue = new ArrayList<>(); + List requiredRepeatedDoubleValue = new ArrayList<>(); + List requiredRepeatedStringValue = new ArrayList<>(); + List requiredRepeatedBoolValue = new ArrayList<>(); + List requiredRepeatedBytesValue = new ArrayList<>(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8F; + double optionalSingularDouble = 1.41902287E8; + boolean optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.InnerEnum.ZERO; + String optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.copyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); + BookName optionalSingularResourceName = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF_ID]", "[BOOK]"); + String optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + List optionalRepeatedInt32 = new ArrayList<>(); + List optionalRepeatedInt64 = new ArrayList<>(); + List optionalRepeatedFloat = new ArrayList<>(); + List optionalRepeatedDouble = new ArrayList<>(); + List optionalRepeatedBool = new ArrayList<>(); + List optionalRepeatedEnum = new ArrayList<>(); + List optionalRepeatedString = new ArrayList<>(); + List optionalRepeatedBytes = new ArrayList<>(); + List optionalRepeatedMessage = new ArrayList<>(); + List formattedOptionalRepeatedResourceName = new ArrayList<>(); + List formattedOptionalRepeatedResourceNameOneof = new ArrayList<>(); + List optionalRepeatedResourceNameCommon = new ArrayList<>(); + List optionalRepeatedFixed32 = new ArrayList<>(); + List optionalRepeatedFixed64 = new ArrayList<>(); + Map optionalMap = new HashMap<>(); + Any anyValue = Any.newBuilder().build(); + Struct structValue = Struct.newBuilder().build(); + Value valueValue = Value.newBuilder().build(); + ListValue listValueValue = ListValue.newBuilder().build(); + Timestamp timeValue = Timestamp.newBuilder().build(); + Duration durationValue = Duration.newBuilder().build(); + FieldMask fieldMaskValue = FieldMask.newBuilder().build(); + Int32Value int32Value = Int32Value.newBuilder().build(); + UInt32Value uint32Value = UInt32Value.newBuilder().build(); + Int64Value int64Value = Int64Value.newBuilder().build(); + UInt64Value uint64Value = UInt64Value.newBuilder().build(); + FloatValue floatValue = FloatValue.newBuilder().build(); + DoubleValue doubleValue = DoubleValue.newBuilder().build(); + StringValue stringValue = StringValue.newBuilder().build(); + BoolValue boolValue = BoolValue.newBuilder().build(); + BytesValue bytesValue = BytesValue.newBuilder().build(); + List repeatedAnyValue = new ArrayList<>(); + List repeatedStructValue = new ArrayList<>(); + List repeatedValueValue = new ArrayList<>(); + List repeatedListValueValue = new ArrayList<>(); + List repeatedTimeValue = new ArrayList<>(); + List repeatedDurationValue = new ArrayList<>(); + List repeatedFieldMaskValue = new ArrayList<>(); + List repeatedInt32Value = new ArrayList<>(); + List repeatedUint32Value = new ArrayList<>(); + List repeatedInt64Value = new ArrayList<>(); + List repeatedUint64Value = new ArrayList<>(); + List repeatedFloatValue = new ArrayList<>(); + List repeatedDoubleValue = new ArrayList<>(); + List repeatedStringValue = new ArrayList<>(); + List repeatedBoolValue = new ArrayList<>(); + List repeatedBytesValue = new ArrayList<>(); - client.moveBooks(source, destination, formattedPublishers, project); + client.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18714,26 +16688,30 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void archiveBooksTest() { + public void moveBooksTest() { boolean success = false; - ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() + MoveBooksResponse expectedResponse = MoveBooksResponse.newBuilder() .setSuccess(success) .build(); mockLibraryService.addResponse(expectedResponse); ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - ArchiveBooksResponse actualResponse = - client.archiveBooks(source, archive); + MoveBooksResponse actualResponse = + client.moveBooks(source, destination, formattedPublishers, project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); + MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); - Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, actualRequest.getProject()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -18742,105 +16720,17 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void archiveBooksExceptionTest() throws Exception { + public void moveBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); try { ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - client.archiveBooks(source, archive); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void archiveBooksTest2() { - boolean success = false; - ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ShelfName source = ShelfName.of("[SHELF_ID]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - ArchiveBooksResponse actualResponse = - client.archiveBooks(source, archive); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, ShelfName.parse(actualRequest.getSource())); - Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void archiveBooksExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName source = ShelfName.of("[SHELF_ID]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - client.archiveBooks(source, archive); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void archiveBooksTest3() { - boolean success = false; - ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - mockLibraryService.addResponse(expectedResponse); - - ProjectName source = ProjectName.of("[PROJECT]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - ArchiveBooksResponse actualResponse = - client.archiveBooks(source, archive); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, ProjectName.parse(actualRequest.getSource())); - Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void archiveBooksExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ProjectName source = ProjectName.of("[PROJECT]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - client.archiveBooks(source, archive); + client.moveBooks(source, destination, formattedPublishers, project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -18849,7 +16739,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void archiveBooksTest4() { + public void archiveBooksTest() { boolean success = false; ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() .setSuccess(success) @@ -18877,7 +16767,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void archiveBooksExceptionTest4() throws Exception { + public void archiveBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); @@ -18918,168 +16808,6 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); - Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void longRunningArchiveBooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - client.longRunningArchiveBooksAsync(source, archive).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - - @Test - @SuppressWarnings("all") - public void longRunningArchiveBooksTest2() throws Exception { - boolean success = false; - ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningArchiveBooksTest2") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); - - ShelfName source = ShelfName.of("[SHELF_ID]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - ArchiveBooksResponse actualResponse = - client.longRunningArchiveBooksAsync(source, archive).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, ShelfName.parse(actualRequest.getSource())); - Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void longRunningArchiveBooksExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ShelfName source = ShelfName.of("[SHELF_ID]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - client.longRunningArchiveBooksAsync(source, archive).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - - @Test - @SuppressWarnings("all") - public void longRunningArchiveBooksTest3() throws Exception { - boolean success = false; - ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningArchiveBooksTest3") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); - - ProjectName source = ProjectName.of("[PROJECT]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - ArchiveBooksResponse actualResponse = - client.longRunningArchiveBooksAsync(source, archive).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - - Assert.assertEquals(source, ProjectName.parse(actualRequest.getSource())); - Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void longRunningArchiveBooksExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockLibraryService.addException(exception); - - try { - ProjectName source = ProjectName.of("[PROJECT]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - client.longRunningArchiveBooksAsync(source, archive).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - - @Test - @SuppressWarnings("all") - public void longRunningArchiveBooksTest4() throws Exception { - boolean success = false; - ArchiveBooksResponse expectedResponse = ArchiveBooksResponse.newBuilder() - .setSuccess(success) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningArchiveBooksTest4") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockLibraryService.addResponse(resultOperation); - - ArchiveName source = ArchiveName.of("[ARCHIVE]"); - ArchiveName archive = ArchiveName.of("[ARCHIVE]"); - - ArchiveBooksResponse actualResponse = - client.longRunningArchiveBooksAsync(source, archive).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockLibraryService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); Assert.assertEquals(archive, actualRequest.getArchive()); Assert.assertTrue( @@ -19090,7 +16818,7 @@ public class LibraryClientTest { @Test @SuppressWarnings("all") - public void longRunningArchiveBooksExceptionTest4() throws Exception { + public void longRunningArchiveBooksExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockLibraryService.addException(exception); From eaf138b73e800d3c547f0c6d0b2a8328fbfb8044 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Fri, 24 Jan 2020 12:25:34 -0800 Subject: [PATCH 12/36] wip --- .../transformer/DefaultFeatureConfig.java | 6 ++ .../codegen/transformer/FeatureConfig.java | 6 ++ .../transformer/InitCodeTransformer.java | 8 +- .../testdata/java_library.baseline | 76 +++++++++---------- 4 files changed, 56 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java b/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java index f2d34a6c04..1cadce043b 100644 --- a/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java +++ b/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java @@ -59,6 +59,12 @@ public boolean useResourceNameConverters(FieldConfig fieldConfig) { return !resourceNameProtoAccessorsEnabled() && useResourceNameFormatOption(fieldConfig); } + @Override + public boolean useResourceNameConvertersInSample(MethodContext context, FieldConfig fieldConfig) { + return !resourceNameProtoAccessorsEnabled() + && useResourceNameFormatOptionInSample(context, fieldConfig); + } + @Override public boolean useResourceNameConvertersInSampleOnly( MethodContext context, FieldConfig fieldConfig) { diff --git a/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java b/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java index c9f99459a6..5f3493e6f6 100644 --- a/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java +++ b/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java @@ -48,6 +48,12 @@ public interface FeatureConfig { */ boolean useResourceNameConverters(FieldConfig fieldConfig); + /** + * Returns true if useResourceNameFormatOptionInSample() is true but + * resourceNameProtoAccessorsEnabled() is false. + */ + boolean useResourceNameConvertersInSample(MethodContext context, FieldConfig fieldConfig); + /** * Returns true if useResourceNameFormatOptionInSampleOnly() is true but * resourceNameProtoAccessorsEnabled() is false. diff --git a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java index c9114e5f23..3d02f8a5c1 100644 --- a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java @@ -179,7 +179,9 @@ List generateRequestAssertViews( String expectedValueIdentifier = getVariableName(methodContext, fieldItemTree); String expectedTransformFunction = null; String actualTransformFunction = null; - if (methodContext.getFeatureConfig().useResourceNameFormatOption(fieldConfig)) { + if (methodContext + .getFeatureConfig() + .useResourceNameFormatOptionInSample(methodContext, fieldConfig)) { if (fieldConfig.requiresParamTransformationFromAny()) { expectedTransformFunction = namer.getToStringMethod(); actualTransformFunction = namer.getToStringMethod(); @@ -190,7 +192,9 @@ List generateRequestAssertViews( expectedTransformFunction = namer.getResourceOneofCreateMethod(methodContext.getTypeTable(), fieldConfig); } - } else if (methodContext.getFeatureConfig().useResourceNameConverters(fieldConfig)) { + } else if (methodContext + .getFeatureConfig() + .useResourceNameConvertersInSample(methodContext, fieldConfig)) { if (fieldConfig.getField().isRepeated()) { actualTransformFunction = namer.getResourceTypeParseListMethodName(methodContext.getTypeTable(), fieldConfig); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 3d0aec90bf..3ff227ff5a 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -14962,7 +14962,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15009,7 +15009,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertEquals(message, actualRequest.getMessage()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -15059,7 +15059,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetShelfRequest actualRequest = (GetShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertEquals(message, actualRequest.getMessage()); Assert.assertEquals(stringBuilder, actualRequest.getStringBuilder()); Assert.assertTrue( @@ -15142,7 +15142,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); DeleteShelfRequest actualRequest = (DeleteShelfRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15189,8 +15189,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); MergeShelvesRequest actualRequest = (MergeShelvesRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15240,7 +15240,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); CreateBookRequest actualRequest = (CreateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -15296,7 +15296,7 @@ public class LibraryClientTest { Assert.assertEquals(books, actualRequest.getBooksList()); Assert.assertEquals(edition, actualRequest.getEdition()); Assert.assertEquals(seriesUuid, actualRequest.getSeriesUuid()); - Assert.assertEquals(publisher, actualRequest.getPublisher()); + Assert.assertEquals(publisher, PublisherName.parse(actualRequest.getPublisher())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15351,7 +15351,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15399,7 +15399,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListBooksRequest actualRequest = (ListBooksRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, ShelfName.parse(actualRequest.getName())); Assert.assertEquals(filter, actualRequest.getFilter()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -15438,7 +15438,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15487,7 +15487,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -15541,7 +15541,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -15598,8 +15598,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(otherShelfName, actualRequest.getOtherShelfName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15697,7 +15697,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ListStringsRequest actualRequest = (ListStringsRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15743,7 +15743,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(comments, actualRequest.getCommentsList()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -15802,8 +15802,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromArchiveRequest actualRequest = (GetBookFromArchiveRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(name, ArchivedBookName.parse(actualRequest.getName())); + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15855,10 +15855,10 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(altBookName, actualRequest.getAltBookName()); - Assert.assertEquals(place, actualRequest.getPlace()); - Assert.assertEquals(folder, actualRequest.getFolder()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); + Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); + Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15909,7 +15909,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15950,7 +15950,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(indexName, actualRequest.getIndexName()); Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); Assert.assertTrue( @@ -16176,7 +16176,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16224,7 +16224,7 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16430,8 +16430,8 @@ public class LibraryClientTest { Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredSingularResourceName, BookNames.parse(actualRequest.getRequiredSingularResourceName())); + Assert.assertEquals(requiredSingularResourceNameOneof, BookNames.parse(actualRequest.getRequiredSingularResourceNameOneof())); Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); @@ -16491,8 +16491,8 @@ public class LibraryClientTest { Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(optionalSingularResourceName, BookNames.parse(actualRequest.getOptionalSingularResourceName())); + Assert.assertEquals(optionalSingularResourceNameOneof, BookNames.parse(actualRequest.getOptionalSingularResourceNameOneof())); Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); @@ -16708,10 +16708,10 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination())); Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16757,8 +16757,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16808,8 +16808,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), From 57499a35c5323af957691f7b682799a8edaf8b90 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Fri, 24 Jan 2020 13:46:52 -0800 Subject: [PATCH 13/36] pause --- .../java/com/google/api/codegen/config/FlatteningConfig.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 6188e34def..3a0eb4cc8c 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -71,8 +71,10 @@ private static void insertFlatteningsFromGapicConfig( flatteningConfigs.put( flatteningConfigToString(groupConfig), ImmutableList.of(groupConfig, groupConfig.withResourceNamesInSamplesOnly())); + } else { + flatteningConfigs.put( + flatteningConfigToString(groupConfig), ImmutableList.of(groupConfig)); } - flatteningConfigs.put(flatteningConfigToString(groupConfig), ImmutableList.of(groupConfig)); } } } From a8840a44aa6232aa1db19628a3ba944a098cc664 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Mon, 27 Jan 2020 14:07:22 -0800 Subject: [PATCH 14/36] field config factory --- .../api/codegen/config/FieldConfig.java | 241 ++++++------------ .../codegen/config/FieldConfigFactory.java | 206 +++++++++++++++ .../api/codegen/config/FlatteningConfig.java | 16 +- .../api/codegen/config/GapicMethodConfig.java | 4 - .../codegen/config/GapicProductConfig.java | 5 +- .../api/codegen/config/MethodConfig.java | 2 +- .../codegen/config/PageStreamingConfig.java | 4 +- .../config/ResourceDescriptorConfig.java | 8 - .../transformer/InitCodeTransformer.java | 7 +- .../transformer/TestCaseTransformer.java | 4 + .../csharp/CSharpSurfaceNamer.java | 2 +- 11 files changed, 304 insertions(+), 195 deletions(-) create mode 100644 src/main/java/com/google/api/codegen/config/FieldConfigFactory.java diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index eafa4fd736..14721cf3a5 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -20,20 +20,15 @@ import com.google.api.tools.framework.model.Field; import com.google.api.tools.framework.model.SimpleLocation; import com.google.auto.value.AutoValue; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableListMultimap; +import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.stream.Collectors; import javax.annotation.Nullable; -/** FieldConfig represents a configuration for a Field, derived from the GAPIC config. */ +/** FieldConfig represents a configuration for a Field. */ @AutoValue public abstract class FieldConfig { public abstract FieldModel getField(); @@ -41,11 +36,48 @@ public abstract class FieldConfig { @Nullable public abstract ResourceNameTreatment getResourceNameTreatment(); + /** + * The resource name config used in API surfaces. For resource name fields in a message, + * getResourceNameConfig() always returns null. For flattened resource name fields, + * getResourceNameConfigs() returns the resource name config in the API surface. + * + *

Note a field can have multiple resource names the field has child_type resource reference. + * For example, consider the following case: + * + * option (google.api.resource_defintion) = { + * type: "library.googleapis.com/Book", + * pattern: "projects/{project}/books/{book}", + * pattern: "projects/{project}/locations/{location}/books/{book}" + * }; + * + * rpc ListFoos(ListFoosRequest) returns (ListFoosResponse) { + * option (google.api.method_signature) = "parent"; + * } + * + * message ListFoosRequest { + * string parent = 1 [ + * (google.api.resource_reference).child_type = "library.googleapis.com/Book"] + * } + * + * + *

The field `parent` will have two resource name configs: Project and Location. In this case, + * we need to generate three flattening overloads for the method ListFoos. The method signatures + * and the FieldConfig for the field `parent` has the following mapping: + *

  • method_signature -> (resourceNameConfig, exampleResourceNameConfig, resourceNameTreatment) + *
  • ListFoos(ProjectName parent) -> ("Project", "Project", STATIC_TYPE); + *
  • ListFoos(LocationName parent) -> ("Location", "Location", STATIC_TYPE); + *
  • ListFoos(String parent) -> ("Project", "Project", SAMPLE_ONLY); + *
  • ListFoos(ListFoosRequest request); -> (null, "Project", SAMPLE_ONLY); + */ @Nullable public abstract ResourceNameConfig getResourceNameConfig(); + /** + * The resource name config used in samples and tests. For flattened resource name fields, + * getExampleResourceConfig() and getResourceNameConfig() always return the same config. + */ @Nullable - public abstract ResourceNameConfig getMessageResourceNameConfig(); + public abstract ResourceNameConfig getExampleResourceNameConfig(); public ResourceNameType getResourceNameType() { if (getResourceNameConfig() == null) { @@ -58,7 +90,7 @@ private static FieldConfig createFieldConfig( FieldModel field, ResourceNameTreatment resourceNameTreatment, ResourceNameConfig resourceNameConfig, - ResourceNameConfig messageResourceNameConfig) { + ResourceNameConfig exampleResourceNameConfig) { if (resourceNameTreatment != ResourceNameTreatment.NONE && resourceNameConfig == null) { throw new IllegalArgumentException( "resourceName may only be null if resourceNameTreatment is NONE"); @@ -72,7 +104,7 @@ private static FieldConfig createFieldConfig( .setField(field) .setResourceNameTreatment(resourceNameTreatment) .setResourceNameConfig(resourceNameConfig) - .setMessageResourceNameConfig(messageResourceNameConfig) + .setExampleResourceNameConfig(exampleResourceNameConfig) .build(); } @@ -81,139 +113,6 @@ public static FieldConfig createDefaultFieldConfig(FieldModel field) { return FieldConfig.createFieldConfig(field, ResourceNameTreatment.NONE, null, null); } - static FieldConfig createMessageFieldConfig( - ResourceNameMessageConfigs messageConfigs, - Map resourceNameConfigs, - FieldModel field, - ResourceNameTreatment defaultResourceNameTreatment) { - List configs = - createMessageFieldConfigs( - messageConfigs, resourceNameConfigs, field, defaultResourceNameTreatment); - if (configs.size() == 1) { - return configs.get(0); - } - throw new IllegalArgumentException( - String.format( - "Field %s has multiple resource name configs: [%s], can't create a single FieldConfig object.", - field.getFullName(), - configs - .stream() - .map(FieldConfig::getResourceNameConfig) - .map(ResourceNameConfig::getEntityId) - .collect(Collectors.joining(",")))); - } - - static List createMessageFieldConfigs( - ResourceNameMessageConfigs messageConfigs, - Map resourceNameConfigs, - FieldModel field, - ResourceNameTreatment defaultResourceNameTreatment) { - return createFieldConfigs( - null, - messageConfigs, - null, - resourceNameConfigs, - field, - ResourceNameTreatment.UNSET_TREATMENT, - defaultResourceNameTreatment); - } - - static List createFieldConfigs( - DiagCollector diagCollector, - ResourceNameMessageConfigs messageConfigs, - ImmutableListMultimap fieldNamePatterns, - Map resourceNameConfigs, - FieldModel field, - ResourceNameTreatment treatment, - ResourceNameTreatment defaultResourceNameTreatment) { - List messageFieldEntityNames = Collections.emptyList(); - List flattenedFieldEntityNames = Collections.emptyList(); - if (messageConfigs != null && messageConfigs.fieldHasResourceName(field)) { - messageFieldEntityNames = messageConfigs.getFieldResourceNames(field); - } - if (fieldNamePatterns != null) { - flattenedFieldEntityNames = fieldNamePatterns.get(field.getNameAsParameter()); - } - if (flattenedFieldEntityNames.isEmpty()) { - flattenedFieldEntityNames = messageFieldEntityNames; - } - - if (messageFieldEntityNames.size() > 1 || flattenedFieldEntityNames.size() > 1) { - return createFieldConfigsWithMultipleResourceNames( - diagCollector, - messageFieldEntityNames, - flattenedFieldEntityNames, - messageConfigs, - resourceNameConfigs, - field, - treatment, - defaultResourceNameTreatment); - } - - String messageFieldEntityName = - messageFieldEntityNames.isEmpty() ? null : messageFieldEntityNames.get(0); - String flattenedFieldEntityName = - flattenedFieldEntityNames.isEmpty() ? null : flattenedFieldEntityNames.get(0); - return Collections.singletonList( - createFieldConfig( - diagCollector, - messageFieldEntityName, - flattenedFieldEntityName, - messageConfigs, - resourceNameConfigs, - field, - treatment, - defaultResourceNameTreatment)); - } - - private static List createFieldConfigsWithMultipleResourceNames( - DiagCollector diagCollector, - List messageFieldEntityNames, - List flattenedFieldEntityNames, - ResourceNameMessageConfigs messageConfigs, - Map resourceNameConfigs, - FieldModel field, - ResourceNameTreatment treatment, - ResourceNameTreatment defaultResourceNameTreatment) { - Preconditions.checkState( - new HashSet(messageFieldEntityNames) - .equals(new HashSet(flattenedFieldEntityNames)), - "fields with multiple resource name configs must have exactly the same set of " - + "resource name configs as a message field and a flattened field, but got: " - + "messageFieldEntityNames: %s and flattenedFieldEntityNames: %s", - messageFieldEntityNames.stream().collect(Collectors.joining(",")), - flattenedFieldEntityNames.stream().collect(Collectors.joining(","))); - - if (field.isRepeated()) { - FieldConfig fieldConfig = - createFieldConfig( - diagCollector, - messageFieldEntityNames.get(0), - messageFieldEntityNames.get(0), - messageConfigs, - resourceNameConfigs, - field, - treatment, - defaultResourceNameTreatment); - fieldConfig = fieldConfig.withResourceNameInSampleOnly(); - return Collections.singletonList(fieldConfig); - } - ImmutableList.Builder fieldConfigs = ImmutableList.builder(); - for (String entityName : messageFieldEntityNames) { - fieldConfigs.add( - createFieldConfig( - diagCollector, - entityName, - entityName, - messageConfigs, - resourceNameConfigs, - field, - treatment, - defaultResourceNameTreatment)); - } - return fieldConfigs.build(); - } - /** Package-private since this is not used outside the config package. */ static FieldConfig createFieldConfig( DiagCollector diagCollector, @@ -280,12 +179,17 @@ static FieldConfig createFieldConfig( validate(messageConfigs, field, treatment, flattenedFieldResourceNameConfig); - return newBuilder() - .setField(field) - .setResourceNameTreatment(treatment) - .setResourceNameConfig(flattenedFieldResourceNameConfig) - .setMessageResourceNameConfig(messageFieldResourceNameConfig) - .build(); + FieldConfig config = + newBuilder() + .setField(field) + .setResourceNameTreatment(treatment) + .setResourceNameConfig(flattenedFieldResourceNameConfig) + .setExampleResourceNameConfig(messageFieldResourceNameConfig) + .build(); + if (config.getField().isRepeated()) { + config = config.withResourceNameInSampleOnly(); + } + return config; } private static ResourceNameConfig getResourceNameConfig( @@ -330,7 +234,7 @@ public boolean useValidation() { public FieldConfig withResourceNameConfig(ResourceNameConfig resourceNameConfig) { return FieldConfig.createFieldConfig( - getField(), getResourceNameTreatment(), resourceNameConfig, getMessageResourceNameConfig()); + getField(), getResourceNameTreatment(), resourceNameConfig, getExampleResourceNameConfig()); } public FieldConfig withResourceNameInSampleOnly() { @@ -339,28 +243,28 @@ public FieldConfig withResourceNameInSampleOnly() { newTreatment = ResourceNameTreatment.SAMPLE_ONLY; } return FieldConfig.createFieldConfig( - getField(), newTreatment, getResourceNameConfig(), getMessageResourceNameConfig()); + getField(), newTreatment, getResourceNameConfig(), getExampleResourceNameConfig()); } public boolean requiresParamTransformation() { return getResourceNameConfig() != null - && getMessageResourceNameConfig() != null - && !getResourceNameConfig().equals(getMessageResourceNameConfig()); + && getExampleResourceNameConfig() != null + && !getResourceNameConfig().equals(getExampleResourceNameConfig()); } public boolean requiresParamTransformationFromAny() { - return getMessageResourceNameConfig() != null - && getMessageResourceNameConfig().getResourceNameType() == ResourceNameType.ANY; + return getExampleResourceNameConfig() != null + && getExampleResourceNameConfig().getResourceNameType() == ResourceNameType.ANY; } public FieldConfig getMessageFieldConfig() { return FieldConfig.createFieldConfig( getField(), - getMessageResourceNameConfig() == null + getExampleResourceNameConfig() == null ? ResourceNameTreatment.NONE : getResourceNameTreatment(), - getMessageResourceNameConfig(), - getMessageResourceNameConfig()); + getExampleResourceNameConfig(), + getExampleResourceNameConfig()); } /* @@ -420,7 +324,7 @@ public abstract static class Builder { public abstract Builder setResourceNameConfig(ResourceNameConfig val); - public abstract Builder setMessageResourceNameConfig(ResourceNameConfig val); + public abstract Builder setExampleResourceNameConfig(ResourceNameConfig val); public abstract FieldConfig build(); } @@ -433,16 +337,15 @@ public static Builder newBuilder() { public String toString() { String resourceNameEntityId = getResourceNameConfig() == null ? "null" : getResourceNameConfig().getEntityId(); - String msgResourceNameEntityId = - getMessageResourceNameConfig() == null + String exampleResourceNameEntityId = + getExampleResourceNameConfig() == null ? "null" - : getMessageResourceNameConfig().getEntityId(); - return getField().getSimpleName() - + ":" - + resourceNameEntityId - + ";" - + msgResourceNameEntityId - + ";" - + getResourceNameTreatment(); + : getExampleResourceNameConfig().getEntityId(); + + return MoreObjects.toStringHelper(this) + .add("resourceNameEntityId", resourceNameEntityId) + .add("exampleResourceNameEntityId", exampleResourceNameEntityId) + .add("resourceTreatment", getResourceNameTreatment()) + .toString(); } } diff --git a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java new file mode 100644 index 0000000000..5f0864b257 --- /dev/null +++ b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java @@ -0,0 +1,206 @@ +/* Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.codegen.config; + +import com.google.api.codegen.ResourceNameTreatment; +import com.google.api.tools.framework.model.DiagCollector; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class FieldConfigFactory { + + private FieldConfigFactory() {} + + /* + * Create a FieldConfig for a field in a message. If the field is associated + * with multiple resource names through child_type resource reference, + * the created FieldConfig will pick one for its exampleResourceNameConfig. + */ + static FieldConfig createMessageFieldConfig( + ResourceNameMessageConfigs messageConfigs, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment defaultResourceNameTreatment) { + List configs = + createFlattenedFieldConfigs( + null, + messageConfigs, + null, + resourceNameConfigs, + field, + ResourceNameTreatment.UNSET_TREATMENT, + defaultResourceNameTreatment); + if (configs.size() >= 1) { + return configs.get(0); + } + return null; + } + + static List createFlattenedFieldConfigs( + ResourceNameMessageConfigs messageConfigs, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment defaultResourceNameTreatment) { + return createFlattenedFieldConfigs( + null, + messageConfigs, + null, + resourceNameConfigs, + field, + ResourceNameTreatment.UNSET_TREATMENT, + defaultResourceNameTreatment); + } + + /** + * Create a list of FieldConfigs for a flattened field in the API surface. If the field is + * associated with multiple resource names through child_type resource reference, each created + * FieldConfig will have one of these resource name configs. + */ + static List createFlattenedFieldConfigs( + DiagCollector diagCollector, + ResourceNameMessageConfigs messageConfigs, + ImmutableListMultimap fieldNamePatterns, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment treatment, + ResourceNameTreatment defaultResourceNameTreatment) { + List messageFieldEntityNames = Collections.emptyList(); + List flattenedFieldEntityNames = Collections.emptyList(); + if (messageConfigs != null && messageConfigs.fieldHasResourceName(field)) { + messageFieldEntityNames = messageConfigs.getFieldResourceNames(field); + } + if (fieldNamePatterns != null) { + flattenedFieldEntityNames = fieldNamePatterns.get(field.getNameAsParameter()); + } + if (flattenedFieldEntityNames.isEmpty()) { + flattenedFieldEntityNames = messageFieldEntityNames; + } + + if (messageFieldEntityNames.size() > 1 || flattenedFieldEntityNames.size() > 1) { + return createFieldConfigForMultiResourceField( + diagCollector, + messageFieldEntityNames, + flattenedFieldEntityNames, + messageConfigs, + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment); + } + + String messageFieldEntityName = + messageFieldEntityNames.isEmpty() ? null : messageFieldEntityNames.get(0); + String flattenedFieldEntityName = + flattenedFieldEntityNames.isEmpty() ? null : flattenedFieldEntityNames.get(0); + return Collections.singletonList( + FieldConfig.createFieldConfig( + diagCollector, + messageFieldEntityName, + flattenedFieldEntityName, + messageConfigs, + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment)); + } + + static FieldConfig createFlattenedFieldConfigFromGapicYaml( + DiagCollector diagCollector, + ResourceNameMessageConfigs messageConfigs, + ImmutableListMultimap fieldNamePatterns, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment treatment, + ResourceNameTreatment defaultResourceNameTreatment) { + List fieldConfigs = + createFlattenedFieldConfigs( + diagCollector, + messageConfigs, + fieldNamePatterns, + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment); + if (fieldConfigs == null && fieldConfigs.isEmpty()) { + return null; + } + Preconditions.checkState( + fieldConfigs.size() == 1, + "GAPICs generated from GAPIC YAML can only have one FieldConfig per field, got [%s]", + fieldConfigs); + return fieldConfigs.get(0); + } + + /** + * Returns a list of FieldConfigs for a field associated with multiple resource names. Each + * created FieldConfig will have one of these resource name configs. + * + *

    Note only GAPICs generated from proto annoatations name may have fields associated with + * multiple resource names. GAPICs generated from GAPIC config cannot. + */ + private static List createFieldConfigForMultiResourceField( + DiagCollector diagCollector, + List messageFieldEntityNames, + List flattenedFieldEntityNames, + ResourceNameMessageConfigs messageConfigs, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment treatment, + ResourceNameTreatment defaultResourceNameTreatment) { + Preconditions.checkState( + new HashSet(messageFieldEntityNames) + .equals(new HashSet(flattenedFieldEntityNames)), + "fields with multiple resource name configs must have exactly the same set of " + + "resource name configs as a message field and a flattened field, but got: " + + "messageFieldEntityNames: %s and flattenedFieldEntityNames: %s", + messageFieldEntityNames.stream().collect(Collectors.joining(",")), + flattenedFieldEntityNames.stream().collect(Collectors.joining(","))); + + // if (field.isRepeated()) { + // FieldConfig fieldConfig = + // createFieldConfig( + // diagCollector, + // messageFieldEntityNames.get(0), + // messageFieldEntityNames.get(0), + // messageConfigs, + // resourceNameConfigs, + // field, + // treatment, + // defaultResourceNameTreatment); + // fieldConfig = fieldConfig.withResourceNameInSampleOnly(); + // return Collections.singletonList(fieldConfig); + // } + ImmutableList.Builder fieldConfigs = ImmutableList.builder(); + for (String entityName : messageFieldEntityNames) { + fieldConfigs.add( + FieldConfig.createFieldConfig( + diagCollector, + entityName, + entityName, + messageConfigs, + resourceNameConfigs, + field, + treatment, + defaultResourceNameTreatment)); + } + return fieldConfigs.build(); + } +} diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 3a0eb4cc8c..017e17be8f 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -139,6 +139,11 @@ static ImmutableList createFlatteningConfigs( .values() .stream() .flatMap(List::stream) + // .map( + // f -> { + // System.out.println(f); + // return f; + // }) .collect(ImmutableList.toImmutableList()); } @@ -228,8 +233,8 @@ private static FlatteningConfig createFlatteningFromConfigProto( defaultResourceNameTreatment = ResourceNameTreatment.NONE; } - List fieldConfigs = - FieldConfig.createFieldConfigs( + FieldConfig fieldConfig = + FieldConfigFactory.createFlattenedFieldConfigFromGapicYaml( diagCollector, messageConfigs, ImmutableListMultimap.copyOf(methodConfigProto.getFieldNamePatternsMap().entrySet()), @@ -239,10 +244,10 @@ private static FlatteningConfig createFlatteningFromConfigProto( .getParameterResourceNameTreatmentMap() .getOrDefault(parameter, ResourceNameTreatment.UNSET_TREATMENT), defaultResourceNameTreatment); - if (fieldConfigs == null || fieldConfigs.isEmpty()) { + if (fieldConfig == null) { missing = true; } else { - flattenedFieldConfigBuilder.put(parameter, fieldConfigs.get(0)); + flattenedFieldConfigBuilder.put(parameter, fieldConfig); } } if (missing) { @@ -308,7 +313,6 @@ private static void collectFieldConfigs( LinkedHashMap newFlattening = new LinkedHashMap<>(); newFlattening.put(parameter, fieldConfigs.get(j)); flatteningConfigs.add(newFlattening); - System.out.println(j); } } else { for (int i = 0; i < flatteningConfigsCount; i++) { @@ -362,7 +366,7 @@ private static List createFieldConfigsForParameter( } List fieldConfigs = - FieldConfig.createMessageFieldConfigs( + FieldConfigFactory.createFlattenedFieldConfigs( messageConfigs, resourceNameConfigs, parameterField, treatment); if (fieldConfigs.isEmpty()) { diff --git a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java index 5b9ff1359c..42d67b2d61 100644 --- a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java @@ -248,10 +248,6 @@ static GapicMethodConfig createGapicMethodConfigFromProto( return null; } else { GapicMethodConfig methodConfig = builder.build(); - if (methodConfig.getMethodModel().getSimpleName().contains("ListPublishers")) { - System.out.println("methodconfig"); - System.out.println(methodConfig.getFlatteningConfigs()); - } return methodConfig; } } diff --git a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java index 41c941fd24..02aae2b746 100644 --- a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java @@ -1083,9 +1083,8 @@ private static ImmutableMap createResponseFieldConfigMap( for (FieldModel field : messageConfig.getFieldsWithResourceNamesByMessage().values()) { map.put( field.getFullName(), - FieldConfig.createMessageFieldConfigs( - messageConfig, resourceNameConfigs, field, ResourceNameTreatment.STATIC_TYPES) - .get(0)); + FieldConfigFactory.createMessageFieldConfig( + messageConfig, resourceNameConfigs, field, ResourceNameTreatment.STATIC_TYPES)); } builder.putAll(map); return builder.build(); diff --git a/src/main/java/com/google/api/codegen/config/MethodConfig.java b/src/main/java/com/google/api/codegen/config/MethodConfig.java index 957da63078..a823f36099 100644 --- a/src/main/java/com/google/api/codegen/config/MethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/MethodConfig.java @@ -191,7 +191,7 @@ static ImmutableList createFieldNameConfigs( ImmutableList.Builder fieldConfigsBuilder = ImmutableList.builder(); for (FieldModel field : fields) { fieldConfigsBuilder.add( - FieldConfig.createFieldConfigs( + FieldConfigFactory.createFlattenedFieldConfigs( diagCollector, messageConfigs, fieldNamePatterns, diff --git a/src/main/java/com/google/api/codegen/config/PageStreamingConfig.java b/src/main/java/com/google/api/codegen/config/PageStreamingConfig.java index e7df43b0b6..f8f9356b2f 100644 --- a/src/main/java/com/google/api/codegen/config/PageStreamingConfig.java +++ b/src/main/java/com/google/api/codegen/config/PageStreamingConfig.java @@ -158,7 +158,7 @@ static PageStreamingConfig createPageStreamingFromGapicConfig( resourcesFieldConfig = null; } else { resourcesFieldConfig = - FieldConfig.createMessageFieldConfig( + FieldConfigFactory.createMessageFieldConfig( messageConfigs, resourceNameConfigs, resourcesField, @@ -210,7 +210,7 @@ static PageStreamingConfig createPageStreamingFromProtoFile( GapicMethodConfig.defaultResourceNameTreatmentFromProto( method.getProtoMethod(), protoParser, defaultPackageName); resourcesFieldConfig = - FieldConfig.createMessageFieldConfig( + FieldConfigFactory.createMessageFieldConfig( messageConfigs, resourceNameConfigs, resourcesField, resourceNameTreatment); } diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index e8ce57ca84..2b5f5ab8d6 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -178,7 +178,6 @@ static Map> getChildParentResourceMap( ImmutableMap.Builder> builder = ImmutableMap.builder(); List allResources = ImmutableList.copyOf(descriptorConfigMap.values()); - System.out.println(allResources); for (Map.Entry entry : descriptorConfigMap.entrySet()) { ResourceDescriptorConfig childResource = entry.getValue(); for (int i = 0; i < allResources.size(); i++) { @@ -197,7 +196,6 @@ static Map> getChildParentResourceMap( } Map> result = builder.build(); - System.out.println(result); return result; } @@ -207,12 +205,6 @@ private static List matchParentResourceDescriptor( List matchedParentResources, int unmatchedPatternsCount, int i) { - System.out.println("parentPatterns"); - System.out.println(parentPatterns); - System.out.println("matchedparentresource"); - System.out.println(matchedParentResources); - System.out.println("currentresource"); - System.out.println(allResources.get(i)); // We make a copy to advance in the depth-first search. There won't be // too many patterns in a resource so performance-wise it is not a problem. Map parentPatternsCopy = new HashMap<>(parentPatterns); diff --git a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java index 3d02f8a5c1..ccd33e468a 100644 --- a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java @@ -510,6 +510,11 @@ private InitCodeLineView generateSimpleInitCodeLine( fieldConfig = fieldConfig.getMessageFieldConfig(); } if (item.getType().isRepeated()) { + if (fieldConfig == null) { + System.out.println("fieldConfig is null"); + } else if (fieldConfig.getResourceNameConfig() == null) { + System.out.println("resourcenameconfig is null"); + } surfaceLine.typeName(namer.getAndSaveResourceTypeName(typeTable, fieldConfig)); } else { surfaceLine.typeName(namer.getAndSaveElementResourceTypeName(typeTable, fieldConfig)); @@ -649,7 +654,7 @@ private void setInitValueAndComments( if (context.getFeatureConfig().useResourceNameFormatOptionInSample(context, fieldConfig)) { if (!context.isFlattenedMethodContext()) { - ResourceNameConfig messageResNameConfig = fieldConfig.getMessageResourceNameConfig(); + ResourceNameConfig messageResNameConfig = fieldConfig.getExampleResourceNameConfig(); if (messageResNameConfig == null || messageResNameConfig.getResourceNameType() != ResourceNameType.ANY) { // In a non-flattened context, we always use the resource name type set on the message diff --git a/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java b/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java index c376565cef..aa71c0a129 100644 --- a/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java @@ -490,6 +490,10 @@ public InitCodeContext createSmokeTestInitContext(MethodContext context) { public FlatteningConfig getSmokeTestFlatteningGroup(MethodConfig methodConfig) { // Use the first flattening available for smoke testing. + if (methodConfig.getMethodModel().getSimpleName().equals("UpdateBook")) { + System.out.println("what!!!"); + System.out.println(methodConfig.getFlatteningConfigs()); + } return methodConfig .getFlatteningConfigs() .stream() diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java index 70ddd6d2d4..e95d0a8f69 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java @@ -288,7 +288,7 @@ public String getResourceNameFieldGetFunctionName(FieldConfig fieldConfig) { if (fieldConfig.getResourceNameType() == ResourceNameType.ANY) { resourceName = Name.from(AnyResourceNameConfig.ENTITY_NAME); } else { - resourceName = getResourceTypeNameObject(fieldConfig.getMessageResourceNameConfig()); + resourceName = getResourceTypeNameObject(fieldConfig.getExampleResourceNameConfig()); } Name name = Name.from(); From 1853fc2bd32296971c3355613ec581d32f4de76a Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Mon, 27 Jan 2020 15:41:34 -0800 Subject: [PATCH 15/36] wip --- .../codegen/config/FieldConfigFactory.java | 14 - .../api/codegen/config/FlatteningConfig.java | 27 +- .../api/codegen/config/GapicMethodConfig.java | 3 +- .../transformer/TestCaseTransformer.java | 4 - .../java/JavaApiMethodTransformer.java | 23 - .../java/JavaSurfaceTestTransformer.java | 4 +- .../ResourceNameMessageConfigsTest.java | 2 - .../codegen/gapic/GapicCodeGeneratorTest.java | 36 +- .../testdata/csharp/csharp_library.baseline | 9109 ++++- ...amplegen_config_migration_library.baseline | 7002 +++- .../gapic/testdata/java/java_library.baseline | 178 +- ...amplegen_config_migration_library.baseline | 164 +- .../testdata/csharp_library.baseline | 29617 +++++++++++----- .../testdata/java_library.baseline | 231 +- .../java_library_no_gapic_config.baseline | 694 +- ..._library_with_grpc_service_config.baseline | 718 +- .../testdata/nodejs_library.baseline | 28 + .../testdata/php_library.baseline | 27 + ..._library_with_grpc_service_config.baseline | 27 + .../testdata/python_library.baseline | 8 + .../testdata/ruby_library.baseline | 15 + .../ruby_library_no_gapic_config.baseline | 15 + 22 files changed, 34994 insertions(+), 12952 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java index 5f0864b257..c8122e374e 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java @@ -174,20 +174,6 @@ private static List createFieldConfigForMultiResourceField( messageFieldEntityNames.stream().collect(Collectors.joining(",")), flattenedFieldEntityNames.stream().collect(Collectors.joining(","))); - // if (field.isRepeated()) { - // FieldConfig fieldConfig = - // createFieldConfig( - // diagCollector, - // messageFieldEntityNames.get(0), - // messageFieldEntityNames.get(0), - // messageConfigs, - // resourceNameConfigs, - // field, - // treatment, - // defaultResourceNameTreatment); - // fieldConfig = fieldConfig.withResourceNameInSampleOnly(); - // return Collections.singletonList(fieldConfig); - // } ImmutableList.Builder fieldConfigs = ImmutableList.builder(); for (String entityName : messageFieldEntityNames) { fieldConfigs.add( diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 017e17be8f..0b325b8ddc 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -67,14 +67,13 @@ private static void insertFlatteningsFromGapicConfig( flatteningGroup, methodModel); if (groupConfig != null) { + ImmutableList.Builder fieldConfigs = ImmutableList.builder(); + fieldConfigs.add(groupConfig); + // We always generate an overload will all resource names treated as strings if (hasAnyResourceNameParameter(groupConfig)) { - flatteningConfigs.put( - flatteningConfigToString(groupConfig), - ImmutableList.of(groupConfig, groupConfig.withResourceNamesInSamplesOnly())); - } else { - flatteningConfigs.put( - flatteningConfigToString(groupConfig), ImmutableList.of(groupConfig)); + fieldConfigs.add(groupConfig.withResourceNamesInSamplesOnly()); } + flatteningConfigs.put(flatteningConfigToString(groupConfig), fieldConfigs.build()); } } } @@ -85,6 +84,10 @@ static ImmutableList createFlatteningConfigs( ImmutableMap resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel methodModel) { + // As a flattened field may have multiple resource name associated, a method_signature + // may end up with multiple method overloads as we generate all the combinations of + // resource name types. Therefore we group all the FlatteningConfigs generated from + // one method_signature in a list. ImmutableMap.Builder> flatteningConfigs = ImmutableMap.builder(); insertFlatteningsFromGapicConfig( diagCollector, @@ -139,11 +142,6 @@ static ImmutableList createFlatteningConfigs( .values() .stream() .flatMap(List::stream) - // .map( - // f -> { - // System.out.println(f); - // return f; - // }) .collect(ImmutableList.toImmutableList()); } @@ -291,7 +289,9 @@ private static List createFlatteningsFromProtoFile( collectFieldConfigs(flatteningConfigs, fieldConfigs, parameter); } - // We also generate an overload that all resource names are treated as strings + // We also generate an overload that all singular resource names are treated as strings, + // if there is at least one resource name field in the method surface. Note repeated + // resource name fields are always treated as strings. if (hasSingularResourceNameParameters(flatteningConfigs)) { flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0))); } @@ -303,11 +303,13 @@ private static List createFlatteningsFromProtoFile( .collect(ImmutableList.toImmutableList()); } + /** Recursively find all the combinations of FieldConfigs for a method_signature. */ private static void collectFieldConfigs( List> flatteningConfigs, List fieldConfigs, String parameter) { int flatteningConfigsCount = flatteningConfigs.size(); + if (flatteningConfigsCount == 0) { for (int j = 0; j < fieldConfigs.size(); j++) { LinkedHashMap newFlattening = new LinkedHashMap<>(); @@ -315,6 +317,7 @@ private static void collectFieldConfigs( flatteningConfigs.add(newFlattening); } } else { + // Perform a cartesian product between flatteningConfigs and fieldConfigs for (int i = 0; i < flatteningConfigsCount; i++) { for (int j = 0; j < fieldConfigs.size() - 1; j++) { LinkedHashMap newFlattening = diff --git a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java index 42d67b2d61..6f5c6b69cb 100644 --- a/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicMethodConfig.java @@ -247,8 +247,7 @@ static GapicMethodConfig createGapicMethodConfigFromProto( if (diagCollector.getErrorCount() - previousErrors > 0) { return null; } else { - GapicMethodConfig methodConfig = builder.build(); - return methodConfig; + return builder.build(); } } diff --git a/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java b/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java index aa71c0a129..c376565cef 100644 --- a/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/TestCaseTransformer.java @@ -490,10 +490,6 @@ public InitCodeContext createSmokeTestInitContext(MethodContext context) { public FlatteningConfig getSmokeTestFlatteningGroup(MethodConfig methodConfig) { // Use the first flattening available for smoke testing. - if (methodConfig.getMethodModel().getSimpleName().equals("UpdateBook")) { - System.out.println("what!!!"); - System.out.println(methodConfig.getFlatteningConfigs()); - } return methodConfig .getFlatteningConfigs() .stream() diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java index 52f389588b..4995eb25cf 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java @@ -122,15 +122,6 @@ private List generateUnaryMethods( flattenedMethodContext.withCallingForms( Collections.singletonList(CallingForm.Flattened)), sampleContext)); - - // if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - // apiMethods.add( - // generateFlattenedMethod( - // flattenedMethodContext - // .withResourceNamesInSamplesOnly() - // .withCallingForms(Collections.singletonList(CallingForm.Flattened)), - // sampleContext)); - // } } } apiMethods.add( @@ -189,17 +180,8 @@ private List generateLongRunningMethods( interfaceContext .asFlattenedMethodContext(methodContext, flatteningGroup) .withCallingForms(Collections.singletonList(CallingForm.LongRunningFlattenedAsync)); - // if (FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { - // flattenedMethodContext = flattenedMethodContext.withResourceNamesInSamplesOnly(); - // } apiMethods.add( generateAsyncOperationFlattenedMethod(flattenedMethodContext, sampleContext)); - - // if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - // apiMethods.add( - // generateAsyncOperationFlattenedMethod( - // flattenedMethodContext.withResourceNamesInSamplesOnly(), sampleContext)); - // } } } apiMethods.add( @@ -230,12 +212,7 @@ private List generatePagedStreamingMethods( interfaceContext .asFlattenedMethodContext(methodContext, flatteningGroup) .withCallingForms(ImmutableList.of(CallingForm.FlattenedPaged)); - // if (!FlatteningConfig.hasAnyRepeatedResourceNameParameter(flatteningGroup)) { - // apiMethods.add(generatePagedFlattenedMethod(flattenedMethodContext, sampleContext)); - // } - // if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { apiMethods.add(generatePagedFlattenedMethod(flattenedMethodContext, sampleContext)); - // } } } apiMethods.add( diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index 439f31f63c..6fc33287db 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -303,9 +303,9 @@ private List createTestCaseViews(InterfaceContext context) { for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { MethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); + // We only generate tests against the overload that does not expose resource name + // types on the surface to avoid combinatorial explosion of generated tests if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - // methodContext = methodContext.withResourceNamesInSamplesOnly(); - // flatteningGroup = methodContext.getFlatteningConfig(); continue; } InitCodeContext initCodeContext = diff --git a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java index 715375da1b..ca31c08ad2 100644 --- a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java +++ b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java @@ -258,7 +258,6 @@ public void testCreateResourceNamesWithProtoFilesOnly() { Collections.emptyMap()); assertThat(messageConfigs.getResourceTypeConfigMap().size()).isEqualTo(2); - System.out.println(messageConfigs.getResourceTypeConfigMap()); ResourceNameMessageConfig bookMessageConfig = messageConfigs.getResourceTypeConfigMap().get("library.Book"); assertThat(bookMessageConfig.fieldEntityMap().get("name")).isEqualTo("Book"); @@ -456,7 +455,6 @@ public void testCreateFlattenings() { .collect(Collectors.toList()); assertThat(flatteningConfigs).isNotNull(); - System.out.println(flatteningConfigs); assertThat(flatteningConfigs.size()).isEqualTo(3); // Check the flattening from the Gapic config. diff --git a/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java b/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java index b6b2cfd63a..7692dc4a81 100644 --- a/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java +++ b/src/test/java/com/google/api/codegen/gapic/GapicCodeGeneratorTest.java @@ -224,25 +224,25 @@ public static List testedConfigs() { null, sampleConfigFileNames(), "nodejs_samplegen_config_migration_library.baseline", + new String[] {"another_service"}), + GapicTestBase2.createTestConfig( + TargetLanguage.CSHARP, + new String[] {"library_gapic.yaml"}, + "library_pkg2.yaml", + "library", + null, + "another_service"), + GapicTestBase2.createTestConfig( + TargetLanguage.CSHARP, + new String[] {"samplegen_config_migration_library_gapic.yaml"}, + "library_pkg2.yaml", + "library", + null, + null, + null, + sampleConfigFileNames(), + "csharp_samplegen_config_migration_library.baseline", new String[] {"another_service"})); - // GapicTestBase2.createTestConfig( - // TargetLanguage.CSHARP, - // new String[] {"library_gapic.yaml"}, - // "library_pkg2.yaml", - // "library", - // null, - // "another_service"), - // GapicTestBase2.createTestConfig( - // TargetLanguage.CSHARP, - // new String[] {"samplegen_config_migration_library_gapic.yaml"}, - // "library_pkg2.yaml", - // "library", - // null, - // null, - // null, - // sampleConfigFileNames(), - // "csharp_samplegen_config_migration_library.baseline", - // new String[] {"another_service"})); } @Test diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 92dc045906..516cba061e 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -519,9 +519,9 @@ namespace Google.Example.Library.V1.Samples }; PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over pages (of server-defined size), performing one RPC per page - await response.ForEachAsync((BookName item) => + await response.ForEachAsync((string item) => { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); }); } @@ -593,9 +593,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => { - foreach (BookName item in page) + foreach (string item in page) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } }); @@ -666,10 +666,10 @@ namespace Google.Example.Library.V1.Samples PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - foreach (BookName item in response) + Page singlePage = await response.ReadPageAsync(pageSize); + foreach (string item in response) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -733,20 +733,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, }; PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over pages (of server-defined size), performing one RPC per page - await response.ForEachAsync((BookName item) => + await response.ForEachAsync((string item) => { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); }); } @@ -808,11 +808,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -821,9 +821,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => { - foreach (BookName item in page) + foreach (string item in page) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } }); @@ -885,11 +885,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -897,10 +897,10 @@ namespace Google.Example.Library.V1.Samples PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - foreach (BookName item in response) + Page singlePage = await response.ReadPageAsync(pageSize); + foreach (string item in response) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -971,9 +971,9 @@ namespace Google.Example.Library.V1.Samples }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (BookName item in response) + foreach (string item in response) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1044,9 +1044,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required foreach (FindRelatedBooksResponse page in response.asRawResponses()) { - foreach (BookName item in page) + foreach (string item in page) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1117,10 +1117,10 @@ namespace Google.Example.Library.V1.Samples PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - foreach (BookName item in response) + Page singlePage = response.ReadPage(pageSize); + foreach (string item in response) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -1183,20 +1183,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (BookName item in response) + foreach (string item in response) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1257,11 +1257,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -1270,9 +1270,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required foreach (FindRelatedBooksResponse page in response.asRawResponses()) { - foreach (BookName item in page) + foreach (string item in page) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1334,11 +1334,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -1346,10 +1346,10 @@ namespace Google.Example.Library.V1.Samples PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - foreach (BookName item in response) + Page singlePage = response.ReadPage(pageSize); + foreach (string item in response) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -4182,9 +4182,9 @@ namespace Google.Example.Library.V1.Samples RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -4939,6 +4939,33 @@ namespace Google.Example.Library.V1.Snippets ///

    Snippet for GetShelfAsync public async Task GetShelfAsync2() + { + // Snippet: GetShelfAsync(string,CallSettings) + // Additional: GetShelfAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf2() + { + // Snippet: GetShelf(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) @@ -4953,7 +4980,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf2() + public void GetShelf3() { // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) // Create client @@ -4967,7 +4994,36 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() + public async Task GetShelfAsync4() + { + // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf4() + { + // Snippet: GetShelf(string,SomeMessage,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync5() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) @@ -4983,7 +5039,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf3() + public void GetShelf5() { // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) // Create client @@ -4997,6 +5053,37 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetShelfAsync + public async Task GetShelfAsync6() + { + // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf6() + { + // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); + // End snippet + } + /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5205,7 +5292,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync() + public async Task DeleteShelfAsync1() { // Snippet: DeleteShelfAsync(ShelfName,CallSettings) // Additional: DeleteShelfAsync(ShelfName,CancellationToken) @@ -5219,7 +5306,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelf - public void DeleteShelf() + public void DeleteShelf1() { // Snippet: DeleteShelf(ShelfName,CallSettings) // Create client @@ -5231,6 +5318,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteShelfAsync + public async Task DeleteShelfAsync2() + { + // Snippet: DeleteShelfAsync(string,CallSettings) + // Additional: DeleteShelfAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + await libraryServiceClient.DeleteShelfAsync(name); + // End snippet + } + + /// Snippet for DeleteShelf + public void DeleteShelf2() + { + // Snippet: DeleteShelf(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + libraryServiceClient.DeleteShelf(name); + // End snippet + } + /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -5265,7 +5379,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync() + public async Task MergeShelvesAsync1() { // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) @@ -5280,7 +5394,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelves - public void MergeShelves() + public void MergeShelves1() { // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) // Create client @@ -5293,6 +5407,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MergeShelvesAsync + public async Task MergeShelvesAsync2() + { + // Snippet: MergeShelvesAsync(string,string,CallSettings) + // Additional: MergeShelvesAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MergeShelves + public void MergeShelves2() + { + // Snippet: MergeShelves(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); + // End snippet + } + /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5329,7 +5472,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBookAsync - public async Task CreateBookAsync() + public async Task CreateBookAsync1() { // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) @@ -5344,7 +5487,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBook - public void CreateBook() + public void CreateBook1() { // Snippet: CreateBook(ShelfName,Book,CallSettings) // Create client @@ -5357,6 +5500,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for CreateBookAsync + public async Task CreateBookAsync2() + { + // Snippet: CreateBookAsync(string,Book,CallSettings) + // Additional: CreateBookAsync(string,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.CreateBookAsync(name, book); + // End snippet + } + + /// Snippet for CreateBook + public void CreateBook2() + { + // Snippet: CreateBook(string,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.CreateBook(name, book); + // End snippet + } + /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5475,7 +5647,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookAsync - public async Task GetBookAsync() + public async Task GetBookAsync1() { // Snippet: GetBookAsync(BookName,CallSettings) // Additional: GetBookAsync(BookName,CancellationToken) @@ -5489,7 +5661,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBook - public void GetBook() + public void GetBook1() { // Snippet: GetBook(BookName,CallSettings) // Create client @@ -5501,6 +5673,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookAsync + public async Task GetBookAsync2() + { + // Snippet: GetBookAsync(string,CallSettings) + // Additional: GetBookAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = await libraryServiceClient.GetBookAsync(name); + // End snippet + } + + /// Snippet for GetBook + public void GetBook2() + { + // Snippet: GetBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = libraryServiceClient.GetBook(name); + // End snippet + } + /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5535,7 +5734,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync() + public async Task ListBooksAsync1() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -5580,7 +5779,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks() + public void ListBooks1() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -5625,20 +5824,17 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync_RequestObject() + public async Task ListBooksAsync2() { - // Snippet: ListBooksAsync(ListBooksRequest,CallSettings) + // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListBooksRequest request = new ListBooksRequest - { - ShelfName = new ShelfName("[SHELF]"), - Filter = "book-filter-string", - }; + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(request); + libraryServiceClient.ListBooksAsync(name, filter); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Book item) => @@ -5673,20 +5869,17 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks_RequestObject() + public void ListBooks2() { - // Snippet: ListBooks(ListBooksRequest,CallSettings) + // Snippet: ListBooks(string,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListBooksRequest request = new ListBooksRequest - { - ShelfName = new ShelfName("[SHELF]"), - Filter = "book-filter-string", - }; + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; // Make the request PagedEnumerable response = - libraryServiceClient.ListBooks(request); + libraryServiceClient.ListBooks(name, filter); // Iterate over all response items, lazily performing RPCs as required foreach (Book item in response) @@ -5720,47 +5913,170 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync() - { - // Snippet: DeleteBookAsync(BookName,CallSettings) - // Additional: DeleteBookAsync(BookName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook() - { - // Snippet: DeleteBook(BookName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync_RequestObject() + /// Snippet for ListBooksAsync + public async Task ListBooksAsync_RequestObject() { - // Snippet: DeleteBookAsync(DeleteBookRequest,CallSettings) - // Additional: DeleteBookAsync(DeleteBookRequest,CancellationToken) + // Snippet: ListBooksAsync(ListBooksRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - DeleteBookRequest request = new DeleteBookRequest + ListBooksRequest request = new ListBooksRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + ShelfName = new ShelfName("[SHELF]"), + Filter = "book-filter-string", }; // Make the request - await libraryServiceClient.DeleteBookAsync(request); + PagedAsyncEnumerable response = + libraryServiceClient.ListBooksAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Book item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListBooks + public void ListBooks_RequestObject() + { + // Snippet: ListBooks(ListBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ListBooksRequest request = new ListBooksRequest + { + ShelfName = new ShelfName("[SHELF]"), + Filter = "book-filter-string", + }; + // Make the request + PagedEnumerable response = + libraryServiceClient.ListBooks(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Book item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync1() + { + // Snippet: DeleteBookAsync(BookName,CallSettings) + // Additional: DeleteBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook1() + { + // Snippet: DeleteBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync2() + { + // Snippet: DeleteBookAsync(string,CallSettings) + // Additional: DeleteBookAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook2() + { + // Snippet: DeleteBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync_RequestObject() + { + // Snippet: DeleteBookAsync(DeleteBookRequest,CallSettings) + // Additional: DeleteBookAsync(DeleteBookRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + DeleteBookRequest request = new DeleteBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + }; + // Make the request + await libraryServiceClient.DeleteBookAsync(request); // End snippet } @@ -5811,6 +6127,35 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() + { + // Snippet: UpdateBookAsync(string,Book,CallSettings) + // Additional: UpdateBookAsync(string,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, book); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook2() + { + // Snippet: UpdateBook(string,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, book); + // End snippet + } + + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync3() { // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) @@ -5828,7 +6173,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBook - public void UpdateBook2() + public void UpdateBook3() { // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client @@ -5844,6 +6189,41 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync4() + { + // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook4() + { + // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -5880,7 +6260,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync() + public async Task MoveBookAsync1() { // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) @@ -5895,7 +6275,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBook - public void MoveBook() + public void MoveBook1() { // Snippet: MoveBook(BookName,ShelfName,CallSettings) // Create client @@ -5908,6 +6288,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MoveBookAsync + public async Task MoveBookAsync2() + { + // Snippet: MoveBookAsync(string,string,CallSettings) + // Additional: MoveBookAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MoveBook + public void MoveBook2() + { + // Snippet: MoveBook(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = libraryServiceClient.MoveBook(name, otherShelfName); + // End snippet + } + /// Snippet for MoveBookAsync public async Task MoveBookAsync_RequestObject() { @@ -5954,7 +6363,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -5965,7 +6374,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -5973,10 +6382,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -5996,7 +6405,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6007,7 +6416,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6015,10 +6424,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6040,7 +6449,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6051,7 +6460,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6059,10 +6468,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6084,7 +6493,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6095,7 +6504,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6103,10 +6512,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6116,19 +6525,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync_RequestObject() + public async Task ListStringsAsync3() { - // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) + // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(request); + libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6139,7 +6548,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6147,10 +6556,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6160,19 +6569,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings_RequestObject() + public void ListStrings3() { - // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Snippet: ListStrings(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); // Make the request PagedEnumerable response = - libraryServiceClient.ListStrings(request); + libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6183,7 +6592,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6191,10 +6600,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6203,19 +6612,107 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync_RequestObject() { - // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((string item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (string item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (string item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListStrings + public void ListStrings_RequestObject() + { + // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedEnumerable response = + libraryServiceClient.ListStrings(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (string item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (string item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (string item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync1() + { + // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { Comment = ByteString.Empty, Stage = Comment.Types.Stage.Unset, Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, @@ -6227,7 +6724,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for AddComments - public void AddComments() + public void AddComments1() { // Snippet: AddComments(BookName,IEnumerable,CallSettings) // Create client @@ -6248,6 +6745,51 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync2() + { + // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + await libraryServiceClient.AddCommentsAsync(name, comments); + // End snippet + } + + /// Snippet for AddComments + public void AddComments2() + { + // Snippet: AddComments(string,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + libraryServiceClient.AddComments(name, comments); + // End snippet + } + /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -6300,7 +6842,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync() + public async Task GetBookFromArchiveAsync1() { // Snippet: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CallSettings) // Additional: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CancellationToken) @@ -6315,7 +6857,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchive - public void GetBookFromArchive() + public void GetBookFromArchive1() { // Snippet: GetBookFromArchive(ArchivedBookName,LocationParentNameOneof,CallSettings) // Create client @@ -6328,6 +6870,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromArchiveAsync + public async Task GetBookFromArchiveAsync2() + { + // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) + // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); + // Make the request + BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); + // End snippet + } + + /// Snippet for GetBookFromArchive + public void GetBookFromArchive2() + { + // Snippet: GetBookFromArchive(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); + // Make the request + BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); + // End snippet + } + /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -6364,7 +6935,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync() + public async Task GetBookFromAnywhereAsync1() { // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CallSettings) // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CancellationToken) @@ -6381,7 +6952,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere() + public void GetBookFromAnywhere1() { // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,LocationName,FolderName,CallSettings) // Create client @@ -6396,6 +6967,39 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAnywhereAsync + public async Task GetBookFromAnywhereAsync2() + { + // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) + // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); + // End snippet + } + + /// Snippet for GetBookFromAnywhere + public void GetBookFromAnywhere2() + { + // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); + // End snippet + } + /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -6436,7 +7040,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync() + public async Task GetBookFromAbsolutelyAnywhereAsync1() { // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) @@ -6450,7 +7054,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere() + public void GetBookFromAbsolutelyAnywhere1() { // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) // Create client @@ -6462,6 +7066,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync + public async Task GetBookFromAbsolutelyAnywhereAsync2() + { + // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhere + public void GetBookFromAbsolutelyAnywhere2() + { + // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); + // End snippet + } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -6496,7 +7127,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync() + public async Task UpdateBookIndexAsync1() { // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) @@ -6515,7 +7146,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndex - public void UpdateBookIndex() + public void UpdateBookIndex1() { // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) // Create client @@ -6532,6 +7163,43 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookIndexAsync + public async Task UpdateBookIndexAsync2() + { + // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); + // End snippet + } + + /// Snippet for UpdateBookIndex + public void UpdateBookIndex2() + { + // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); + // End snippet + } + /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -6674,7 +7342,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync() { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6688,7 +7356,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6699,7 +7367,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6707,10 +7375,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6722,7 +7390,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooks public void FindRelatedBooks() { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6736,7 +7404,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over all response items, lazily performing RPCs as required - foreach (BookName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6747,7 +7415,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6755,10 +7423,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6776,18 +7444,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = { }, + Shelves = { }, }; // Make the request PagedAsyncEnumerable response = libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6798,7 +7466,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6806,10 +7474,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6827,18 +7495,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = { }, + Shelves = { }, }; // Make the request PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over all response items, lazily performing RPCs as required - foreach (BookName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6849,7 +7517,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6857,10 +7525,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6934,7 +7602,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync() + public async Task GetBigBookAsync1() { // Snippet: GetBigBookAsync(BookName,CallSettings) // Additional: GetBigBookAsync(BookName,CancellationToken) @@ -6967,7 +7635,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook() + public void GetBigBook1() { // Snippet: GetBigBook(BookName,CallSettings) // Create client @@ -6999,14 +7667,79 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync_RequestObject() + public async Task GetBigBookAsync2() { - // Snippet: GetBigBookAsync(GetBookRequest,CallSettings) + // Snippet: GetBigBookAsync(string,CallSettings) + // Additional: GetBigBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + await libraryServiceClient.GetBigBookAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigBookAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBook + public void GetBigBook2() + { + // Snippet: GetBigBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigBook(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigBook(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBookAsync + public async Task GetBigBookAsync_RequestObject() + { + // Snippet: GetBigBookAsync(GetBookRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + GetBookRequest request = new GetBookRequest + { BookName = new BookName("[SHELF]", "[BOOK]"), }; // Make the request @@ -7069,7 +7802,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync() + public async Task GetBigNothingAsync1() { // Snippet: GetBigNothingAsync(BookName,CallSettings) // Additional: GetBigNothingAsync(BookName,CancellationToken) @@ -7100,7 +7833,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing() + public void GetBigNothing1() { // Snippet: GetBigNothing(BookName,CallSettings) // Create client @@ -7129,6 +7862,67 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBigNothingAsync + public async Task GetBigNothingAsync2() + { + // Snippet: GetBigNothingAsync(string,CallSettings) + // Additional: GetBigNothingAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + await libraryServiceClient.GetBigNothingAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothing + public void GetBigNothing2() + { + // Snippet: GetBigNothing(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigNothing(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigNothing(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + /// Snippet for GetBigNothingAsync public async Task GetBigNothingAsync_RequestObject() { @@ -7221,8 +8015,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync2() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -7356,7 +8150,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParams public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -7488,181 +8282,450 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() + public async Task TestOptionalRequiredFlatteningParamsAsync3() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 0, - RequiredSingularInt64 = 0L, - RequiredSingularFloat = 0.0f, - RequiredSingularDouble = 0.0, - RequiredSingularBool = false, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "", - RequiredSingularBytes = ByteString.Empty, - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - RequiredSingularFixed32 = 0, - RequiredSingularFixed64 = 0L, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - }; - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(request); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams_RequestObject() - { - // Snippet: TestOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 0, - RequiredSingularInt64 = 0L, - RequiredSingularFloat = 0.0f, - RequiredSingularDouble = 0.0, - RequiredSingularBool = false, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "", - RequiredSingularBytes = ByteString.Empty, - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - RequiredSingularFixed32 = 0, - RequiredSingularFixed64 = 0L, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - }; + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(request); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync_RequestObject() + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams3() { - // Snippet: MoveBooksAsync(MoveBooksRequest,CallSettings) - // Additional: MoveBooksAsync(MoveBooksRequest,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - MoveBooksRequest request = new MoveBooksRequest(); + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(request); + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } - /// Snippet for MoveBooks - public void MoveBooks_RequestObject() + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { - // Snippet: MoveBooks(MoveBooksRequest,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - MoveBooksRequest request = new MoveBooksRequest(); - // Make the request + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 0, + RequiredSingularInt64 = 0L, + RequiredSingularFloat = 0.0f, + RequiredSingularDouble = 0.0, + RequiredSingularBool = false, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "", + RequiredSingularBytes = ByteString.Empty, + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularFixed32 = 0, + RequiredSingularFixed64 = 0L, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + }; + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(request); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams_RequestObject() + { + // Snippet: TestOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 0, + RequiredSingularInt64 = 0L, + RequiredSingularFloat = 0.0f, + RequiredSingularDouble = 0.0, + RequiredSingularBool = false, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "", + RequiredSingularBytes = ByteString.Empty, + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularFixed32 = 0, + RequiredSingularFixed64 = 0L, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + }; + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(request); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync_RequestObject() + { + // Snippet: MoveBooksAsync(MoveBooksRequest,CallSettings) + // Additional: MoveBooksAsync(MoveBooksRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + MoveBooksRequest request = new MoveBooksRequest(); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(request); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks_RequestObject() + { + // Snippet: MoveBooks(MoveBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + MoveBooksRequest request = new MoveBooksRequest(); + // Make the request MoveBooksResponse response = libraryServiceClient.MoveBooks(request); // End snippet } @@ -8091,8 +9154,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), + Name = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8104,8 +9166,7 @@ namespace Google.Example.Library.V1.Tests .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = client.GetShelf(name, message); + Shelf response = client.GetShelf(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -8120,8 +9181,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), + Name = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8133,8 +9193,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = await client.GetShelfAsync(name, message); + Shelf response = await client.GetShelfAsync(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -8151,7 +9210,6 @@ namespace Google.Example.Library.V1.Tests { ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), - StringBuilder = new StringBuilder(), }; Shelf expectedResponse = new Shelf { @@ -8164,8 +9222,7 @@ namespace Google.Example.Library.V1.Tests LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = client.GetShelf(name, message, stringBuilder); + Shelf response = client.GetShelf(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -8182,7 +9239,6 @@ namespace Google.Example.Library.V1.Tests { ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), - StringBuilder = new StringBuilder(), }; Shelf expectedResponse = new Shelf { @@ -8195,8 +9251,7 @@ namespace Google.Example.Library.V1.Tests LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = await client.GetShelfAsync(name, message, stringBuilder); + Shelf response = await client.GetShelfAsync(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -8209,10 +9264,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetShelfRequest request = new GetShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Options = "options-1249474914", + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf { @@ -8220,10 +9275,12 @@ namespace Google.Example.Library.V1.Tests Theme = "theme110327241", InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetShelf(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.GetShelf(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = client.GetShelf(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -8236,10 +9293,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetShelfRequest request = new GetShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Options = "options-1249474914", + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf { @@ -8247,78 +9304,300 @@ namespace Google.Example.Library.V1.Tests Theme = "theme110327241", InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetShelfAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = await client.GetShelfAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = await client.GetShelfAsync(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void DeleteShelf() + public void GetShelf5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - client.DeleteShelf(name); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = client.GetShelf(name, message, stringBuilder); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task DeleteShelfAsync() + public async Task GetShelfAsync5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - await client.DeleteShelfAsync(name); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = await client.GetShelfAsync(name, message, stringBuilder); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void DeleteShelf2() + public void GetShelf6() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteShelfRequest request = new DeleteShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest + { + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), + }; + Shelf expectedResponse = new Shelf { ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.DeleteShelf(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = client.GetShelf(name, message, stringBuilder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetShelfAsync6() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetShelfRequest expectedRequest = new GetShelfRequest + { + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = await client.GetShelfAsync(name, message, stringBuilder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetShelf7() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetShelfRequest request = new GetShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + Options = "options-1249474914", + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelf(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf response = client.GetShelf(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetShelfAsync7() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetShelfRequest request = new GetShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + Options = "options-1249474914", + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelfAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf response = await client.GetShelfAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteShelf() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + client.DeleteShelf(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task DeleteShelfAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + await client.DeleteShelfAsync(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteShelf2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + Name = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + client.DeleteShelf(name); mockGrpcClient.VerifyAll(); } [Fact] public async Task DeleteShelfAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + Name = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + await client.DeleteShelfAsync(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteShelf3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest request = new DeleteShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + client.DeleteShelf(request); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task DeleteShelfAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8397,6 +9676,64 @@ namespace Google.Example.Library.V1.Tests [Fact] public void MergeShelves2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MergeShelvesRequest expectedRequest = new MergeShelvesRequest + { + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = client.MergeShelves(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MergeShelvesAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MergeShelvesRequest expectedRequest = new MergeShelvesRequest + { + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = await client.MergeShelvesAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MergeShelves3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8423,7 +9760,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MergeShelvesAsync2() + public async Task MergeShelvesAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8517,9 +9854,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - CreateBookRequest request = new CreateBookRequest + CreateBookRequest expectedRequest = new CreateBookRequest { - ShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8529,10 +9866,12 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.CreateBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.CreateBook(request); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = client.CreateBook(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -8545,9 +9884,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - CreateBookRequest request = new CreateBookRequest + CreateBookRequest expectedRequest = new CreateBookRequest { - ShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8557,11 +9896,69 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.CreateBookAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.CreateBookAsync(request); - Assert.Same(expectedResponse, response); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = await client.CreateBookAsync(name, book); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void CreateBook3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + CreateBookRequest request = new CreateBookRequest + { + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.CreateBook(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = client.CreateBook(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task CreateBookAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + CreateBookRequest request = new CreateBookRequest + { + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.CreateBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.CreateBookAsync(request); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -8767,6 +10164,62 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBook2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookRequest expectedRequest = new GetBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book response = client.GetBook(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookRequest expectedRequest = new GetBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book response = await client.GetBookAsync(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8793,7 +10246,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookAsync2() + public async Task GetBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8863,6 +10316,48 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteBook2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteBookRequest expectedRequest = new DeleteBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + client.DeleteBook(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task DeleteBookAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteBookRequest expectedRequest = new DeleteBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + await client.DeleteBookAsync(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8882,7 +10377,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteBookAsync2() + public async Task DeleteBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8971,11 +10466,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -8988,11 +10480,8 @@ namespace Google.Example.Library.V1.Tests .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + Book response = client.UpdateBook(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -9007,11 +10496,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -9024,11 +10510,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + Book response = await client.UpdateBookAsync(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -9041,10 +10524,13 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -9053,10 +10539,15 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.UpdateBook(request); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -9069,10 +10560,13 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -9081,26 +10575,34 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.UpdateBookAsync(request); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBook() + public void UpdateBook4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -9109,28 +10611,34 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = client.MoveBook(name, otherShelfName); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBookAsync() + public async Task UpdateBookAsync4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -9139,28 +10647,31 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = await client.MoveBookAsync(name, otherShelfName); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBook2() + public void UpdateBook5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest + UpdateBookRequest request = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Book = new Book(), }; Book expectedResponse = new Book { @@ -9169,26 +10680,26 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.MoveBook(request); + Book response = client.UpdateBook(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBookAsync2() + public async Task UpdateBookAsync5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest + UpdateBookRequest request = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Book = new Book(), }; Book expectedResponse = new Book { @@ -9197,23 +10708,199 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.MoveBookAsync(request); + Book response = await client.UpdateBookAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void AddComments() + public void MoveBook() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + MoveBookRequest expectedRequest = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = client.MoveBook(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBookAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = await client.MoveBookAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBook2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = client.MoveBook(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBookAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = await client.MoveBookAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBook3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = client.MoveBook(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBookAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.MoveBookAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void AddComments() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest { BookName = new BookName("[SHELF]", "[BOOK]"), Comments = @@ -9285,6 +10972,84 @@ namespace Google.Example.Library.V1.Tests [Fact] public void AddComments2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + client.AddComments(name, comments); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task AddCommentsAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + await client.AddCommentsAsync(name, comments); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void AddComments3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9313,7 +11078,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task AddCommentsAsync2() + public async Task AddCommentsAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9409,10 +11174,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromArchiveRequest request = new GetBookFromArchiveRequest + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - ParentAsLocationParentNameOneof = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), + Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -9421,16 +11186,76 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBookFromArchive(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromArchive response = client.GetBookFromArchive(request); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); + BookFromArchive response = client.GetBookFromArchive(name, parent); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] public async Task GetBookFromArchiveAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest + { + Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); + BookFromArchive response = await client.GetBookFromArchiveAsync(name, parent); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBookFromArchive3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest request = new GetBookFromArchiveRequest + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + ParentAsLocationParentNameOneof = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchive(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromArchive response = client.GetBookFromArchive(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookFromArchiveAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9527,6 +11352,74 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAnywhere2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Place = new LocationName("[PROJECT]", "[LOCATION]"), + Folder = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName, place, folder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookFromAnywhereAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Place = new LocationName("[PROJECT]", "[LOCATION]"), + Folder = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName, place, folder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBookFromAnywhere3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9556,7 +11449,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAnywhereAsync2() + public async Task GetBookFromAnywhereAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9643,6 +11536,62 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAbsolutelyAnywhere2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookFromAbsolutelyAnywhereAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBookFromAbsolutelyAnywhere3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9669,7 +11618,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync2() + public async Task GetBookFromAbsolutelyAnywhereAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9759,6 +11708,68 @@ namespace Google.Example.Library.V1.Tests [Fact] public void UpdateBookIndex2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + client.UpdateBookIndex(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task UpdateBookIndexAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + await client.UpdateBookIndexAsync(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void UpdateBookIndex3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9783,7 +11794,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookIndexAsync2() + public async Task UpdateBookIndexAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9878,9 +11889,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -9939,9 +11950,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceNameAsBookNames = { }, - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, - OptionalRepeatedResourceNameCommonAsProjectNames = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -10142,9 +12153,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -10203,9 +12214,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceNameAsBookNames = { }, - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, - OptionalRepeatedResourceNameCommonAsProjectNames = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -10381,7 +12392,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest { RequiredSingularInt32 = 72313594, RequiredSingularInt64 = 72313499L, @@ -10392,9 +12403,9 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -10406,9 +12417,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -10444,38 +12455,221 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedStringValue = { }, RequiredRepeatedBoolValue = { }, RequiredRepeatedBytesValue = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, RequiredSingularDouble = 1.9111005E8, RequiredSingularBool = true, RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -10487,9 +12681,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -10525,54 +12719,399 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedStringValue = { }, RequiredRepeatedBoolValue = { }, RequiredRepeatedBytesValue = { }, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, }; TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBooks() + public void TestOptionalRequiredFlatteningParams4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBooksRequest request = new MoveBooksRequest(); - MoveBooksResponse expectedResponse = new MoveBooksResponse + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest { - Success = false, + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, }; - mockGrpcClient.Setup(x => x.MoveBooks(request, It.IsAny())) + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - MoveBooksResponse response = client.MoveBooks(request); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBooksAsync() + public async Task TestOptionalRequiredFlatteningParamsAsync4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBooksRequest request = new MoveBooksRequest(); - MoveBooksResponse expectedResponse = new MoveBooksResponse + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest { - Success = false, + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - MoveBooksResponse response = await client.MoveBooksAsync(request); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest request = new MoveBooksRequest(); + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + MoveBooksResponse response = client.MoveBooks(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest request = new MoveBooksRequest(); + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + MoveBooksResponse response = await client.MoveBooksAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -12336,6 +14875,66 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Gets a shelf. /// @@ -12486,6 +15085,81 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + /// /// Gets a shelf. /// @@ -12669,8 +15343,14 @@ namespace Google.Example.Library.V1 /// /// Gets a shelf. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -12679,17 +15359,29 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - GetShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); /// /// Gets a shelf. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// /// /// /// A to use for this RPC. @@ -12698,16 +15390,88 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - GetShelfRequest request, + string name, + SomeMessage message, + StringBuilder stringBuilder, st::CancellationToken cancellationToken) => GetShelfAsync( - request, + name, + message, + stringBuilder, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a shelf. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + GetShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + GetShelfRequest request, + st::CancellationToken cancellationToken) => GetShelfAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -12930,6 +15694,63 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + string name, + st::CancellationToken cancellationToken) => DeleteShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteShelf( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelf( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Deletes a shelf. /// @@ -13145,6 +15966,87 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MergeShelvesAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf MergeShelves( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelves( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + /// /// Merges two shelves by adding all books from the shelf named /// `other_shelf_name` to shelf `name`, and deletes @@ -13357,6 +16259,81 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + st::CancellationToken cancellationToken) => CreateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book CreateBook( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBook( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + /// /// Creates a book. /// @@ -13697,8 +16674,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// /// /// If not null, applies overrides to this RPC call. @@ -13707,8 +16684,68 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book GetBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) { throw new sys::NotImplementedException(); } @@ -13902,6 +16939,82 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListBooksAsync( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListBooks( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooks( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + /// /// Lists books in a shelf. /// @@ -14054,6 +17167,63 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + st::CancellationToken cancellationToken) => DeleteBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteBook( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBook( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Deletes a book. /// @@ -14263,18 +17433,9 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// - /// - /// An optional foo. - /// /// /// The book to update with. /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// /// /// If not null, applies overrides to this RPC call. /// @@ -14282,19 +17443,13 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, - string optionalFoo, + string name, Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional }, callSettings); @@ -14304,18 +17459,9 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// - /// - /// An optional foo. - /// /// /// The book to update with. /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// /// /// A to use for this RPC. /// @@ -14323,17 +17469,11 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, - string optionalFoo, + string name, Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, st::CancellationToken cancellationToken) => UpdateBookAsync( name, - optionalFoo, book, - updateMask, - physicalMask, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -14342,18 +17482,9 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// - /// - /// An optional foo. - /// /// /// The book to update with. /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// /// /// If not null, applies overrides to this RPC call. /// @@ -14361,19 +17492,13 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book UpdateBook( - BookName name, - string optionalFoo, + string name, Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBook( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional }, callSettings); @@ -14402,7 +17527,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -14410,7 +17535,7 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), UpdateMask = updateMask, // Optional @@ -14443,7 +17568,247 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + optionalFoo, + book, + updateMask, + physicalMask, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + BookName name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + optionalFoo, + book, + updateMask, + physicalMask, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -14706,8 +18071,11 @@ namespace Google.Example.Library.V1 /// /// Moves a book to another shelf, and returns the new book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. /// /// /// If not null, applies overrides to this RPC call. @@ -14716,15 +18084,87 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBookAsync( - MoveBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Moves a book to another shelf, and returns the new book. - /// + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MoveBookAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book MoveBook( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBook( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + MoveBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Moves a book to another shelf, and returns the new book. + /// /// /// The request object containing all of the parameters for the API call. /// @@ -14776,7 +18216,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( @@ -14804,7 +18244,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStrings( @@ -14835,7 +18275,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( IResourceName name, string pageToken = null, int? pageSize = null, @@ -14868,7 +18308,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( IResourceName name, string pageToken = null, int? pageSize = null, @@ -14901,7 +18341,73 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListStrings( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStrings( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string name, string pageToken = null, int? pageSize = null, @@ -14934,7 +18440,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string name, string pageToken = null, int? pageSize = null, @@ -14959,7 +18465,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -14978,7 +18484,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -15129,6 +18635,78 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + st::CancellationToken cancellationToken) => AddCommentsAsync( + name, + comments, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void AddComments( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddComments( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + /// /// Adds comments to a book /// @@ -15335,8 +18913,11 @@ namespace Google.Example.Library.V1 /// /// Gets a book from an archive. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -15345,17 +18926,24 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + string name, + string parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + }, + callSettings); /// /// Gets a book from an archive. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. + /// + /// + /// /// /// /// A to use for this RPC. @@ -15364,18 +18952,83 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, + string name, + string parent, st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - request, + name, + parent, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book from an archive. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// - /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromArchive GetBookFromArchive( + string name, + string parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + GetBookFromArchiveRequest request, + st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// /// If not null, applies overrides to this RPC call. /// /// @@ -15604,6 +19257,114 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + string place, + string folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), + Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + string place, + string folder, + st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( + name, + altBookName, + place, + folder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAnywhere( + string name, + string altBookName, + string place, + string folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), + Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), + }, + callSettings); + /// /// Gets a book from a shelf or archive. /// @@ -15780,6 +19541,66 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Test proper OneOf-Any resource name mapping /// @@ -15896,1059 +19717,2843 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// - /// Updates the index of a book. + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + BookName name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( + new UpdateBookIndexRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + name, + indexName, + indexMap, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + name, + indexName, + indexMap, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + UpdateBookIndexRequest request, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test server streaming + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The name of the shelf to stream. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamShelvesStream StreamShelves( + ShelfName name, + gaxgrpc::CallSettings callSettings = null) => StreamShelves( + new StreamShelvesRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test server streaming + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The name of the shelf to stream. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamShelvesStream StreamShelves( + string name, + gaxgrpc::CallSettings callSettings = null) => StreamShelves( + new StreamShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test server streaming + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The name of the shelf to stream. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamShelvesStream StreamShelves( + string name, + gaxgrpc::CallSettings callSettings = null) => StreamShelves( + new StreamShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test server streaming + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamShelvesStream StreamShelves( + StreamShelvesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Server streaming methods for StreamShelves. + /// + public abstract partial class StreamShelvesStream : gaxgrpc::ServerStreamingBase + { + } + + /// + /// Test server streaming, non-paged responses. + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamBooksStream StreamBooks( + string name, + gaxgrpc::CallSettings callSettings = null) => StreamBooks( + new StreamBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test server streaming, non-paged responses. + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamBooksStream StreamBooks( + StreamBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Server streaming methods for StreamBooks. + /// + public abstract partial class StreamBooksStream : gaxgrpc::ServerStreamingBase + { + } + + /// + /// Test bidi-streaming. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// If not null, applies streaming overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + public virtual DiscussBookStream DiscussBook( + gaxgrpc::CallSettings callSettings = null, + gaxgrpc::BidirectionalStreamingSettings streamingSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Bidirectional streaming methods for DiscussBook. + /// + public abstract partial class DiscussBookStream : gaxgrpc::BidirectionalStreamingBase + { + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + FindRelatedBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + FindRelatedBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Adds a label to the entity. + /// + /// + /// REQUIRED: The resource which the label is being added to. + /// In the form "shelves/{shelf_id}/books/{book_id}". + /// + /// + /// REQUIRED: The label to add. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task AddLabelAsync( + string resource, + string label, + gaxgrpc::CallSettings callSettings = null) => AddLabelAsync( + new gtv::AddLabelRequest + { + Resource = gax::GaxPreconditions.CheckNotNullOrEmpty(resource, nameof(resource)), + Label = gax::GaxPreconditions.CheckNotNullOrEmpty(label, nameof(label)), + }, + callSettings); + + /// + /// Adds a label to the entity. + /// + /// + /// REQUIRED: The resource which the label is being added to. + /// In the form "shelves/{shelf_id}/books/{book_id}". + /// + /// + /// REQUIRED: The label to add. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task AddLabelAsync( + string resource, + string label, + st::CancellationToken cancellationToken) => AddLabelAsync( + resource, + label, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds a label to the entity. + /// + /// + /// REQUIRED: The resource which the label is being added to. + /// In the form "shelves/{shelf_id}/books/{book_id}". + /// + /// + /// REQUIRED: The label to add. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual gtv::AddLabelResponse AddLabel( + string resource, + string label, + gaxgrpc::CallSettings callSettings = null) => AddLabel( + new gtv::AddLabelRequest + { + Resource = gax::GaxPreconditions.CheckNotNullOrEmpty(resource, nameof(resource)), + Label = gax::GaxPreconditions.CheckNotNullOrEmpty(label, nameof(label)), + }, + callSettings); + + /// + /// Adds a label to the entity. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task AddLabelAsync( + gtv::AddLabelRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Adds a label to the entity. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task AddLabelAsync( + gtv::AddLabelRequest request, + st::CancellationToken cancellationToken) => AddLabelAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds a label to the entity. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual gtv::AddLabelResponse AddLabel( + gtv::AddLabelRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + BookName name, + gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( + new GetBookRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + BookName name, + st::CancellationToken cancellationToken) => GetBigBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + BookName name, + gaxgrpc::CallSettings callSettings = null) => GetBigBook( + new GetBookRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBigBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBigBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigBookAsync. + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceGetBigBookAsync( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigBookOperationsClient, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// The long-running operations client for GetBigBook. + /// + public virtual lro::OperationsClient GetBigBookOperationsClient + { + get { throw new sys::NotImplementedException(); } + } + + /// + /// Poll an operation once, using an operationName from a previous invocation of GetBigBook. + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceGetBigBook( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigBookOperationsClient, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + BookName name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + BookName name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + BookName name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigNothingAsync. + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceGetBigNothingAsync( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigNothingOperationsClient, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// The long-running operations client for GetBigNothing. + /// + public virtual lro::OperationsClient GetBigNothingOperationsClient + { + get { throw new sys::NotImplementedException(); } + } + + /// + /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceGetBigNothing( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigNothingOperationsClient, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest + { + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( + new TestOptionalRequiredFlatteningParamsRequest + { + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), + RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), + RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), + RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), + RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), + RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), + RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), + RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), + RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), + RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), + RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), + RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), + RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), + RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), + RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), + RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), + RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, + RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, + RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, + RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, + RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, + RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, + RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, + RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, + RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, + RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, + RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, + RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, + RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, + RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, + RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, + RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + requiredSingularInt32, + requiredSingularInt64, + requiredSingularFloat, + requiredSingularDouble, + requiredSingularBool, + requiredSingularEnum, + requiredSingularString, + requiredSingularBytes, + requiredSingularMessage, + requiredSingularResourceName, + requiredSingularResourceNameOneof, + requiredSingularResourceNameCommon, + requiredSingularFixed32, + requiredSingularFixed64, + requiredRepeatedInt32, + requiredRepeatedInt64, + requiredRepeatedFloat, + requiredRepeatedDouble, + requiredRepeatedBool, + requiredRepeatedEnum, + requiredRepeatedString, + requiredRepeatedBytes, + requiredRepeatedMessage, + requiredRepeatedResourceName, + requiredRepeatedResourceNameOneof, + requiredRepeatedResourceNameCommon, + requiredRepeatedFixed32, + requiredRepeatedFixed64, + requiredMap, + requiredAnyValue, + requiredStructValue, + requiredValueValue, + requiredListValueValue, + requiredTimeValue, + requiredDurationValue, + requiredFieldMaskValue, + requiredInt32Value, + requiredUint32Value, + requiredInt64Value, + requiredUint64Value, + requiredFloatValue, + requiredDoubleValue, + requiredStringValue, + requiredBoolValue, + requiredBytesValue, + requiredRepeatedAnyValue, + requiredRepeatedStructValue, + requiredRepeatedValueValue, + requiredRepeatedListValueValue, + requiredRepeatedTimeValue, + requiredRepeatedDurationValue, + requiredRepeatedFieldMaskValue, + requiredRepeatedInt32Value, + requiredRepeatedUint32Value, + requiredRepeatedInt64Value, + requiredRepeatedUint64Value, + requiredRepeatedFloatValue, + requiredRepeatedDoubleValue, + requiredRepeatedStringValue, + requiredRepeatedBoolValue, + requiredRepeatedBytesValue, + optionalSingularInt32, + optionalSingularInt64, + optionalSingularFloat, + optionalSingularDouble, + optionalSingularBool, + optionalSingularEnum, + optionalSingularString, + optionalSingularBytes, + optionalSingularMessage, + optionalSingularResourceName, + optionalSingularResourceNameOneof, + optionalSingularResourceNameCommon, + optionalSingularFixed32, + optionalSingularFixed64, + optionalRepeatedInt32, + optionalRepeatedInt64, + optionalRepeatedFloat, + optionalRepeatedDouble, + optionalRepeatedBool, + optionalRepeatedEnum, + optionalRepeatedString, + optionalRepeatedBytes, + optionalRepeatedMessage, + optionalRepeatedResourceName, + optionalRepeatedResourceNameOneof, + optionalRepeatedResourceNameCommon, + optionalRepeatedFixed32, + optionalRepeatedFixed64, + optionalMap, + anyValue, + structValue, + valueValue, + listValueValue, + timeValue, + durationValue, + fieldMaskValue, + int32Value, + uint32Value, + int64Value, + uint64Value, + floatValue, + doubleValue, + stringValue, + boolValue, + bytesValue, + repeatedAnyValue, + repeatedStructValue, + repeatedValueValue, + repeatedListValueValue, + repeatedTimeValue, + repeatedDurationValue, + repeatedFieldMaskValue, + repeatedInt32Value, + repeatedUint32Value, + repeatedInt64Value, + repeatedUint64Value, + repeatedFloatValue, + repeatedDoubleValue, + repeatedStringValue, + repeatedBoolValue, + repeatedBytesValue, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void UpdateBookIndex( - BookName name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( - new UpdateBookIndexRequest - { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - name, - indexName, - indexMap, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void UpdateBookIndex( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void UpdateBookIndex( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test server streaming - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The name of the shelf to stream. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamShelvesStream StreamShelves( - ShelfName name, - gaxgrpc::CallSettings callSettings = null) => StreamShelves( - new StreamShelvesRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test server streaming - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The name of the shelf to stream. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamShelvesStream StreamShelves( - string name, - gaxgrpc::CallSettings callSettings = null) => StreamShelves( - new StreamShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test server streaming - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamShelvesStream StreamShelves( - StreamShelvesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Server streaming methods for StreamShelves. - /// - public abstract partial class StreamShelvesStream : gaxgrpc::ServerStreamingBase - { - } - - /// - /// Test server streaming, non-paged responses. - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamBooksStream StreamBooks( - string name, - gaxgrpc::CallSettings callSettings = null) => StreamBooks( - new StreamBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test server streaming, non-paged responses. - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamBooksStream StreamBooks( - StreamBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Server streaming methods for StreamBooks. - /// - public abstract partial class StreamBooksStream : gaxgrpc::ServerStreamingBase - { - } - - /// - /// Test bidi-streaming. - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// If not null, applies streaming overrides to this RPC call. + /// + /// /// - /// - /// The client-server stream. - /// - public virtual DiscussBookStream DiscussBook( - gaxgrpc::CallSettings callSettings = null, - gaxgrpc::BidirectionalStreamingSettings streamingSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Bidirectional streaming methods for DiscussBook. - /// - public abstract partial class DiscussBookStream : gaxgrpc::BidirectionalStreamingBase - { - } - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( - new FindRelatedBooksRequest - { - BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable FindRelatedBooks( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( - new FindRelatedBooksRequest - { - BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( - new FindRelatedBooksRequest - { - Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable FindRelatedBooks( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( - new FindRelatedBooksRequest - { - Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// /// - /// - /// - /// The request object containing all of the parameters for the API call. /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( - FindRelatedBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// + /// /// - /// - /// - /// The request object containing all of the parameters for the API call. /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable FindRelatedBooks( - FindRelatedBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Adds a label to the entity. - /// - /// - /// REQUIRED: The resource which the label is being added to. - /// In the form "shelves/{shelf_id}/books/{book_id}". + /// + /// /// - /// - /// REQUIRED: The label to add. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task AddLabelAsync( - string resource, - string label, - gaxgrpc::CallSettings callSettings = null) => AddLabelAsync( - new gtv::AddLabelRequest - { - Resource = gax::GaxPreconditions.CheckNotNullOrEmpty(resource, nameof(resource)), - Label = gax::GaxPreconditions.CheckNotNullOrEmpty(label, nameof(label)), - }, - callSettings); - - /// - /// Adds a label to the entity. - /// - /// - /// REQUIRED: The resource which the label is being added to. - /// In the form "shelves/{shelf_id}/books/{book_id}". + /// + /// /// - /// - /// REQUIRED: The label to add. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task AddLabelAsync( - string resource, - string label, - st::CancellationToken cancellationToken) => AddLabelAsync( - resource, - label, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds a label to the entity. - /// - /// - /// REQUIRED: The resource which the label is being added to. - /// In the form "shelves/{shelf_id}/books/{book_id}". + /// + /// /// - /// - /// REQUIRED: The label to add. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual gtv::AddLabelResponse AddLabel( - string resource, - string label, - gaxgrpc::CallSettings callSettings = null) => AddLabel( - new gtv::AddLabelRequest - { - Resource = gax::GaxPreconditions.CheckNotNullOrEmpty(resource, nameof(resource)), - Label = gax::GaxPreconditions.CheckNotNullOrEmpty(label, nameof(label)), - }, - callSettings); - - /// - /// Adds a label to the entity. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task AddLabelAsync( - gtv::AddLabelRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Adds a label to the entity. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task AddLabelAsync( - gtv::AddLabelRequest request, - st::CancellationToken cancellationToken) => AddLabelAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds a label to the entity. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual gtv::AddLabelResponse AddLabel( - gtv::AddLabelRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - BookName name, - gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( - new GetBookRequest - { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - BookName name, - st::CancellationToken cancellationToken) => GetBigBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - BookName name, - gaxgrpc::CallSettings callSettings = null) => GetBigBook( - new GetBookRequest - { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - st::CancellationToken cancellationToken) => GetBigBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigBookAsync. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// A task representing the result of polling the operation. - public virtual stt::Task> PollOnceGetBigBookAsync( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigBookOperationsClient, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// The long-running operations client for GetBigBook. - /// - public virtual lro::OperationsClient GetBigBookOperationsClient - { - get { throw new sys::NotImplementedException(); } - } - - /// - /// Poll an operation once, using an operationName from a previous invocation of GetBigBook. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// The result of polling the operation. - public virtual lro::Operation PollOnceGetBigBook( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigBookOperationsClient, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - BookName name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - BookName name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - BookName name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// + /// + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigNothingAsync. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// A task representing the result of polling the operation. - public virtual stt::Task> PollOnceGetBigNothingAsync( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigNothingOperationsClient, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// The long-running operations client for GetBigNothing. - /// - public virtual lro::OperationsClient GetBigNothingOperationsClient - { - get { throw new sys::NotImplementedException(); } - } - - /// - /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// The result of polling the operation. - public virtual lro::Operation PollOnceGetBigNothing( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigNothingOperationsClient, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest - { - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// A to use for this RPC. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// /// /// If not null, applies overrides to this RPC call. /// @@ -16956,9 +22561,253 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( new TestOptionalRequiredFlatteningParamsRequest { + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), + RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), + RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), + RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), + RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), + RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), + RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), + RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), + RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), + RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), + RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), + RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), + RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), + RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), + RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), + RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), + RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, + RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, + RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, + RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, + RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, + RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, + RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, + RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, + RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, + RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, + RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, + RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, + RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, + RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, + RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, + RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); @@ -17347,9 +23196,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -17361,9 +23210,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -17408,9 +23257,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -17422,9 +23271,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -17472,9 +23321,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -17486,9 +23335,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -17533,9 +23382,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional @@ -17547,9 +23396,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -17973,9 +23822,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -17987,9 +23836,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -18034,9 +23883,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -18048,9 +23897,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -18596,9 +24445,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -18610,9 +24459,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -18657,9 +24506,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -18671,9 +24520,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -18721,9 +24570,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -18735,9 +24584,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -18782,9 +24631,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional @@ -18796,9 +24645,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -21798,12 +27647,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable ListStringsAsync( + public override gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); } /// @@ -21818,12 +27667,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable ListStrings( + public override gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); } /// @@ -22197,12 +28046,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -22217,12 +28066,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable FindRelatedBooks( + public override gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -22675,24 +28524,24 @@ namespace Google.Example.Library.V1 } public partial class ListStringsRequest : gaxgrpc::IPageRequest { } - public partial class ListStringsResponse : gaxgrpc::IPageResponse + public partial class ListStringsResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => StringsAsResourceNames.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => Strings.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } public partial class FindRelatedBooksRequest : gaxgrpc::IPageRequest { } - public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse + public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => BookNames.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => Names.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 204fe410a0..8324766509 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -282,20 +282,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (BookName item in response) + foreach (string item in response) { - BookName book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1079,9 +1079,9 @@ namespace Google.Example.Library.V1.Samples RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -1776,6 +1776,33 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() + { + // Snippet: GetShelfAsync(string,CallSettings) + // Additional: GetShelfAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf2() + { + // Snippet: GetShelf(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) @@ -1790,7 +1817,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf2() + public void GetShelf3() { // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) // Create client @@ -1804,7 +1831,36 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() + public async Task GetShelfAsync4() + { + // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf4() + { + // Snippet: GetShelf(string,SomeMessage,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync5() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) @@ -1820,7 +1876,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf3() + public void GetShelf5() { // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) // Create client @@ -1834,6 +1890,37 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetShelfAsync + public async Task GetShelfAsync6() + { + // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf6() + { + // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); + // End snippet + } + /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -2042,7 +2129,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync() + public async Task DeleteShelfAsync1() { // Snippet: DeleteShelfAsync(ShelfName,CallSettings) // Additional: DeleteShelfAsync(ShelfName,CancellationToken) @@ -2056,7 +2143,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelf - public void DeleteShelf() + public void DeleteShelf1() { // Snippet: DeleteShelf(ShelfName,CallSettings) // Create client @@ -2068,6 +2155,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteShelfAsync + public async Task DeleteShelfAsync2() + { + // Snippet: DeleteShelfAsync(string,CallSettings) + // Additional: DeleteShelfAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + await libraryServiceClient.DeleteShelfAsync(name); + // End snippet + } + + /// Snippet for DeleteShelf + public void DeleteShelf2() + { + // Snippet: DeleteShelf(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + libraryServiceClient.DeleteShelf(name); + // End snippet + } + /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -2102,7 +2216,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync() + public async Task MergeShelvesAsync1() { // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) @@ -2117,7 +2231,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelves - public void MergeShelves() + public void MergeShelves1() { // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) // Create client @@ -2130,6 +2244,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MergeShelvesAsync + public async Task MergeShelvesAsync2() + { + // Snippet: MergeShelvesAsync(string,string,CallSettings) + // Additional: MergeShelvesAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MergeShelves + public void MergeShelves2() + { + // Snippet: MergeShelves(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); + // End snippet + } + /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -2166,7 +2309,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBookAsync - public async Task CreateBookAsync() + public async Task CreateBookAsync1() { // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) @@ -2181,7 +2324,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBook - public void CreateBook() + public void CreateBook1() { // Snippet: CreateBook(ShelfName,Book,CallSettings) // Create client @@ -2194,6 +2337,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for CreateBookAsync + public async Task CreateBookAsync2() + { + // Snippet: CreateBookAsync(string,Book,CallSettings) + // Additional: CreateBookAsync(string,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.CreateBookAsync(name, book); + // End snippet + } + + /// Snippet for CreateBook + public void CreateBook2() + { + // Snippet: CreateBook(string,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.CreateBook(name, book); + // End snippet + } + /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -2312,7 +2484,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookAsync - public async Task GetBookAsync() + public async Task GetBookAsync1() { // Snippet: GetBookAsync(BookName,CallSettings) // Additional: GetBookAsync(BookName,CancellationToken) @@ -2326,7 +2498,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBook - public void GetBook() + public void GetBook1() { // Snippet: GetBook(BookName,CallSettings) // Create client @@ -2338,6 +2510,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookAsync + public async Task GetBookAsync2() + { + // Snippet: GetBookAsync(string,CallSettings) + // Additional: GetBookAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = await libraryServiceClient.GetBookAsync(name); + // End snippet + } + + /// Snippet for GetBook + public void GetBook2() + { + // Snippet: GetBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = libraryServiceClient.GetBook(name); + // End snippet + } + /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -2372,7 +2571,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync() + public async Task ListBooksAsync1() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -2417,7 +2616,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks() + public void ListBooks1() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -2462,20 +2661,17 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync_RequestObject() + public async Task ListBooksAsync2() { - // Snippet: ListBooksAsync(ListBooksRequest,CallSettings) + // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListBooksRequest request = new ListBooksRequest - { - ShelfName = new ShelfName("[SHELF]"), - Filter = "book-filter-string", - }; + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(request); + libraryServiceClient.ListBooksAsync(name, filter); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Book item) => @@ -2510,20 +2706,17 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks_RequestObject() + public void ListBooks2() { - // Snippet: ListBooks(ListBooksRequest,CallSettings) + // Snippet: ListBooks(string,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListBooksRequest request = new ListBooksRequest - { - ShelfName = new ShelfName("[SHELF]"), - Filter = "book-filter-string", - }; + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; // Make the request PagedEnumerable response = - libraryServiceClient.ListBooks(request); + libraryServiceClient.ListBooks(name, filter); // Iterate over all response items, lazily performing RPCs as required foreach (Book item in response) @@ -2557,51 +2750,174 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync() - { - // Snippet: DeleteBookAsync(BookName,CallSettings) - // Additional: DeleteBookAsync(BookName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook() - { - // Snippet: DeleteBook(BookName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync_RequestObject() + /// Snippet for ListBooksAsync + public async Task ListBooksAsync_RequestObject() { - // Snippet: DeleteBookAsync(DeleteBookRequest,CallSettings) - // Additional: DeleteBookAsync(DeleteBookRequest,CancellationToken) + // Snippet: ListBooksAsync(ListBooksRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - DeleteBookRequest request = new DeleteBookRequest + ListBooksRequest request = new ListBooksRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + ShelfName = new ShelfName("[SHELF]"), + Filter = "book-filter-string", }; // Make the request - await libraryServiceClient.DeleteBookAsync(request); - // End snippet - } + PagedAsyncEnumerable response = + libraryServiceClient.ListBooksAsync(request); - /// Snippet for DeleteBook + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Book item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListBooks + public void ListBooks_RequestObject() + { + // Snippet: ListBooks(ListBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ListBooksRequest request = new ListBooksRequest + { + ShelfName = new ShelfName("[SHELF]"), + Filter = "book-filter-string", + }; + // Make the request + PagedEnumerable response = + libraryServiceClient.ListBooks(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Book item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync1() + { + // Snippet: DeleteBookAsync(BookName,CallSettings) + // Additional: DeleteBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook1() + { + // Snippet: DeleteBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync2() + { + // Snippet: DeleteBookAsync(string,CallSettings) + // Additional: DeleteBookAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook2() + { + // Snippet: DeleteBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync_RequestObject() + { + // Snippet: DeleteBookAsync(DeleteBookRequest,CallSettings) + // Additional: DeleteBookAsync(DeleteBookRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + DeleteBookRequest request = new DeleteBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + }; + // Make the request + await libraryServiceClient.DeleteBookAsync(request); + // End snippet + } + + /// Snippet for DeleteBook public void DeleteBook_RequestObject() { // Snippet: DeleteBook(DeleteBookRequest,CallSettings) @@ -2648,6 +2964,35 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() + { + // Snippet: UpdateBookAsync(string,Book,CallSettings) + // Additional: UpdateBookAsync(string,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, book); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook2() + { + // Snippet: UpdateBook(string,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, book); + // End snippet + } + + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync3() { // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) @@ -2665,7 +3010,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBook - public void UpdateBook2() + public void UpdateBook3() { // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client @@ -2681,6 +3026,41 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync4() + { + // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook4() + { + // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -2717,7 +3097,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync() + public async Task MoveBookAsync1() { // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) @@ -2732,7 +3112,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBook - public void MoveBook() + public void MoveBook1() { // Snippet: MoveBook(BookName,ShelfName,CallSettings) // Create client @@ -2745,6 +3125,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MoveBookAsync + public async Task MoveBookAsync2() + { + // Snippet: MoveBookAsync(string,string,CallSettings) + // Additional: MoveBookAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MoveBook + public void MoveBook2() + { + // Snippet: MoveBook(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = libraryServiceClient.MoveBook(name, otherShelfName); + // End snippet + } + /// Snippet for MoveBookAsync public async Task MoveBookAsync_RequestObject() { @@ -2791,7 +3200,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -2802,7 +3211,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -2810,10 +3219,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -2833,7 +3242,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -2844,7 +3253,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -2852,10 +3261,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -2877,7 +3286,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -2888,7 +3297,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -2896,10 +3305,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -2921,7 +3330,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -2932,7 +3341,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -2940,10 +3349,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -2953,19 +3362,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync_RequestObject() + public async Task ListStringsAsync3() { - // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) + // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(request); + libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -2976,7 +3385,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -2984,10 +3393,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -2997,19 +3406,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings_RequestObject() + public void ListStrings3() { - // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Snippet: ListStrings(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); // Make the request PagedEnumerable response = - libraryServiceClient.ListStrings(request); + libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -3020,7 +3429,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -3028,10 +3437,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -3040,18 +3449,106 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync_RequestObject() { - // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((string item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (string item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (string item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListStrings + public void ListStrings_RequestObject() + { + // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedEnumerable response = + libraryServiceClient.ListStrings(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (string item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (string item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (string item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync1() + { + // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment { Comment = ByteString.Empty, Stage = Comment.Types.Stage.Unset, @@ -3064,7 +3561,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for AddComments - public void AddComments() + public void AddComments1() { // Snippet: AddComments(BookName,IEnumerable,CallSettings) // Create client @@ -3085,6 +3582,51 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync2() + { + // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + await libraryServiceClient.AddCommentsAsync(name, comments); + // End snippet + } + + /// Snippet for AddComments + public void AddComments2() + { + // Snippet: AddComments(string,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + libraryServiceClient.AddComments(name, comments); + // End snippet + } + /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -3137,7 +3679,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync() + public async Task GetBookFromArchiveAsync1() { // Snippet: GetBookFromArchiveAsync(ArchivedBookName,CallSettings) // Additional: GetBookFromArchiveAsync(ArchivedBookName,CancellationToken) @@ -3151,7 +3693,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchive - public void GetBookFromArchive() + public void GetBookFromArchive1() { // Snippet: GetBookFromArchive(ArchivedBookName,CallSettings) // Create client @@ -3163,6 +3705,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromArchiveAsync + public async Task GetBookFromArchiveAsync2() + { + // Snippet: GetBookFromArchiveAsync(string,CallSettings) + // Additional: GetBookFromArchiveAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + // Make the request + BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name); + // End snippet + } + + /// Snippet for GetBookFromArchive + public void GetBookFromArchive2() + { + // Snippet: GetBookFromArchive(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + // Make the request + BookFromArchive response = libraryServiceClient.GetBookFromArchive(name); + // End snippet + } + /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -3197,7 +3766,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync() + public async Task GetBookFromAnywhereAsync1() { // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,CallSettings) // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,CancellationToken) @@ -3212,7 +3781,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere() + public void GetBookFromAnywhere1() { // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,CallSettings) // Create client @@ -3225,6 +3794,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAnywhereAsync + public async Task GetBookFromAnywhereAsync2() + { + // Snippet: GetBookFromAnywhereAsync(string,string,CallSettings) + // Additional: GetBookFromAnywhereAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName); + // End snippet + } + + /// Snippet for GetBookFromAnywhere + public void GetBookFromAnywhere2() + { + // Snippet: GetBookFromAnywhere(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName); + // End snippet + } + /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -3261,7 +3859,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync() + public async Task GetBookFromAbsolutelyAnywhereAsync1() { // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) @@ -3275,7 +3873,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere() + public void GetBookFromAbsolutelyAnywhere1() { // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) // Create client @@ -3287,6 +3885,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync + public async Task GetBookFromAbsolutelyAnywhereAsync2() + { + // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhere + public void GetBookFromAbsolutelyAnywhere2() + { + // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); + // End snippet + } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -3321,7 +3946,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync() + public async Task UpdateBookIndexAsync1() { // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) @@ -3340,7 +3965,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndex - public void UpdateBookIndex() + public void UpdateBookIndex1() { // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) // Create client @@ -3357,6 +3982,43 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookIndexAsync + public async Task UpdateBookIndexAsync2() + { + // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); + // End snippet + } + + /// Snippet for UpdateBookIndex + public void UpdateBookIndex2() + { + // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); + // End snippet + } + /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -3499,7 +4161,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync() { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3513,7 +4175,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -3524,7 +4186,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -3532,10 +4194,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -3547,7 +4209,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooks public void FindRelatedBooks() { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3561,7 +4223,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over all response items, lazily performing RPCs as required - foreach (BookName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -3572,7 +4234,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -3580,10 +4242,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -3601,18 +4263,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = { }, + Shelves = { }, }; // Make the request PagedAsyncEnumerable response = libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -3623,7 +4285,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -3631,10 +4293,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -3652,18 +4314,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNames = + Names = { new BookName("[SHELF]", "[BOOK]"), }, - ShelvesAsShelfNames = { }, + Shelves = { }, }; // Make the request PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over all response items, lazily performing RPCs as required - foreach (BookName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -3674,7 +4336,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -3682,10 +4344,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -3759,7 +4421,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync() + public async Task GetBigBookAsync1() { // Snippet: GetBigBookAsync(BookName,CallSettings) // Additional: GetBigBookAsync(BookName,CancellationToken) @@ -3792,7 +4454,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook() + public void GetBigBook1() { // Snippet: GetBigBook(BookName,CallSettings) // Create client @@ -3824,19 +4486,17 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync_RequestObject() + public async Task GetBigBookAsync2() { - // Snippet: GetBigBookAsync(GetBookRequest,CallSettings) + // Snippet: GetBigBookAsync(string,CallSettings) + // Additional: GetBigBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; + BookName name = new BookName("[SHELF]", "[BOOK]"); // Make the request Operation response = - await libraryServiceClient.GetBigBookAsync(request); + await libraryServiceClient.GetBigBookAsync(name); // Poll until the returned long-running operation is complete Operation completedResponse = @@ -3859,9 +4519,76 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook_RequestObject() + public void GetBigBook2() { - // Snippet: GetBigBook(GetBookRequest,CallSettings) + // Snippet: GetBigBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigBook(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigBook(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBookAsync + public async Task GetBigBookAsync_RequestObject() + { + // Snippet: GetBigBookAsync(GetBookRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + GetBookRequest request = new GetBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + }; + // Make the request + Operation response = + await libraryServiceClient.GetBigBookAsync(request); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigBookAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBook + public void GetBigBook_RequestObject() + { + // Snippet: GetBigBook(GetBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3894,7 +4621,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync() + public async Task GetBigNothingAsync1() { // Snippet: GetBigNothingAsync(BookName,CallSettings) // Additional: GetBigNothingAsync(BookName,CancellationToken) @@ -3925,7 +4652,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing() + public void GetBigNothing1() { // Snippet: GetBigNothing(BookName,CallSettings) // Create client @@ -3954,6 +4681,67 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBigNothingAsync + public async Task GetBigNothingAsync2() + { + // Snippet: GetBigNothingAsync(string,CallSettings) + // Additional: GetBigNothingAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + await libraryServiceClient.GetBigNothingAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothing + public void GetBigNothing2() + { + // Snippet: GetBigNothing(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigNothing(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigNothing(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + /// Snippet for GetBigNothingAsync public async Task GetBigNothingAsync_RequestObject() { @@ -4046,8 +4834,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync2() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4149,7 +4937,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParams public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -4249,69 +5037,274 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() + public async Task TestOptionalRequiredFlatteningParamsAsync3() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 0, - RequiredSingularInt64 = 0L, - RequiredSingularFloat = 0.0f, - RequiredSingularDouble = 0.0, - RequiredSingularBool = false, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "", - RequiredSingularBytes = ByteString.Empty, - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - RequiredSingularFixed32 = 0, - RequiredSingularFixed64 = 0L, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - }; + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(request); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams_RequestObject() + public void TestOptionalRequiredFlatteningParams3() { - // Snippet: TestOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 0, - RequiredSingularInt64 = 0L, - RequiredSingularFloat = 0.0f, - RequiredSingularDouble = 0.0, - RequiredSingularBool = false, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "", - RequiredSingularBytes = ByteString.Empty, - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 0, + RequiredSingularInt64 = 0L, + RequiredSingularFloat = 0.0f, + RequiredSingularDouble = 0.0, + RequiredSingularBool = false, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "", + RequiredSingularBytes = ByteString.Empty, + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularFixed32 = 0, + RequiredSingularFixed64 = 0L, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + }; + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(request); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams_RequestObject() + { + // Snippet: TestOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 0, + RequiredSingularInt64 = 0L, + RequiredSingularFloat = 0.0f, + RequiredSingularDouble = 0.0, + RequiredSingularBool = false, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "", + RequiredSingularBytes = ByteString.Empty, + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 0, @@ -4325,9 +5318,9 @@ namespace Google.Example.Library.V1.Snippets RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -4788,8 +5781,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), + Name = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -4801,8 +5793,7 @@ namespace Google.Example.Library.V1.Tests .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = client.GetShelf(name, message); + Shelf response = client.GetShelf(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -4817,8 +5808,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), + Name = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -4830,8 +5820,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = await client.GetShelfAsync(name, message); + Shelf response = await client.GetShelfAsync(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -4848,7 +5837,6 @@ namespace Google.Example.Library.V1.Tests { ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), - StringBuilder = new StringBuilder(), }; Shelf expectedResponse = new Shelf { @@ -4861,8 +5849,7 @@ namespace Google.Example.Library.V1.Tests LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = client.GetShelf(name, message, stringBuilder); + Shelf response = client.GetShelf(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -4879,7 +5866,6 @@ namespace Google.Example.Library.V1.Tests { ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), - StringBuilder = new StringBuilder(), }; Shelf expectedResponse = new Shelf { @@ -4892,8 +5878,7 @@ namespace Google.Example.Library.V1.Tests LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = await client.GetShelfAsync(name, message, stringBuilder); + Shelf response = await client.GetShelfAsync(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -4906,10 +5891,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetShelfRequest request = new GetShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Options = "options-1249474914", + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf { @@ -4917,10 +5902,12 @@ namespace Google.Example.Library.V1.Tests Theme = "theme110327241", InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetShelf(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.GetShelf(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = client.GetShelf(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -4933,10 +5920,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetShelfRequest request = new GetShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), - Options = "options-1249474914", + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf { @@ -4944,90 +5931,312 @@ namespace Google.Example.Library.V1.Tests Theme = "theme110327241", InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetShelfAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = await client.GetShelfAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = await client.GetShelfAsync(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void DeleteShelf() + public void GetShelf5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - client.DeleteShelf(name); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = client.GetShelf(name, message, stringBuilder); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task DeleteShelfAsync() + public async Task GetShelfAsync5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ShelfName name = new ShelfName("[SHELF]"); - await client.DeleteShelfAsync(name); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = await client.GetShelfAsync(name, message, stringBuilder); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void DeleteShelf2() + public void GetShelf6() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteShelfRequest request = new DeleteShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest + { + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), + }; + Shelf expectedResponse = new Shelf { ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.DeleteShelf(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = client.GetShelf(name, message, stringBuilder); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task DeleteShelfAsync2() + public async Task GetShelfAsync6() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteShelfRequest request = new DeleteShelfRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - ShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(request, It.IsAny())) + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = await client.GetShelfAsync(name, message, stringBuilder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetShelf7() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetShelfRequest request = new GetShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + Options = "options-1249474914", + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelf(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf response = client.GetShelf(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetShelfAsync7() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetShelfRequest request = new GetShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + Options = "options-1249474914", + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelfAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf response = await client.GetShelfAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteShelf() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + client.DeleteShelf(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task DeleteShelfAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + await client.DeleteShelfAsync(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteShelf2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + Name = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + client.DeleteShelf(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task DeleteShelfAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest expectedRequest = new DeleteShelfRequest + { + Name = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + await client.DeleteShelfAsync(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteShelf3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest request = new DeleteShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + client.DeleteShelf(request); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task DeleteShelfAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteShelfRequest request = new DeleteShelfRequest + { + ShelfName = new ShelfName("[SHELF]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelfAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteShelfAsync(request); @@ -5094,6 +6303,64 @@ namespace Google.Example.Library.V1.Tests [Fact] public void MergeShelves2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MergeShelvesRequest expectedRequest = new MergeShelvesRequest + { + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = client.MergeShelves(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MergeShelvesAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MergeShelvesRequest expectedRequest = new MergeShelvesRequest + { + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = await client.MergeShelvesAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MergeShelves3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5120,7 +6387,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MergeShelvesAsync2() + public async Task MergeShelvesAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5214,9 +6481,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - CreateBookRequest request = new CreateBookRequest + CreateBookRequest expectedRequest = new CreateBookRequest { - ShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -5226,10 +6493,12 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.CreateBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.CreateBook(request); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = client.CreateBook(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -5242,9 +6511,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - CreateBookRequest request = new CreateBookRequest + CreateBookRequest expectedRequest = new CreateBookRequest { - ShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -5254,16 +6523,74 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.CreateBookAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.CreateBookAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = await client.CreateBookAsync(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void PublishSeries() + public void CreateBook3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + CreateBookRequest request = new CreateBookRequest + { + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.CreateBook(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = client.CreateBook(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task CreateBookAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + CreateBookRequest request = new CreateBookRequest + { + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.CreateBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.CreateBookAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void PublishSeries() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5464,6 +6791,62 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBook2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookRequest expectedRequest = new GetBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book response = client.GetBook(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookRequest expectedRequest = new GetBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book response = await client.GetBookAsync(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5490,7 +6873,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookAsync2() + public async Task GetBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5560,6 +6943,48 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteBook2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteBookRequest expectedRequest = new DeleteBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + client.DeleteBook(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task DeleteBookAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + DeleteBookRequest expectedRequest = new DeleteBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + await client.DeleteBookAsync(name); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void DeleteBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5579,7 +7004,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteBookAsync2() + public async Task DeleteBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5668,11 +7093,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -5685,11 +7107,8 @@ namespace Google.Example.Library.V1.Tests .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + Book response = client.UpdateBook(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -5704,11 +7123,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -5721,11 +7137,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + Book response = await client.UpdateBookAsync(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -5738,10 +7151,13 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -5750,10 +7166,15 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.UpdateBook(request); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -5766,10 +7187,13 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -5778,26 +7202,34 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.UpdateBookAsync(request); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBook() + public void UpdateBook4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -5806,28 +7238,34 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = client.MoveBook(name, otherShelfName); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBookAsync() + public async Task UpdateBookAsync4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -5836,28 +7274,31 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = await client.MoveBookAsync(name, otherShelfName); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBook2() + public void UpdateBook5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest + UpdateBookRequest request = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Book = new Book(), }; Book expectedResponse = new Book { @@ -5866,26 +7307,26 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.MoveBook(request); + Book response = client.UpdateBook(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBookAsync2() + public async Task UpdateBookAsync5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest + UpdateBookRequest request = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Book = new Book(), }; Book expectedResponse = new Book { @@ -5894,28 +7335,204 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.MoveBookAsync(request); + Book response = await client.UpdateBookAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void AddComments() + public void MoveBook() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + MoveBookRequest expectedRequest = new MoveBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), - Comments = - { - new Comment + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = client.MoveBook(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBookAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = await client.MoveBookAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBook2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = client.MoveBook(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBookAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = await client.MoveBookAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBook3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = client.MoveBook(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBookAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.MoveBookAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void AddComments() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + Comments = + { + new Comment { Comment = ByteString.CopyFromUtf8("95"), Stage = Comment.Types.Stage.Unset, @@ -5982,6 +7599,84 @@ namespace Google.Example.Library.V1.Tests [Fact] public void AddComments2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + client.AddComments(name, comments); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task AddCommentsAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + await client.AddCommentsAsync(name, comments); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void AddComments3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6010,7 +7705,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task AddCommentsAsync2() + public async Task AddCommentsAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6102,9 +7797,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromArchiveRequest request = new GetBookFromArchiveRequest + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -6113,16 +7808,72 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBookFromArchive(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromArchive response = client.GetBookFromArchive(request); - Assert.Same(expectedResponse, response); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + BookFromArchive response = client.GetBookFromArchive(name); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] public async Task GetBookFromArchiveAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest + { + Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + BookFromArchive response = await client.GetBookFromArchiveAsync(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBookFromArchive3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest request = new GetBookFromArchiveRequest + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchive(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromArchive response = client.GetBookFromArchive(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookFromArchiveAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6210,6 +7961,66 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAnywhere2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookFromAnywhereAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBookFromAnywhere3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6237,7 +8048,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAnywhereAsync2() + public async Task GetBookFromAnywhereAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6322,6 +8133,62 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAbsolutelyAnywhere2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task GetBookFromAbsolutelyAnywhereAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void GetBookFromAbsolutelyAnywhere3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6348,7 +8215,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync2() + public async Task GetBookFromAbsolutelyAnywhereAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6438,6 +8305,68 @@ namespace Google.Example.Library.V1.Tests [Fact] public void UpdateBookIndex2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + client.UpdateBookIndex(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task UpdateBookIndexAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + Name = new BookName("[SHELF]", "[BOOK]"), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + await client.UpdateBookIndexAsync(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void UpdateBookIndex3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6462,7 +8391,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookIndexAsync2() + public async Task UpdateBookIndexAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6557,9 +8486,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -6586,9 +8515,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceNameAsBookNames = { }, - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, - OptionalRepeatedResourceNameCommonAsProjectNames = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -6757,9 +8686,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -6786,9 +8715,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceNameAsBookNames = { }, - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, - OptionalRepeatedResourceNameCommonAsProjectNames = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -6932,7 +8861,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest { RequiredSingularInt32 = 72313594, RequiredSingularInt64 = 72313499L, @@ -6943,9 +8872,9 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -6957,44 +8886,195 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -7006,49 +9086,298 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNames = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommonAsProjectNames = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, }; TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest request = new MoveBooksRequest(); - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - MoveBooksResponse response = client.MoveBooks(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void TestOptionalRequiredFlatteningParams4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest request = new MoveBooksRequest(); + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + MoveBooksResponse response = client.MoveBooks(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); MoveBooksRequest request = new MoveBooksRequest(); @@ -8829,9 +11158,6 @@ namespace Google.Example.Library.V1 /// /// The name of the shelf to retrieve. /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// /// /// If not null, applies overrides to this RPC call. /// @@ -8839,13 +11165,11 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - ShelfName name, - SomeMessage message, + string name, gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( new GetShelfRequest { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Message = message, // Optional + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), }, callSettings); @@ -8855,9 +11179,6 @@ namespace Google.Example.Library.V1 /// /// The name of the shelf to retrieve. /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// /// /// A to use for this RPC. /// @@ -8865,11 +11186,9 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - ShelfName name, - SomeMessage message, + string name, st::CancellationToken cancellationToken) => GetShelfAsync( name, - message, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -8878,9 +11197,6 @@ namespace Google.Example.Library.V1 /// /// The name of the shelf to retrieve. /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// /// /// If not null, applies overrides to this RPC call. /// @@ -8888,13 +11204,11 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Shelf GetShelf( - ShelfName name, - SomeMessage message, + string name, gaxgrpc::CallSettings callSettings = null) => GetShelf( new GetShelfRequest { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Message = message, // Optional + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), }, callSettings); @@ -8914,12 +11228,12 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - string name, + ShelfName name, SomeMessage message, gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( new GetShelfRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), Message = message, // Optional }, callSettings); @@ -8940,7 +11254,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - string name, + ShelfName name, SomeMessage message, st::CancellationToken cancellationToken) => GetShelfAsync( name, @@ -8963,12 +11277,12 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Shelf GetShelf( - string name, + ShelfName name, SomeMessage message, gaxgrpc::CallSettings callSettings = null) => GetShelf( new GetShelfRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), Message = message, // Optional }, callSettings); @@ -8982,9 +11296,6 @@ namespace Google.Example.Library.V1 /// /// Field to verify that message-type query parameter gets flattened. /// - /// - /// - /// /// /// If not null, applies overrides to this RPC call. /// @@ -8992,15 +11303,13 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - ShelfName name, + string name, SomeMessage message, - StringBuilder stringBuilder, gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( new GetShelfRequest { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), Message = message, // Optional - StringBuilder = stringBuilder, // Optional }, callSettings); @@ -9013,9 +11322,6 @@ namespace Google.Example.Library.V1 /// /// Field to verify that message-type query parameter gets flattened. /// - /// - /// - /// /// /// A to use for this RPC. /// @@ -9023,13 +11329,171 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetShelfAsync( - ShelfName name, + string name, SomeMessage message, - StringBuilder stringBuilder, st::CancellationToken cancellationToken) => GetShelfAsync( name, message, - stringBuilder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + SomeMessage message, + StringBuilder stringBuilder, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + stringBuilder, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -9153,6 +11617,96 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + StringBuilder stringBuilder, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + stringBuilder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + /// /// Gets a shelf. /// @@ -9420,8 +11974,8 @@ namespace Google.Example.Library.V1 /// /// Deletes a shelf. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the shelf to delete. /// /// /// If not null, applies overrides to this RPC call. @@ -9430,8 +11984,65 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - gaxgrpc::CallSettings callSettings = null) + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + string name, + st::CancellationToken cancellationToken) => DeleteShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteShelf( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelf( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + DeleteShelfRequest request, + gaxgrpc::CallSettings callSettings = null) { throw new sys::NotImplementedException(); } @@ -9632,6 +12243,87 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MergeShelvesAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf MergeShelves( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelves( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + /// /// Merges two shelves by adding all books from the shelf named /// `other_shelf_name` to shelf `name`, and deletes @@ -9844,6 +12536,81 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + st::CancellationToken cancellationToken) => CreateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book CreateBook( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBook( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + /// /// Creates a book. /// @@ -10184,8 +12951,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// /// /// If not null, applies overrides to this RPC call. @@ -10194,17 +12961,19 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); /// /// Gets a book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// /// /// A to use for this RPC. @@ -10213,16 +12982,16 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookAsync( - GetBookRequest request, + string name, st::CancellationToken cancellationToken) => GetBookAsync( - request, + name, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// /// /// If not null, applies overrides to this RPC call. @@ -10231,14 +13000,72 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book GetBook( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + string name, + gaxgrpc::CallSettings callSettings = null) => GetBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); /// - /// Lists books in a shelf. + /// Gets a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + GetBookRequest request, + st::CancellationToken cancellationToken) => GetBookAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book GetBook( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Lists books in a shelf. /// /// /// The name of the shelf whose books we'd like to list. @@ -10389,6 +13216,82 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListBooksAsync( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListBooks( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooks( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + /// /// Lists books in a shelf. /// @@ -10541,6 +13444,63 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + st::CancellationToken cancellationToken) => DeleteBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteBook( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBook( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Deletes a book. /// @@ -10750,18 +13710,9 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// - /// - /// An optional foo. - /// /// /// The book to update with. /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// /// /// If not null, applies overrides to this RPC call. /// @@ -10769,19 +13720,13 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, - string optionalFoo, + string name, Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional }, callSettings); @@ -10791,18 +13736,9 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// - /// - /// An optional foo. - /// /// /// The book to update with. /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// /// /// A to use for this RPC. /// @@ -10810,17 +13746,11 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, - string optionalFoo, + string name, Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, st::CancellationToken cancellationToken) => UpdateBookAsync( name, - optionalFoo, book, - updateMask, - physicalMask, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -10829,18 +13759,9 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// - /// - /// An optional foo. - /// /// /// The book to update with. /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// /// /// If not null, applies overrides to this RPC call. /// @@ -10848,19 +13769,13 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book UpdateBook( - BookName name, - string optionalFoo, + string name, Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBook( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional }, callSettings); @@ -10889,7 +13804,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -10897,7 +13812,7 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), UpdateMask = updateMask, // Optional @@ -10930,7 +13845,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -10968,7 +13883,7 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book UpdateBook( - string name, + BookName name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -10976,7 +13891,7 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings callSettings = null) => UpdateBook( new UpdateBookRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), UpdateMask = updateMask, // Optional @@ -10987,7 +13902,247 @@ namespace Google.Example.Library.V1 /// /// Updates a book. /// - /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + optionalFoo, + book, + updateMask, + physicalMask, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + optionalFoo, + book, + updateMask, + physicalMask, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// /// The request object containing all of the parameters for the API call. /// /// @@ -11193,8 +14348,11 @@ namespace Google.Example.Library.V1 /// /// Moves a book to another shelf, and returns the new book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. /// /// /// If not null, applies overrides to this RPC call. @@ -11203,14 +14361,86 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBookAsync( - MoveBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Moves a book to another shelf, and returns the new book. + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MoveBookAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book MoveBook( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBook( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + MoveBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Moves a book to another shelf, and returns the new book. /// /// /// The request object containing all of the parameters for the API call. @@ -11263,7 +14493,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( @@ -11291,7 +14521,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStrings( @@ -11322,7 +14552,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( IResourceName name, string pageToken = null, int? pageSize = null, @@ -11355,7 +14585,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( IResourceName name, string pageToken = null, int? pageSize = null, @@ -11388,7 +14618,73 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListStrings( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStrings( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string name, string pageToken = null, int? pageSize = null, @@ -11421,7 +14717,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string name, string pageToken = null, int? pageSize = null, @@ -11446,7 +14742,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -11465,7 +14761,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -11616,6 +14912,78 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + st::CancellationToken cancellationToken) => AddCommentsAsync( + name, + comments, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void AddComments( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddComments( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + /// /// Adds comments to a book /// @@ -11792,8 +15160,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book from an archive. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// /// /// If not null, applies overrides to this RPC call. @@ -11802,17 +15170,19 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); /// /// Gets a book from an archive. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// /// /// A to use for this RPC. @@ -11821,16 +15191,16 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, + string name, st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - request, + name, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book from an archive. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to retrieve. /// /// /// If not null, applies overrides to this RPC call. @@ -11839,11 +15209,69 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual BookFromArchive GetBookFromArchive( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + GetBookFromArchiveRequest request, + st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromArchive GetBookFromArchive( + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Gets a book from a shelf or archive. @@ -12001,6 +15429,84 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( + name, + altBookName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAnywhere( + string name, + string altBookName, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + }, + callSettings); + /// /// Gets a book from a shelf or archive. /// @@ -12177,6 +15683,66 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Test proper OneOf-Any resource name mapping /// @@ -12410,8 +15976,14 @@ namespace Google.Example.Library.V1 /// /// Updates the index of a book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with /// /// /// If not null, applies overrides to this RPC call. @@ -12420,17 +15992,29 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); /// /// Updates the index of a book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with /// /// /// A to use for this RPC. @@ -12439,29 +16023,98 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, + string name, + string indexName, + scg::IDictionary indexMap, st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - request, + name, + indexName, + indexMap, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Updates the index of a book. /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with /// /// /// If not null, applies overrides to this RPC call. /// public virtual void UpdateBookIndex( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test server streaming + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + UpdateBookIndexRequest request, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test server streaming /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. /// /// @@ -12504,6 +16157,28 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Test server streaming + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The name of the shelf to stream. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamShelvesStream StreamShelves( + string name, + gaxgrpc::CallSettings callSettings = null) => StreamShelves( + new StreamShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Test server streaming /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. @@ -12629,83 +16304,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( - new FindRelatedBooksRequest - { - BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable FindRelatedBooks( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( - new FindRelatedBooksRequest - { - BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( scg::IEnumerable names, scg::IEnumerable shelves, string pageToken = null, @@ -12743,7 +16342,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable FindRelatedBooks( + public virtual gax::PagedEnumerable FindRelatedBooks( scg::IEnumerable names, scg::IEnumerable shelves, string pageToken = null, @@ -12770,7 +16369,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -12789,7 +16388,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable FindRelatedBooks( + public virtual gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -13050,6 +16649,66 @@ namespace Google.Example.Library.V1 }, callSettings); + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBigBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + /// /// Test long-running operations /// @@ -13128,224 +16787,1499 @@ namespace Google.Example.Library.V1 /// /// The name of the book to retrieve. /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + BookName name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + BookName name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + BookName name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigNothingAsync. + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceGetBigNothingAsync( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigNothingOperationsClient, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// The long-running operations client for GetBigNothing. + /// + public virtual lro::OperationsClient GetBigNothingOperationsClient + { + get { throw new sys::NotImplementedException(); } + } + + /// + /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceGetBigNothing( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigNothingOperationsClient, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest + { + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( + new TestOptionalRequiredFlatteningParamsRequest + { + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + requiredSingularInt32, + requiredSingularInt64, + requiredSingularFloat, + requiredSingularDouble, + requiredSingularBool, + requiredSingularEnum, + requiredSingularString, + requiredSingularBytes, + requiredSingularMessage, + requiredSingularResourceName, + requiredSingularResourceNameOneof, + requiredSingularResourceNameCommon, + requiredSingularFixed32, + requiredSingularFixed64, + requiredRepeatedInt32, + requiredRepeatedInt64, + requiredRepeatedFloat, + requiredRepeatedDouble, + requiredRepeatedBool, + requiredRepeatedEnum, + requiredRepeatedString, + requiredRepeatedBytes, + requiredRepeatedMessage, + requiredRepeatedResourceName, + requiredRepeatedResourceNameOneof, + requiredRepeatedResourceNameCommon, + requiredRepeatedFixed32, + requiredRepeatedFixed64, + requiredMap, + optionalSingularInt32, + optionalSingularInt64, + optionalSingularFloat, + optionalSingularDouble, + optionalSingularBool, + optionalSingularEnum, + optionalSingularString, + optionalSingularBytes, + optionalSingularMessage, + optionalSingularResourceName, + optionalSingularResourceNameOneof, + optionalSingularResourceNameCommon, + optionalSingularFixed32, + optionalSingularFixed64, + optionalRepeatedInt32, + optionalRepeatedInt64, + optionalRepeatedFloat, + optionalRepeatedDouble, + optionalRepeatedBool, + optionalRepeatedEnum, + optionalRepeatedString, + optionalRepeatedBytes, + optionalRepeatedMessage, + optionalRepeatedResourceName, + optionalRepeatedResourceNameOneof, + optionalRepeatedResourceNameCommon, + optionalRepeatedFixed32, + optionalRepeatedFixed64, + optionalMap, + anyValue, + structValue, + valueValue, + listValueValue, + timeValue, + durationValue, + fieldMaskValue, + int32Value, + uint32Value, + int64Value, + uint64Value, + floatValue, + doubleValue, + stringValue, + boolValue, + bytesValue, + repeatedAnyValue, + repeatedStructValue, + repeatedValueValue, + repeatedListValueValue, + repeatedTimeValue, + repeatedDurationValue, + repeatedFieldMaskValue, + repeatedInt32Value, + repeatedUint32Value, + repeatedInt64Value, + repeatedUint64Value, + repeatedFloatValue, + repeatedDoubleValue, + repeatedStringValue, + repeatedBoolValue, + repeatedBytesValue, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - BookName name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - BookName name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - BookName name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigNothingAsync. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// A task representing the result of polling the operation. - public virtual stt::Task> PollOnceGetBigNothingAsync( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigNothingOperationsClient, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// The long-running operations client for GetBigNothing. - /// - public virtual lro::OperationsClient GetBigNothingOperationsClient - { - get { throw new sys::NotImplementedException(); } - } - - /// - /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// The result of polling the operation. - public virtual lro::Operation PollOnceGetBigNothing( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigNothingOperationsClient, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest - { - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// A to use for this RPC. + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// /// /// If not null, applies overrides to this RPC call. /// @@ -13353,9 +18287,189 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( new TestOptionalRequiredFlatteningParamsRequest { + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); @@ -13648,9 +18762,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -13662,9 +18776,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -13677,9 +18791,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -13691,9 +18805,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -13741,9 +18855,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -13755,9 +18869,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -13770,9 +18884,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional @@ -13784,9 +18898,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -14114,9 +19228,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -14128,9 +19242,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -14143,9 +19257,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -14157,9 +19271,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -14577,9 +19691,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -14591,9 +19705,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -14606,9 +19720,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -14620,9 +19734,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -14670,9 +19784,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -14684,9 +19798,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -14699,9 +19813,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional @@ -14713,9 +19827,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -17235,12 +22349,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable ListStringsAsync( + public override gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); } /// @@ -17255,12 +22369,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable ListStrings( + public override gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); } /// @@ -17634,12 +22748,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -17654,12 +22768,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable FindRelatedBooks( + public override gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -18112,24 +23226,24 @@ namespace Google.Example.Library.V1 } public partial class ListStringsRequest : gaxgrpc::IPageRequest { } - public partial class ListStringsResponse : gaxgrpc::IPageResponse + public partial class ListStringsResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => StringsAsResourceNames.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => Strings.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } public partial class FindRelatedBooksRequest : gaxgrpc::IPageRequest { } - public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse + public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => BookNames.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => Names.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline index 325ea4405e..4c9aae8059 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline @@ -731,8 +731,8 @@ public class FindRelatedBooksCallableCallableListOdyssey { .build(); while (true) { FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request); - for (ShelfBookName responseItem : ShelfBookName.parseList(response.getNamesList())) { - ShelfBookName book = responseItem; + for (String responseItem : response.getNamesList()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } String nextPageToken = response.getNextPageToken(); @@ -779,7 +779,6 @@ package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; -import com.google.example.library.v1.ShelfBookName; import java.util.Arrays; import java.util.List; @@ -791,7 +790,6 @@ public class FindRelatedBooksFlattenedPagedOdyssey { * import com.google.api.core.ApiFuture; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; - * import com.google.example.library.v1.ShelfBookName; * import java.util.Arrays; * import java.util.List; */ @@ -807,8 +805,8 @@ public class FindRelatedBooksFlattenedPagedOdyssey { // Do something - for (ShelfBookName responseItem : future.get().iterateAllAsShelfBookName()) { - ShelfBookName book = responseItem; + for (String responseItem : future.get().iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -884,8 +882,8 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { // Do something - for (ShelfBookName responseItem : future.get().iterateAllAsShelfBookName()) { - ShelfBookName book = responseItem; + for (String responseItem : future.get().iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -953,8 +951,8 @@ public class FindRelatedBooksRequestPagedOdyssey { .addAllNames(ShelfBookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); - for (ShelfBookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) { - ShelfBookName book = responseItem; + for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -4280,6 +4278,7 @@ import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.util.concurrent.MoreExecutors; @@ -6039,7 +6038,7 @@ public class LibraryClient implements BackgroundResource { *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6060,7 +6059,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6085,7 +6084,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6110,7 +6109,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6134,7 +6133,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6154,7 +6153,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
    +   *     for (String element : response.getStringsList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -6887,7 +6886,7 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6920,7 +6919,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(ShelfBookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (ShelfBookName element : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6950,7 +6949,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (ShelfBookName element : future.get().iterateAllAsShelfBookName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6976,7 +6975,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (ShelfBookName element : ShelfBookName.parseList(response.getNamesList())) {
    +   *     for (String element : response.getNamesList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7446,7 +7445,7 @@ public class LibraryClient implements BackgroundResource {
        *   List<StringValue> repeatedStringValue = new ArrayList<>();
        *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
        *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
    -   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon.toString(), requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon.toString(), optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
        * }
        * 
    * @@ -7574,7 +7573,7 @@ public class LibraryClient implements BackgroundResource { * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, String requiredSingularResourceName, String requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String optionalSingularResourceName, String optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder() .setRequiredSingularInt32(requiredSingularInt32) @@ -7586,9 +7585,9 @@ public class LibraryClient implements BackgroundResource { .setRequiredSingularString(requiredSingularString) .setRequiredSingularBytes(requiredSingularBytes) .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredSingularResourceName(requiredSingularResourceName) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) - .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) + .setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof == null ? null : requiredSingularResourceNameOneof.toString()) + .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon == null ? null : requiredSingularResourceNameCommon.toString()) .setRequiredSingularFixed32(requiredSingularFixed32) .setRequiredSingularFixed64(requiredSingularFixed64) .addAllRequiredRepeatedInt32(requiredRepeatedInt32) @@ -7647,9 +7646,9 @@ public class LibraryClient implements BackgroundResource { .setOptionalSingularString(optionalSingularString) .setOptionalSingularBytes(optionalSingularBytes) .setOptionalSingularMessage(optionalSingularMessage) - .setOptionalSingularResourceName(optionalSingularResourceName) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) - .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) + .setOptionalSingularResourceName(optionalSingularResourceName == null ? null : optionalSingularResourceName.toString()) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof == null ? null : optionalSingularResourceNameOneof.toString()) + .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon == null ? null : optionalSingularResourceNameCommon.toString()) .setOptionalSingularFixed32(optionalSingularFixed32) .setOptionalSingularFixed64(optionalSingularFixed64) .addAllOptionalRepeatedInt32(optionalRepeatedInt32) @@ -7719,9 +7718,9 @@ public class LibraryClient implements BackgroundResource { * String requiredSingularString = ""; * ByteString requiredSingularBytes = ByteString.copyFromUtf8(""); * TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - * String formattedRequiredSingularResourceName = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedRequiredSingularResourceNameOneof = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedRequiredSingularResourceNameCommon = LibraryClient.formatProjectName("[PROJECT]"); + * ShelfBookName requiredSingularResourceName = ShelfBookName.of("[SHELF]", "[BOOK]"); + * BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF]", "[BOOK]"); + * ProjectName requiredSingularResourceNameCommon = ProjectName.of("[PROJECT]"); * int requiredSingularFixed32 = 0; * long requiredSingularFixed64 = 0L; * List<Integer> requiredRepeatedInt32 = new ArrayList<>(); @@ -7780,9 +7779,9 @@ public class LibraryClient implements BackgroundResource { * String optionalSingularString = ""; * ByteString optionalSingularBytes = ByteString.copyFromUtf8(""); * TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - * String formattedOptionalSingularResourceName = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedOptionalSingularResourceNameOneof = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedOptionalSingularResourceNameCommon = LibraryClient.formatProjectName("[PROJECT]"); + * ShelfBookName optionalSingularResourceName = ShelfBookName.of("[SHELF]", "[BOOK]"); + * BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF]", "[BOOK]"); + * ProjectName optionalSingularResourceNameCommon = ProjectName.of("[PROJECT]"); * int optionalSingularFixed32 = 0; * long optionalSingularFixed64 = 0L; * List<Integer> optionalRepeatedInt32 = new ArrayList<>(); @@ -7832,7 +7831,7 @@ public class LibraryClient implements BackgroundResource { * List<StringValue> repeatedStringValue = new ArrayList<>(); * List<BoolValue> repeatedBoolValue = new ArrayList<>(); * List<BytesValue> repeatedBytesValue = new ArrayList<>(); - * TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, formattedRequiredSingularResourceName, formattedRequiredSingularResourceNameOneof, formattedRequiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, formattedOptionalSingularResourceName, formattedOptionalSingularResourceNameOneof, formattedOptionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + * TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon.toString(), requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon.toString(), optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); * } *
    * @@ -8774,15 +8773,7 @@ public class LibraryClient implements BackgroundResource { private ListStringsPagedResponse(ListStringsPage page) { super(page, ListStringsFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } @@ -8815,25 +8806,9 @@ public class LibraryClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + + } @@ -8857,15 +8832,7 @@ public class LibraryClient implements BackgroundResource { List pages, int collectionSize) { return new ListStringsFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse< @@ -8894,15 +8861,7 @@ public class LibraryClient implements BackgroundResource { private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) { super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsShelfBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } + } @@ -8935,25 +8894,9 @@ public class LibraryClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsShelfBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsShelfBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } + + } @@ -8977,15 +8920,7 @@ public class LibraryClient implements BackgroundResource { List pages, int collectionSize) { return new FindRelatedBooksFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsShelfBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } + } } @@ -10338,6 +10273,7 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksRequest; @@ -10524,6 +10460,7 @@ import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksRequest; @@ -11774,6 +11711,7 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; @@ -14845,10 +14783,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -14893,10 +14827,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -15061,7 +14991,7 @@ public class LibraryClientTest { GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(Objects.toString(altBookName), actualRequest.getAltBookName()); + Assert.assertEquals(BookName.from(altBookName), actualRequest.getAltBookName()); Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); Assert.assertTrue( @@ -15371,10 +15301,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsShelfBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(ShelfBookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -15733,9 +15659,9 @@ public class LibraryClientTest { Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); - Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); + Assert.assertEquals(requiredSingularResourceName, ShelfBookName.parse(actualRequest.getRequiredSingularResourceName())); + Assert.assertEquals(requiredSingularResourceNameOneof, BookNames.parse(actualRequest.getRequiredSingularResourceNameOneof())); + Assert.assertEquals(requiredSingularResourceNameCommon, ProjectName.parse(actualRequest.getRequiredSingularResourceNameCommon())); Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); @@ -15794,9 +15720,9 @@ public class LibraryClientTest { Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); - Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); + Assert.assertEquals(optionalSingularResourceName, ShelfBookName.parse(actualRequest.getOptionalSingularResourceName())); + Assert.assertEquals(optionalSingularResourceNameOneof, BookNames.parse(actualRequest.getOptionalSingularResourceNameOneof())); + Assert.assertEquals(optionalSingularResourceNameCommon, ProjectName.parse(actualRequest.getOptionalSingularResourceNameCommon())); Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline index cf97279d4e..8c7bed4080 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline @@ -630,8 +630,8 @@ public class FindRelatedBooksOdyssey { .addAllNames(ShelfBookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); - for (ShelfBookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) { - ShelfBookName book = responseItem; + for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -2229,6 +2229,7 @@ import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.util.concurrent.MoreExecutors; @@ -3886,7 +3887,7 @@ public class LibraryClient implements BackgroundResource { *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3907,7 +3908,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3932,7 +3933,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3957,7 +3958,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3981,7 +3982,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4001,7 +4002,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
    +   *     for (String element : response.getStringsList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -4704,7 +4705,7 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4737,7 +4738,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(ShelfBookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (ShelfBookName element : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4767,7 +4768,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (ShelfBookName element : future.get().iterateAllAsShelfBookName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4793,7 +4794,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (ShelfBookName element : ShelfBookName.parseList(response.getNamesList())) {
    +   *     for (String element : response.getNamesList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -5231,7 +5232,7 @@ public class LibraryClient implements BackgroundResource {
        *   List<StringValue> repeatedStringValue = new ArrayList<>();
        *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
        *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
    -   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon.toString(), requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon.toString(), optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
        * }
        * 
    * @@ -5327,7 +5328,7 @@ public class LibraryClient implements BackgroundResource { * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, String requiredSingularResourceName, String requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String optionalSingularResourceName, String optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder() .setRequiredSingularInt32(requiredSingularInt32) @@ -5339,9 +5340,9 @@ public class LibraryClient implements BackgroundResource { .setRequiredSingularString(requiredSingularString) .setRequiredSingularBytes(requiredSingularBytes) .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredSingularResourceName(requiredSingularResourceName) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) - .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) + .setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof == null ? null : requiredSingularResourceNameOneof.toString()) + .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon == null ? null : requiredSingularResourceNameCommon.toString()) .setRequiredSingularFixed32(requiredSingularFixed32) .setRequiredSingularFixed64(requiredSingularFixed64) .addAllRequiredRepeatedInt32(requiredRepeatedInt32) @@ -5368,9 +5369,9 @@ public class LibraryClient implements BackgroundResource { .setOptionalSingularString(optionalSingularString) .setOptionalSingularBytes(optionalSingularBytes) .setOptionalSingularMessage(optionalSingularMessage) - .setOptionalSingularResourceName(optionalSingularResourceName) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) - .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) + .setOptionalSingularResourceName(optionalSingularResourceName == null ? null : optionalSingularResourceName.toString()) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof == null ? null : optionalSingularResourceNameOneof.toString()) + .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon == null ? null : optionalSingularResourceNameCommon.toString()) .setOptionalSingularFixed32(optionalSingularFixed32) .setOptionalSingularFixed64(optionalSingularFixed64) .addAllOptionalRepeatedInt32(optionalRepeatedInt32) @@ -5440,9 +5441,9 @@ public class LibraryClient implements BackgroundResource { * String requiredSingularString = ""; * ByteString requiredSingularBytes = ByteString.copyFromUtf8(""); * TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - * String formattedRequiredSingularResourceName = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedRequiredSingularResourceNameOneof = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedRequiredSingularResourceNameCommon = LibraryClient.formatProjectName("[PROJECT]"); + * ShelfBookName requiredSingularResourceName = ShelfBookName.of("[SHELF]", "[BOOK]"); + * BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF]", "[BOOK]"); + * ProjectName requiredSingularResourceNameCommon = ProjectName.of("[PROJECT]"); * int requiredSingularFixed32 = 0; * long requiredSingularFixed64 = 0L; * List<Integer> requiredRepeatedInt32 = new ArrayList<>(); @@ -5469,9 +5470,9 @@ public class LibraryClient implements BackgroundResource { * String optionalSingularString = ""; * ByteString optionalSingularBytes = ByteString.copyFromUtf8(""); * TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - * String formattedOptionalSingularResourceName = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedOptionalSingularResourceNameOneof = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedOptionalSingularResourceNameCommon = LibraryClient.formatProjectName("[PROJECT]"); + * ShelfBookName optionalSingularResourceName = ShelfBookName.of("[SHELF]", "[BOOK]"); + * BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF]", "[BOOK]"); + * ProjectName optionalSingularResourceNameCommon = ProjectName.of("[PROJECT]"); * int optionalSingularFixed32 = 0; * long optionalSingularFixed64 = 0L; * List<Integer> optionalRepeatedInt32 = new ArrayList<>(); @@ -5521,7 +5522,7 @@ public class LibraryClient implements BackgroundResource { * List<StringValue> repeatedStringValue = new ArrayList<>(); * List<BoolValue> repeatedBoolValue = new ArrayList<>(); * List<BytesValue> repeatedBytesValue = new ArrayList<>(); - * TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, formattedRequiredSingularResourceName, formattedRequiredSingularResourceNameOneof, formattedRequiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, formattedOptionalSingularResourceName, formattedOptionalSingularResourceNameOneof, formattedOptionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + * TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon.toString(), requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon.toString(), optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); * } *
    * @@ -6271,15 +6272,7 @@ public class LibraryClient implements BackgroundResource { private ListStringsPagedResponse(ListStringsPage page) { super(page, ListStringsFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } @@ -6312,25 +6305,9 @@ public class LibraryClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + + } @@ -6354,15 +6331,7 @@ public class LibraryClient implements BackgroundResource { List pages, int collectionSize) { return new ListStringsFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse< @@ -6391,15 +6360,7 @@ public class LibraryClient implements BackgroundResource { private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) { super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsShelfBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } + } @@ -6432,25 +6393,9 @@ public class LibraryClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsShelfBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsShelfBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } + + } @@ -6474,15 +6419,7 @@ public class LibraryClient implements BackgroundResource { List pages, int collectionSize) { return new FindRelatedBooksFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsShelfBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ShelfBookName apply(String arg0) { - return ShelfBookName.parse(arg0); - } - } - ); - } + } } @@ -7835,6 +7772,7 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksRequest; @@ -8018,6 +7956,7 @@ import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.common.collect.ImmutableMap; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksRequest; @@ -9265,6 +9204,7 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.resourcenames.ResourceName; +import com.google.cloud.ProjectName; import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; @@ -12333,10 +12273,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -12381,10 +12317,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -12544,7 +12476,7 @@ public class LibraryClientTest { GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(Objects.toString(altBookName), actualRequest.getAltBookName()); + Assert.assertEquals(BookName.from(altBookName), actualRequest.getAltBookName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -12850,10 +12782,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsShelfBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(ShelfBookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -13180,9 +13108,9 @@ public class LibraryClientTest { Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); - Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); + Assert.assertEquals(requiredSingularResourceName, ShelfBookName.parse(actualRequest.getRequiredSingularResourceName())); + Assert.assertEquals(requiredSingularResourceNameOneof, BookNames.parse(actualRequest.getRequiredSingularResourceNameOneof())); + Assert.assertEquals(requiredSingularResourceNameCommon, ProjectName.parse(actualRequest.getRequiredSingularResourceNameCommon())); Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); Assert.assertEquals(requiredRepeatedInt32, actualRequest.getRequiredRepeatedInt32List()); @@ -13209,9 +13137,9 @@ public class LibraryClientTest { Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); - Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); + Assert.assertEquals(optionalSingularResourceName, ShelfBookName.parse(actualRequest.getOptionalSingularResourceName())); + Assert.assertEquals(optionalSingularResourceNameOneof, BookNames.parse(actualRequest.getOptionalSingularResourceNameOneof())); + Assert.assertEquals(optionalSingularResourceNameCommon, ProjectName.parse(actualRequest.getOptionalSingularResourceNameCommon())); Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); Assert.assertEquals(optionalRepeatedInt32, actualRequest.getOptionalRepeatedInt32List()); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index fe6358829a..ecd0cd4b77 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -716,9 +716,9 @@ namespace Google.Example.Library.V1.Samples }; PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over pages (of server-defined size), performing one RPC per page - await response.ForEachAsync((BookNameOneof item) => + await response.ForEachAsync((string item) => { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); }); } @@ -790,9 +790,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => { - foreach (BookNameOneof item in page) + foreach (string item in page) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } }); @@ -863,10 +863,10 @@ namespace Google.Example.Library.V1.Samples PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - foreach (BookNameOneof item in response) + Page singlePage = await response.ReadPageAsync(pageSize); + foreach (string item in response) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -930,20 +930,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, }; PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over pages (of server-defined size), performing one RPC per page - await response.ForEachAsync((BookNameOneof item) => + await response.ForEachAsync((string item) => { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); }); } @@ -1005,11 +1005,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -1018,9 +1018,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => { - foreach (BookNameOneof item in page) + foreach (string item in page) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } }); @@ -1082,11 +1082,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -1094,10 +1094,10 @@ namespace Google.Example.Library.V1.Samples PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - foreach (BookNameOneof item in response) + Page singlePage = await response.ReadPageAsync(pageSize); + foreach (string item in response) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -1168,9 +1168,9 @@ namespace Google.Example.Library.V1.Samples }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (BookNameOneof item in response) + foreach (string item in response) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1241,9 +1241,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required foreach (FindRelatedBooksResponse page in response.asRawResponses()) { - foreach (BookNameOneof item in page) + foreach (string item in page) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1314,10 +1314,10 @@ namespace Google.Example.Library.V1.Samples PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - foreach (BookNameOneof item in response) + Page singlePage = response.ReadPage(pageSize); + foreach (string item in response) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -1380,20 +1380,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (BookNameOneof item in response) + foreach (string item in response) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1454,11 +1454,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -1467,9 +1467,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required foreach (FindRelatedBooksResponse page in response.asRawResponses()) { - foreach (BookNameOneof item in page) + foreach (string item in page) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1531,11 +1531,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = + Shelves = { new ShelfName("[SHELF]"), }, @@ -1543,10 +1543,10 @@ namespace Google.Example.Library.V1.Samples PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - foreach (BookNameOneof item in response) + Page singlePage = response.ReadPage(pageSize); + foreach (string item in response) { - BookNameOneof book = item; + string book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -4224,8 +4224,8 @@ namespace Google.Example.Library.V1.Samples RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, @@ -4980,6 +4980,33 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() + { + // Snippet: GetShelfAsync(string,CallSettings) + // Additional: GetShelfAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf2() + { + // Snippet: GetShelf(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) @@ -4994,7 +5021,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf2() + public void GetShelf3() { // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) // Create client @@ -5008,7 +5035,36 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() + public async Task GetShelfAsync4() + { + // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf4() + { + // Snippet: GetShelf(string,SomeMessage,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync5() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) @@ -5024,7 +5080,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf3() + public void GetShelf5() { // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) // Create client @@ -5038,6 +5094,37 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetShelfAsync + public async Task GetShelfAsync6() + { + // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf6() + { + // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); + // End snippet + } + /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5246,7 +5333,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync() + public async Task DeleteShelfAsync1() { // Snippet: DeleteShelfAsync(ShelfName,CallSettings) // Additional: DeleteShelfAsync(ShelfName,CancellationToken) @@ -5260,7 +5347,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelf - public void DeleteShelf() + public void DeleteShelf1() { // Snippet: DeleteShelf(ShelfName,CallSettings) // Create client @@ -5272,6 +5359,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteShelfAsync + public async Task DeleteShelfAsync2() + { + // Snippet: DeleteShelfAsync(string,CallSettings) + // Additional: DeleteShelfAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + await libraryServiceClient.DeleteShelfAsync(name); + // End snippet + } + + /// Snippet for DeleteShelf + public void DeleteShelf2() + { + // Snippet: DeleteShelf(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + libraryServiceClient.DeleteShelf(name); + // End snippet + } + /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -5306,7 +5420,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync() + public async Task MergeShelvesAsync1() { // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) @@ -5321,7 +5435,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelves - public void MergeShelves() + public void MergeShelves1() { // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) // Create client @@ -5334,6 +5448,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MergeShelvesAsync + public async Task MergeShelvesAsync2() + { + // Snippet: MergeShelvesAsync(string,string,CallSettings) + // Additional: MergeShelvesAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MergeShelves + public void MergeShelves2() + { + // Snippet: MergeShelves(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); + // End snippet + } + /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5370,7 +5513,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBookAsync - public async Task CreateBookAsync() + public async Task CreateBookAsync1() { // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) @@ -5385,7 +5528,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBook - public void CreateBook() + public void CreateBook1() { // Snippet: CreateBook(ShelfName,Book,CallSettings) // Create client @@ -5398,6 +5541,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for CreateBookAsync + public async Task CreateBookAsync2() + { + // Snippet: CreateBookAsync(string,Book,CallSettings) + // Additional: CreateBookAsync(string,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.CreateBookAsync(name, book); + // End snippet + } + + /// Snippet for CreateBook + public void CreateBook2() + { + // Snippet: CreateBook(string,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.CreateBook(name, book); + // End snippet + } + /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5434,7 +5606,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for PublishSeriesAsync - public async Task PublishSeriesAsync() + public async Task PublishSeriesAsync1() { // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CancellationToken) @@ -5455,7 +5627,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for PublishSeries - public void PublishSeries() + public void PublishSeries1() { // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) // Create client @@ -5474,6 +5646,47 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for PublishSeriesAsync + public async Task PublishSeriesAsync2() + { + // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) + // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + // Make the request + PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); + // End snippet + } + + /// Snippet for PublishSeries + public void PublishSeries2() + { + // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + // Make the request + PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid, publisher); + // End snippet + } + /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -5518,7 +5731,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookAsync - public async Task GetBookAsync() + public async Task GetBookAsync1() { // Snippet: GetBookAsync(BookNameOneof,CallSettings) // Additional: GetBookAsync(BookNameOneof,CancellationToken) @@ -5532,7 +5745,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBook - public void GetBook() + public void GetBook1() { // Snippet: GetBook(BookNameOneof,CallSettings) // Create client @@ -5544,6 +5757,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookAsync + public async Task GetBookAsync2() + { + // Snippet: GetBookAsync(string,CallSettings) + // Additional: GetBookAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Book response = await libraryServiceClient.GetBookAsync(name); + // End snippet + } + + /// Snippet for GetBook + public void GetBook2() + { + // Snippet: GetBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Book response = libraryServiceClient.GetBook(name); + // End snippet + } + /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5578,7 +5818,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync() + public async Task ListBooksAsync1() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -5623,7 +5863,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks() + public void ListBooks1() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -5668,20 +5908,17 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync_RequestObject() + public async Task ListBooksAsync2() { - // Snippet: ListBooksAsync(ListBooksRequest,CallSettings) + // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListBooksRequest request = new ListBooksRequest - { - ShelfName = new ShelfName("[SHELF]"), - Filter = "book-filter-string", - }; + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(request); + libraryServiceClient.ListBooksAsync(name, filter); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Book item) => @@ -5716,20 +5953,17 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks_RequestObject() + public void ListBooks2() { - // Snippet: ListBooks(ListBooksRequest,CallSettings) + // Snippet: ListBooks(string,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListBooksRequest request = new ListBooksRequest - { - ShelfName = new ShelfName("[SHELF]"), - Filter = "book-filter-string", - }; + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; // Make the request PagedEnumerable response = - libraryServiceClient.ListBooks(request); + libraryServiceClient.ListBooks(name, filter); // Iterate over all response items, lazily performing RPCs as required foreach (Book item in response) @@ -5763,11 +5997,107 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync() + /// Snippet for ListBooksAsync + public async Task ListBooksAsync_RequestObject() { - // Snippet: DeleteBookAsync(BookNameOneof,CallSettings) - // Additional: DeleteBookAsync(BookNameOneof,CancellationToken) + // Snippet: ListBooksAsync(ListBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ListBooksRequest request = new ListBooksRequest + { + ShelfName = new ShelfName("[SHELF]"), + Filter = "book-filter-string", + }; + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListBooksAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Book item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListBooks + public void ListBooks_RequestObject() + { + // Snippet: ListBooks(ListBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ListBooksRequest request = new ListBooksRequest + { + ShelfName = new ShelfName("[SHELF]"), + Filter = "book-filter-string", + }; + // Make the request + PagedEnumerable response = + libraryServiceClient.ListBooks(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Book item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync1() + { + // Snippet: DeleteBookAsync(BookNameOneof,CallSettings) + // Additional: DeleteBookAsync(BookNameOneof,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5778,7 +6108,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteBook - public void DeleteBook() + public void DeleteBook1() { // Snippet: DeleteBook(BookNameOneof,CallSettings) // Create client @@ -5790,6 +6120,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync2() + { + // Snippet: DeleteBookAsync(string,CallSettings) + // Additional: DeleteBookAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook2() + { + // Snippet: DeleteBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -5854,6 +6211,35 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() + { + // Snippet: UpdateBookAsync(string,Book,CallSettings) + // Additional: UpdateBookAsync(string,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, book); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook2() + { + // Snippet: UpdateBook(string,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, book); + // End snippet + } + + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync3() { // Snippet: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) // Additional: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CancellationToken) @@ -5871,7 +6257,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBook - public void UpdateBook2() + public void UpdateBook3() { // Snippet: UpdateBook(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client @@ -5887,6 +6273,41 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync4() + { + // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook4() + { + // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -5923,7 +6344,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync() + public async Task MoveBookAsync1() { // Snippet: MoveBookAsync(BookNameOneof,ShelfName,CallSettings) // Additional: MoveBookAsync(BookNameOneof,ShelfName,CancellationToken) @@ -5938,7 +6359,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBook - public void MoveBook() + public void MoveBook1() { // Snippet: MoveBook(BookNameOneof,ShelfName,CallSettings) // Create client @@ -5951,6 +6372,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MoveBookAsync + public async Task MoveBookAsync2() + { + // Snippet: MoveBookAsync(string,string,CallSettings) + // Additional: MoveBookAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MoveBook + public void MoveBook2() + { + // Snippet: MoveBook(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = libraryServiceClient.MoveBook(name, otherShelfName); + // End snippet + } + /// Snippet for MoveBookAsync public async Task MoveBookAsync_RequestObject() { @@ -5997,7 +6447,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6008,7 +6458,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6016,10 +6466,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6039,7 +6489,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6050,7 +6500,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6058,10 +6508,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6077,13 +6527,13 @@ namespace Google.Example.Library.V1.Snippets // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + IResourceName name = new ArchiveName("[ARCHIVE]"); // Make the request PagedAsyncEnumerable response = libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6094,7 +6544,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6102,10 +6552,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6121,13 +6571,13 @@ namespace Google.Example.Library.V1.Snippets // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + IResourceName name = new ArchiveName("[ARCHIVE]"); // Make the request PagedEnumerable response = libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6138,7 +6588,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6146,10 +6596,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6159,19 +6609,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync_RequestObject() + public async Task ListStringsAsync3() { - // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) + // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchiveName("[ARCHIVE]"); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(request); + libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6182,7 +6632,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6190,10 +6640,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6203,19 +6653,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings_RequestObject() + public void ListStrings3() { - // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Snippet: ListStrings(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchiveName("[ARCHIVE]"); // Make the request PagedEnumerable response = - libraryServiceClient.ListStrings(request); + libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6226,7 +6676,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6234,10 +6684,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6246,44 +6696,177 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync_RequestObject() { - // Snippet: AddCommentsAsync(BookNameOneof,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookNameOneof,IEnumerable,CancellationToken) + // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; + ListStringsRequest request = new ListStringsRequest(); // Make the request - await libraryServiceClient.AddCommentsAsync(name, comments); - // End snippet - } + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(request); - /// Snippet for AddComments - public void AddComments() - { - // Snippet: AddComments(BookNameOneof,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((string item) => { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (string item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (string item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListStrings + public void ListStrings_RequestObject() + { + // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedEnumerable response = + libraryServiceClient.ListStrings(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (string item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (string item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (string item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync1() + { + // Snippet: AddCommentsAsync(BookNameOneof,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookNameOneof,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + await libraryServiceClient.AddCommentsAsync(name, comments); + // End snippet + } + + /// Snippet for AddComments + public void AddComments1() + { + // Snippet: AddComments(BookNameOneof,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + libraryServiceClient.AddComments(name, comments); + // End snippet + } + + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync2() + { + // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + await libraryServiceClient.AddCommentsAsync(name, comments); + // End snippet + } + + /// Snippet for AddComments + public void AddComments2() + { + // Snippet: AddComments(string,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, }, }; // Make the request @@ -6343,7 +6926,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync() + public async Task GetBookFromArchiveAsync1() { // Snippet: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CallSettings) // Additional: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CancellationToken) @@ -6358,7 +6941,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchive - public void GetBookFromArchive() + public void GetBookFromArchive1() { // Snippet: GetBookFromArchive(ArchivedBookName,ProjectName,CallSettings) // Create client @@ -6371,6 +6954,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromArchiveAsync + public async Task GetBookFromArchiveAsync2() + { + // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) + // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + // Make the request + BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); + // End snippet + } + + /// Snippet for GetBookFromArchive + public void GetBookFromArchive2() + { + // Snippet: GetBookFromArchive(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + // Make the request + BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); + // End snippet + } + /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -6407,7 +7019,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync() + public async Task GetBookFromAnywhereAsync1() { // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CancellationToken) @@ -6424,7 +7036,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere() + public void GetBookFromAnywhere1() { // Snippet: GetBookFromAnywhere(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) // Create client @@ -6439,6 +7051,39 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAnywhereAsync + public async Task GetBookFromAnywhereAsync2() + { + // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) + // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); + // End snippet + } + + /// Snippet for GetBookFromAnywhere + public void GetBookFromAnywhere2() + { + // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); + // End snippet + } + /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -6479,7 +7124,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync() + public async Task GetBookFromAbsolutelyAnywhereAsync1() { // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) @@ -6493,7 +7138,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere() + public void GetBookFromAbsolutelyAnywhere1() { // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) // Create client @@ -6505,6 +7150,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync + public async Task GetBookFromAbsolutelyAnywhereAsync2() + { + // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhere + public void GetBookFromAbsolutelyAnywhere2() + { + // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); + // End snippet + } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -6539,7 +7211,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync() + public async Task UpdateBookIndexAsync1() { // Snippet: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CallSettings) // Additional: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CancellationToken) @@ -6558,7 +7230,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndex - public void UpdateBookIndex() + public void UpdateBookIndex1() { // Snippet: UpdateBookIndex(BookNameOneof,string,IDictionary,CallSettings) // Create client @@ -6576,35 +7248,72 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync_RequestObject() + public async Task UpdateBookIndexAsync2() { - // Snippet: UpdateBookIndexAsync(UpdateBookIndexRequest,CallSettings) - // Additional: UpdateBookIndexAsync(UpdateBookIndexRequest,CancellationToken) + // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - UpdateBookIndexRequest request = new UpdateBookIndexRequest + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - IndexName = "default index", - IndexMap = - { - { "default_key", "" }, - }, + { "default_key", "" }, }; // Make the request - await libraryServiceClient.UpdateBookIndexAsync(request); + await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); // End snippet } /// Snippet for UpdateBookIndex - public void UpdateBookIndex_RequestObject() + public void UpdateBookIndex2() { - // Snippet: UpdateBookIndex(UpdateBookIndexRequest,CallSettings) + // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - UpdateBookIndexRequest request = new UpdateBookIndexRequest + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); + // End snippet + } + + /// Snippet for UpdateBookIndexAsync + public async Task UpdateBookIndexAsync_RequestObject() + { + // Snippet: UpdateBookIndexAsync(UpdateBookIndexRequest,CallSettings) + // Additional: UpdateBookIndexAsync(UpdateBookIndexRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + UpdateBookIndexRequest request = new UpdateBookIndexRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + IndexName = "default index", + IndexMap = + { + { "default_key", "" }, + }, + }; + // Make the request + await libraryServiceClient.UpdateBookIndexAsync(request); + // End snippet + } + + /// Snippet for UpdateBookIndex + public void UpdateBookIndex_RequestObject() + { + // Snippet: UpdateBookIndex(UpdateBookIndexRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + UpdateBookIndexRequest request = new UpdateBookIndexRequest { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), IndexName = "default index", @@ -6717,7 +7426,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync() { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6731,7 +7440,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookNameOneof item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6742,7 +7451,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookNameOneof item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6750,10 +7459,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookNameOneof item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6765,7 +7474,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooks public void FindRelatedBooks() { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6779,7 +7488,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over all response items, lazily performing RPCs as required - foreach (BookNameOneof item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6790,7 +7499,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookNameOneof item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6798,10 +7507,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookNameOneof item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6819,18 +7528,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = { }, + Shelves = { }, }; // Make the request PagedAsyncEnumerable response = libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookNameOneof item) => + await response.ForEachAsync((string item) => { // Do something with each item Console.WriteLine(item); @@ -6841,7 +7550,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookNameOneof item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6849,10 +7558,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookNameOneof item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6870,18 +7579,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - BookNameOneofs = + Names = { BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }, - ShelvesAsShelfNames = { }, + Shelves = { }, }; // Make the request PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over all response items, lazily performing RPCs as required - foreach (BookNameOneof item in response) + foreach (string item in response) { // Do something with each item Console.WriteLine(item); @@ -6892,7 +7601,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (BookNameOneof item in page) + foreach (string item in page) { Console.WriteLine(item); } @@ -6900,10 +7609,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookNameOneof item in singlePage) + foreach (string item in singlePage) { Console.WriteLine(item); } @@ -6948,7 +7657,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync() + public async Task GetBigBookAsync1() { // Snippet: GetBigBookAsync(BookNameOneof,CallSettings) // Additional: GetBigBookAsync(BookNameOneof,CancellationToken) @@ -6981,7 +7690,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook() + public void GetBigBook1() { // Snippet: GetBigBook(BookNameOneof,CallSettings) // Create client @@ -7012,6 +7721,71 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBigBookAsync + public async Task GetBigBookAsync2() + { + // Snippet: GetBigBookAsync(string,CallSettings) + // Additional: GetBigBookAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + await libraryServiceClient.GetBigBookAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigBookAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBook + public void GetBigBook2() + { + // Snippet: GetBigBook(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + libraryServiceClient.GetBigBook(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigBook(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + /// Snippet for GetBigBookAsync public async Task GetBigBookAsync_RequestObject() { @@ -7083,7 +7857,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync() + public async Task GetBigNothingAsync1() { // Snippet: GetBigNothingAsync(BookNameOneof,CallSettings) // Additional: GetBigNothingAsync(BookNameOneof,CancellationToken) @@ -7114,7 +7888,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing() + public void GetBigNothing1() { // Snippet: GetBigNothing(BookNameOneof,CallSettings) // Create client @@ -7143,6 +7917,67 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBigNothingAsync + public async Task GetBigNothingAsync2() + { + // Snippet: GetBigNothingAsync(string,CallSettings) + // Additional: GetBigNothingAsync(string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + await libraryServiceClient.GetBigNothingAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothing + public void GetBigNothing2() + { + // Snippet: GetBigNothing(string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + libraryServiceClient.GetBigNothing(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigNothing(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + /// Snippet for GetBigNothingAsync public async Task GetBigNothingAsync_RequestObject() { @@ -7235,8 +8070,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync2() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -7370,7 +8205,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParams public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -7502,3454 +8337,2994 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() + public async Task TestOptionalRequiredFlatteningParamsAsync3() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 0, - RequiredSingularInt64 = 0L, - RequiredSingularFloat = 0.0f, - RequiredSingularDouble = 0.0, - RequiredSingularBool = false, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "", - RequiredSingularBytes = ByteString.Empty, - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "", - RequiredSingularFixed32 = 0, - RequiredSingularFixed64 = 0L, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - }; - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(request); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams_RequestObject() - { - // Snippet: TestOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 0, - RequiredSingularInt64 = 0L, - RequiredSingularFloat = 0.0f, - RequiredSingularDouble = 0.0, - RequiredSingularBool = false, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "", - RequiredSingularBytes = ByteString.Empty, - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "", - RequiredSingularFixed32 = 0, - RequiredSingularFixed64 = 0L, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - }; - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(request); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync() - { - // Snippet: MoveBooksAsync(string,string,IEnumerable,string,CallSettings) - // Additional: MoveBooksAsync(string,string,IEnumerable,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - string source = ""; - string destination = ""; - IEnumerable publishers = new List(); - string project = ""; - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks() - { - // Snippet: MoveBooks(string,string,IEnumerable,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - string source = ""; - string destination = ""; - IEnumerable publishers = new List(); - string project = ""; - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync_RequestObject() - { - // Snippet: MoveBooksAsync(MoveBooksRequest,CallSettings) - // Additional: MoveBooksAsync(MoveBooksRequest,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - MoveBooksRequest request = new MoveBooksRequest(); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(request); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks_RequestObject() - { - // Snippet: MoveBooks(MoveBooksRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - MoveBooksRequest request = new MoveBooksRequest(); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(request); - // End snippet - } - - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync() - { - // Snippet: ArchiveBooksAsync(string,string,CallSettings) - // Additional: ArchiveBooksAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - string source = ""; - string archive = ""; - // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooks - public void ArchiveBooks() - { - // Snippet: ArchiveBooks(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - string source = ""; - string archive = ""; - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync_RequestObject() - { - // Snippet: ArchiveBooksAsync(ArchiveBooksRequest,CallSettings) - // Additional: ArchiveBooksAsync(ArchiveBooksRequest,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveBooksRequest request = new ArchiveBooksRequest(); + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = ""; + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = ""; + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(request); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } - /// Snippet for ArchiveBooks - public void ArchiveBooks_RequestObject() + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams3() { - // Snippet: ArchiveBooks(ArchiveBooksRequest,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ArchiveBooksRequest request = new ArchiveBooksRequest(); - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(request); + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = ""; + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = ""; + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync() + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { - // Snippet: LongRunningArchiveBooksAsync(string,string,CallSettings) - // Additional: LongRunningArchiveBooksAsync(string,string,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - string source = ""; - string archive = ""; - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } + RequiredSingularInt32 = 0, + RequiredSingularInt64 = 0L, + RequiredSingularFloat = 0.0f, + RequiredSingularDouble = 0.0, + RequiredSingularBool = false, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "", + RequiredSingularBytes = ByteString.Empty, + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "", + RequiredSingularFixed32 = 0, + RequiredSingularFixed64 = 0L, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + }; + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(request); // End snippet } - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks() + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams_RequestObject() { - // Snippet: LongRunningArchiveBooks(string,string,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(TestOptionalRequiredFlatteningParamsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - string source = ""; - string archive = ""; - // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync_RequestObject() - { - // Snippet: LongRunningArchiveBooksAsync(ArchiveBooksRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveBooksRequest request = new ArchiveBooksRequest(); - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } + RequiredSingularInt32 = 0, + RequiredSingularInt64 = 0L, + RequiredSingularFloat = 0.0f, + RequiredSingularDouble = 0.0, + RequiredSingularBool = false, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "", + RequiredSingularBytes = ByteString.Empty, + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "", + RequiredSingularFixed32 = 0, + RequiredSingularFixed64 = 0L, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + }; + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(request); // End snippet } - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks_RequestObject() + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync1() { - // Snippet: LongRunningArchiveBooks(ArchiveBooksRequest,CallSettings) + // Snippet: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CancellationToken) // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ArchiveBooksRequest request = new ArchiveBooksRequest(); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); // End snippet } - /// Snippet for StreamingArchiveBooks - public async Task StreamingArchiveBooks() + /// Snippet for MoveBooks + public void MoveBooks1() { - // Snippet: StreamingArchiveBooks(CallSettings,BidirectionalStreamingSettings) + // Snippet: MoveBooks(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize streaming call, retrieving the stream object - LibraryServiceClient.StreamingArchiveBooksStream duplexStream = libraryServiceClient.StreamingArchiveBooks(); - - // Sending requests and retrieving responses can be arbitrarily interleaved. - // Exact sequence will depend on client/server behavior. - - // Create task to do something with responses from server - Task responseHandlerTask = Task.Run(async () => - { - IAsyncEnumerator responseStream = duplexStream.ResponseStream; - while (await responseStream.MoveNext()) - { - ArchiveBooksResponse response = responseStream.Current; - // Do something with streamed response - } - // The response stream has completed - }); - - // Send requests to the server - bool done = false; - while (!done) - { - // Initialize a request - ArchiveBooksRequest request = new ArchiveBooksRequest(); - // Stream a request to the server - await duplexStream.WriteAsync(request); - - // Set "done" to true when sending requests is complete - } - // Complete writing requests to the stream - await duplexStream.WriteCompleteAsync(); - // Await the response handler. - // This will complete once all server responses have been processed. - await responseHandlerTask; + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); // End snippet } - /// Snippet for PrivateListShelvesAsync - public async Task PrivateListShelvesAsync() + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync2() { - // Snippet: PrivateListShelvesAsync(CallSettings) - // Additional: PrivateListShelvesAsync(CancellationToken) + // Snippet: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - Book response = await libraryServiceClient.PrivateListShelvesAsync(); + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); // End snippet } - /// Snippet for PrivateListShelves - public void PrivateListShelves() + /// Snippet for MoveBooks + public void MoveBooks2() { - // Snippet: PrivateListShelves(CallSettings) + // Snippet: MoveBooks(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - Book response = libraryServiceClient.PrivateListShelves(); + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); // End snippet } - /// Snippet for PrivateListShelvesAsync - public async Task PrivateListShelvesAsync_RequestObject() + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync3() { - // Snippet: PrivateListShelvesAsync(ListShelvesRequest,CallSettings) - // Additional: PrivateListShelvesAsync(ListShelvesRequest,CancellationToken) + // Snippet: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); + ProjectName source = new ProjectName("[PROJECT]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - Book response = await libraryServiceClient.PrivateListShelvesAsync(request); + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); // End snippet } - /// Snippet for PrivateListShelves - public void PrivateListShelves_RequestObject() + /// Snippet for MoveBooks + public void MoveBooks3() { - // Snippet: PrivateListShelves(ListShelvesRequest,CallSettings) + // Snippet: MoveBooks(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); + ProjectName source = new ProjectName("[PROJECT]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - Book response = libraryServiceClient.PrivateListShelves(request); + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); // End snippet } - } -} - -============== file: Google.Example.Library.V1/Google.Example.Library.V1.Snippets/MyProtoClientSnippets.g.cs ============== -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync4() + { + // Snippet: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } -// Generated code. DO NOT EDIT! + /// Snippet for MoveBooks + public void MoveBooks4() + { + // Snippet: MoveBooks(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } -namespace Google.Example.Library.V1.Snippets -{ - using Google.Api.Gax; - using Google.Api.Gax.Grpc; - using apis = Google.Example.Library.V1; - using Google.Protobuf; - using Google.Protobuf.WellKnownTypes; - using Grpc.Core; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Linq; - using System.Threading; - using System.Threading.Tasks; + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync5() + { + // Snippet: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } - /// Generated snippets - public class GeneratedMyProtoClientSnippets - { - /// Snippet for MyMethodAsync - public async Task MyMethodAsync_RequestObject() + /// Snippet for MoveBooks + public void MoveBooks5() { - // Snippet: MyMethodAsync(MethodRequest,CallSettings) - // Additional: MyMethodAsync(MethodRequest,CancellationToken) + // Snippet: MoveBooks(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) // Create client - MyProtoClient myProtoClient = await MyProtoClient.CreateAsync(); + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - MethodRequest request = new MethodRequest(); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - MethodResponse response = await myProtoClient.MyMethodAsync(request); + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); // End snippet } - /// Snippet for MyMethod - public void MyMethod_RequestObject() + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync6() { - // Snippet: MyMethod(MethodRequest,CallSettings) + // Snippet: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CancellationToken) // Create client - MyProtoClient myProtoClient = MyProtoClient.Create(); + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - MethodRequest request = new MethodRequest(); + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - MethodResponse response = myProtoClient.MyMethod(request); + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); // End snippet } - } -} - -============== file: Google.Example.Library.V1/Google.Example.Library.V1.Tests/Google.Example.Library.V1.Tests.csproj ============== - - - - - netcoreapp1.0;netcoreapp2.0;net452 - netcoreapp1.0;netcoreapp2.0 - latest - - - - - - - - - - - - + /// Snippet for MoveBooks + public void MoveBooks6() + { + // Snippet: MoveBooks(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } -============== file: Google.Example.Library.V1/Google.Example.Library.V1.Tests/LibraryServiceClientTest.g.cs ============== -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync7() + { + // Snippet: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } -// Generated code. DO NOT EDIT! + /// Snippet for MoveBooks + public void MoveBooks7() + { + // Snippet: MoveBooks(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } -namespace Google.Example.Library.V1.Tests -{ - using Google.Api.Gax; - using Google.Api.Gax.Grpc; - using Google.Cloud.Tagger.V1; - using apis = Google.Example.Library.V1; - using Google.LongRunning; - using Google.Protobuf; - using Google.Protobuf.WellKnownTypes; - using Grpc.Core; - using Moq; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Threading; - using System.Threading.Tasks; - using Xunit; + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync8() + { + // Snippet: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } - /// Generated unit tests - public class GeneratedLibraryServiceClientTest - { - [Fact] - public void CreateShelf() + /// Snippet for MoveBooks + public void MoveBooks8() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateShelfRequest expectedRequest = new CreateShelfRequest - { - Shelf = new Shelf(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.CreateShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf shelf = new Shelf(); - Shelf response = client.CreateShelf(shelf); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: MoveBooks(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet } - [Fact] - public async Task CreateShelfAsync() + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync9() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateShelfRequest expectedRequest = new CreateShelfRequest - { - Shelf = new Shelf(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.CreateShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf shelf = new Shelf(); - Shelf response = await client.CreateShelfAsync(shelf); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet } - [Fact] - public void CreateShelf2() + /// Snippet for MoveBooks + public void MoveBooks9() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateShelfRequest request = new CreateShelfRequest - { - Shelf = new Shelf(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.CreateShelf(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.CreateShelf(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: MoveBooks(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet } - [Fact] - public async Task CreateShelfAsync2() + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync10() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateShelfRequest request = new CreateShelfRequest - { - Shelf = new Shelf(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.CreateShelfAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = await client.CreateShelfAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: MoveBooksAsync(string,string,IEnumerable,string,CallSettings) + // Additional: MoveBooksAsync(string,string,IEnumerable,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable formattedPublishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, formattedPublishers, project); + // End snippet } - [Fact] - public void GetShelf() + /// Snippet for MoveBooks + public void MoveBooks10() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = client.GetShelf(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: MoveBooks(string,string,IEnumerable,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable formattedPublishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, formattedPublishers, project); + // End snippet } - [Fact] - public async Task GetShelfAsync() + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync_RequestObject() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = await client.GetShelfAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: MoveBooksAsync(MoveBooksRequest,CallSettings) + // Additional: MoveBooksAsync(MoveBooksRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + MoveBooksRequest request = new MoveBooksRequest(); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(request); + // End snippet } - [Fact] - public void GetShelf2() + /// Snippet for MoveBooks + public void MoveBooks_RequestObject() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = client.GetShelf(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: MoveBooks(MoveBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + MoveBooksRequest request = new MoveBooksRequest(); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(request); + // End snippet } - [Fact] - public async Task GetShelfAsync2() + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync1() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = await client.GetShelfAsync(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) + // Additional: ArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); + // End snippet } - [Fact] - public void GetShelf3() + /// Snippet for ArchiveBooks + public void ArchiveBooks1() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = client.GetShelf(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooks(ArchiveName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); + // End snippet } - [Fact] - public async Task GetShelfAsync3() + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync2() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = await client.GetShelfAsync(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) + // Additional: ArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); + // End snippet } - [Fact] - public void GetShelf4() + /// Snippet for ArchiveBooks + public void ArchiveBooks2() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest request = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Options = "options-1249474914", - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.GetShelf(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooks(ShelfName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); + // End snippet } - [Fact] - public async Task GetShelfAsync4() + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync3() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest request = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Options = "options-1249474914", - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = await client.GetShelfAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) + // Additional: ArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); + // End snippet } - [Fact] - public void DeleteShelf() + /// Snippet for ArchiveBooks + public void ArchiveBooks3() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - client.DeleteShelf(name); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooks(ProjectName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); + // End snippet } - [Fact] - public async Task DeleteShelfAsync() + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync4() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - await client.DeleteShelfAsync(name); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooksAsync(string,string,CallSettings) + // Additional: ArchiveBooksAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); + // End snippet } - [Fact] - public void DeleteShelf2() + /// Snippet for ArchiveBooks + public void ArchiveBooks4() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest request = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.DeleteShelf(request); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooks(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); + // End snippet } - [Fact] - public async Task DeleteShelfAsync2() + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync_RequestObject() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest request = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - await client.DeleteShelfAsync(request); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooksAsync(ArchiveBooksRequest,CallSettings) + // Additional: ArchiveBooksAsync(ArchiveBooksRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveBooksRequest request = new ArchiveBooksRequest(); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(request); + // End snippet } - [Fact] - public void MergeShelves() + /// Snippet for ArchiveBooks + public void ArchiveBooks_RequestObject() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest - { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = client.MergeShelves(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: ArchiveBooks(ArchiveBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveBooksRequest request = new ArchiveBooksRequest(); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(request); + // End snippet } - [Fact] - public async Task MergeShelvesAsync() + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync1() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest - { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = await client.MergeShelvesAsync(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } + // Snippet: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) + // Additional: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - [Fact] - public void MergeShelves2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest - { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.MergeShelves(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public async Task MergeShelvesAsync2() + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks1() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest - { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf + // Snippet: LongRunningArchiveBooks(ArchiveName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelvesAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = await client.MergeShelvesAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public void CreateBook() + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync2() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = client.CreateBook(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) + // Additional: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public async Task CreateBookAsync() + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks2() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book + // Snippet: LongRunningArchiveBooks(ShelfName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = await client.CreateBookAsync(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public void CreateBook2() + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync3() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest request = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book + // Snippet: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) + // Additional: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBook(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.CreateBook(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public async Task CreateBookAsync2() + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks3() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest request = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book + // Snippet: LongRunningArchiveBooks(ProjectName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBookAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.CreateBookAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public void PublishSeries() + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync4() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - PublishSeriesRequest expectedRequest = new PublishSeriesRequest - { - Shelf = new Shelf(), - Books = { }, - Edition = 1887963714, - SeriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }, - PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), - }; - PublishSeriesResponse expectedResponse = new PublishSeriesResponse - { - BookNames = - { - "bookNamesElement1491670575", - }, - }; - mockGrpcClient.Setup(x => x.PublishSeries(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 1887963714; - SeriesUuid seriesUuid = new SeriesUuid + // Snippet: LongRunningArchiveBooksAsync(string,string,CallSettings) + // Additional: LongRunningArchiveBooksAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = client.PublishSeries(shelf, books, edition, seriesUuid, publisher); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public async Task PublishSeriesAsync() + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks4() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - PublishSeriesRequest expectedRequest = new PublishSeriesRequest - { - Shelf = new Shelf(), - Books = { }, - Edition = 1887963714, - SeriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }, - PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), - }; - PublishSeriesResponse expectedResponse = new PublishSeriesResponse - { - BookNames = - { - "bookNamesElement1491670575", - }, - }; - mockGrpcClient.Setup(x => x.PublishSeriesAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 1887963714; - SeriesUuid seriesUuid = new SeriesUuid + // Snippet: LongRunningArchiveBooks(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = await client.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public void PublishSeries2() + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync_RequestObject() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - PublishSeriesRequest request = new PublishSeriesRequest + // Snippet: LongRunningArchiveBooksAsync(ArchiveBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveBooksRequest request = new ArchiveBooksRequest(); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(request); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - Shelf = new Shelf(), - Books = { }, - SeriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }, - }; - PublishSeriesResponse expectedResponse = new PublishSeriesResponse + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks_RequestObject() + { + // Snippet: LongRunningArchiveBooks(ArchiveBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveBooksRequest request = new ArchiveBooksRequest(); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(request); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) { - BookNames = - { - "bookNamesElement1491670575", - }, - }; - mockGrpcClient.Setup(x => x.PublishSeries(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - PublishSeriesResponse response = client.PublishSeries(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet } - [Fact] - public async Task PublishSeriesAsync2() + /// Snippet for StreamingArchiveBooks + public async Task StreamingArchiveBooks() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - PublishSeriesRequest request = new PublishSeriesRequest + // Snippet: StreamingArchiveBooks(CallSettings,BidirectionalStreamingSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize streaming call, retrieving the stream object + LibraryServiceClient.StreamingArchiveBooksStream duplexStream = libraryServiceClient.StreamingArchiveBooks(); + + // Sending requests and retrieving responses can be arbitrarily interleaved. + // Exact sequence will depend on client/server behavior. + + // Create task to do something with responses from server + Task responseHandlerTask = Task.Run(async () => { - Shelf = new Shelf(), - Books = { }, - SeriesUuid = new SeriesUuid + IAsyncEnumerator responseStream = duplexStream.ResponseStream; + while (await responseStream.MoveNext()) { - SeriesString = "foobar", - }, - }; - PublishSeriesResponse expectedResponse = new PublishSeriesResponse + ArchiveBooksResponse response = responseStream.Current; + // Do something with streamed response + } + // The response stream has completed + }); + + // Send requests to the server + bool done = false; + while (!done) { - BookNames = - { - "bookNamesElement1491670575", - }, - }; - mockGrpcClient.Setup(x => x.PublishSeriesAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - PublishSeriesResponse response = await client.PublishSeriesAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Initialize a request + ArchiveBooksRequest request = new ArchiveBooksRequest(); + // Stream a request to the server + await duplexStream.WriteAsync(request); + + // Set "done" to true when sending requests is complete + } + // Complete writing requests to the stream + await duplexStream.WriteCompleteAsync(); + // Await the response handler. + // This will complete once all server responses have been processed. + await responseHandlerTask; + // End snippet } - [Fact] - public void GetBook() + /// Snippet for PrivateListShelvesAsync + public async Task PrivateListShelvesAsync() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book response = client.GetBook(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: PrivateListShelvesAsync(CallSettings) + // Additional: PrivateListShelvesAsync(CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Make the request + Book response = await libraryServiceClient.PrivateListShelvesAsync(); + // End snippet } - [Fact] - public async Task GetBookAsync() + /// Snippet for PrivateListShelves + public void PrivateListShelves() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book response = await client.GetBookAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); + // Snippet: PrivateListShelves(CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Make the request + Book response = libraryServiceClient.PrivateListShelves(); + // End snippet + } + + /// Snippet for PrivateListShelvesAsync + public async Task PrivateListShelvesAsync_RequestObject() + { + // Snippet: PrivateListShelvesAsync(ListShelvesRequest,CallSettings) + // Additional: PrivateListShelvesAsync(ListShelvesRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ListShelvesRequest request = new ListShelvesRequest(); + // Make the request + Book response = await libraryServiceClient.PrivateListShelvesAsync(request); + // End snippet + } + + /// Snippet for PrivateListShelves + public void PrivateListShelves_RequestObject() + { + // Snippet: PrivateListShelves(ListShelvesRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ListShelvesRequest request = new ListShelvesRequest(); + // Make the request + Book response = libraryServiceClient.PrivateListShelves(request); + // End snippet + } + + } +} + +============== file: Google.Example.Library.V1/Google.Example.Library.V1.Snippets/MyProtoClientSnippets.g.cs ============== +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated code. DO NOT EDIT! + +namespace Google.Example.Library.V1.Snippets +{ + using Google.Api.Gax; + using Google.Api.Gax.Grpc; + using apis = Google.Example.Library.V1; + using Google.Protobuf; + using Google.Protobuf.WellKnownTypes; + using Grpc.Core; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Linq; + using System.Threading; + using System.Threading.Tasks; + + /// Generated snippets + public class GeneratedMyProtoClientSnippets + { + /// Snippet for MyMethodAsync + public async Task MyMethodAsync_RequestObject() + { + // Snippet: MyMethodAsync(MethodRequest,CallSettings) + // Additional: MyMethodAsync(MethodRequest,CancellationToken) + // Create client + MyProtoClient myProtoClient = await MyProtoClient.CreateAsync(); + // Initialize request argument(s) + MethodRequest request = new MethodRequest(); + // Make the request + MethodResponse response = await myProtoClient.MyMethodAsync(request); + // End snippet + } + + /// Snippet for MyMethod + public void MyMethod_RequestObject() + { + // Snippet: MyMethod(MethodRequest,CallSettings) + // Create client + MyProtoClient myProtoClient = MyProtoClient.Create(); + // Initialize request argument(s) + MethodRequest request = new MethodRequest(); + // Make the request + MethodResponse response = myProtoClient.MyMethod(request); + // End snippet } + } +} + +============== file: Google.Example.Library.V1/Google.Example.Library.V1.Tests/Google.Example.Library.V1.Tests.csproj ============== + + + + + netcoreapp1.0;netcoreapp2.0;net452 + netcoreapp1.0;netcoreapp2.0 + latest + + + + + + + + + + + + + +============== file: Google.Example.Library.V1/Google.Example.Library.V1.Tests/LibraryServiceClientTest.g.cs ============== +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated code. DO NOT EDIT! + +namespace Google.Example.Library.V1.Tests +{ + using Google.Api.Gax; + using Google.Api.Gax.Grpc; + using Google.Cloud.Tagger.V1; + using apis = Google.Example.Library.V1; + using Google.LongRunning; + using Google.Protobuf; + using Google.Protobuf.WellKnownTypes; + using Grpc.Core; + using Moq; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Threading; + using System.Threading.Tasks; + using Xunit; + + /// Generated unit tests + public class GeneratedLibraryServiceClientTest + { [Fact] - public void GetBook2() + public void CreateShelf() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookRequest request = new GetBookRequest + CreateShelfRequest expectedRequest = new CreateShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Shelf = new Shelf(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.GetBook(request); + Shelf shelf = new Shelf(); + Shelf response = client.CreateShelf(shelf); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookAsync2() + public async Task CreateShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookRequest request = new GetBookRequest + CreateShelfRequest expectedRequest = new CreateShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Shelf = new Shelf(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBookAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.CreateShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.GetBookAsync(request); + Shelf shelf = new Shelf(); + Shelf response = await client.CreateShelfAsync(shelf); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void DeleteBook() + public void CreateShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest + CreateShelfRequest request = new CreateShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Shelf = new Shelf(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.CreateShelf(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - client.DeleteBook(name); + Shelf response = client.CreateShelf(request); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task DeleteBookAsync() + public async Task CreateShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest + CreateShelfRequest request = new CreateShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Shelf = new Shelf(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.CreateShelfAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - await client.DeleteBookAsync(name); + Shelf response = await client.CreateShelfAsync(request); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void DeleteBook2() + public void GetShelf() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteBookRequest request = new DeleteBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + ShelfName = new ShelfName("[SHELF]"), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBook(request, It.IsAny())) + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.DeleteBook(request); + ShelfName name = new ShelfName("[SHELF]"); + Shelf response = client.GetShelf(name); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task DeleteBookAsync2() + public async Task GetShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - DeleteBookRequest request = new DeleteBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + ShelfName = new ShelfName("[SHELF]"), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBookAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Shelf expectedResponse = new Shelf + { + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", + }; + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - await client.DeleteBookAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + Shelf response = await client.GetShelfAsync(name); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void UpdateBook() + public void GetShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), + Name = new ShelfName("[SHELF]"), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); - Book response = client.UpdateBook(name, book); + ShelfName name = new ShelfName("[SHELF]"); + Shelf response = client.GetShelf(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task UpdateBookAsync() + public async Task GetShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), + Name = new ShelfName("[SHELF]"), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); - Book response = await client.UpdateBookAsync(name, book); + ShelfName name = new ShelfName("[SHELF]"); + Shelf response = await client.GetShelfAsync(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void UpdateBook2() + public void GetShelf3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), + ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = client.GetShelf(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task UpdateBookAsync2() + public async Task GetShelfAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), + ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = await client.GetShelfAsync(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void UpdateBook3() + public void GetShelf4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.UpdateBook(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = client.GetShelf(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task UpdateBookAsync3() + public async Task GetShelfAsync4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.UpdateBookAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + Shelf response = await client.GetShelfAsync(name, message); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBook() + public void GetShelf5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = client.MoveBook(name, otherShelfName); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = client.GetShelf(name, message, stringBuilder); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBookAsync() + public async Task GetShelfAsync5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = await client.MoveBookAsync(name, otherShelfName); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = await client.GetShelfAsync(name, message, stringBuilder); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBook2() + public void GetShelf6() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Book expectedResponse = new Book + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), + }; + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) + mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.MoveBook(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = client.GetShelf(name, message, stringBuilder); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBookAsync2() + public async Task GetShelfAsync6() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest + GetShelfRequest expectedRequest = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + Message = new SomeMessage(), + StringBuilder = new StringBuilder(), }; - Book expectedResponse = new Book + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.MoveBookAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + Shelf response = await client.GetShelfAsync(name, message, stringBuilder); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void AddComments() + public void GetShelf7() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + GetShelfRequest request = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, + ShelfName = new ShelfName("[SHELF]"), + Options = "options-1249474914", }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] + Shelf expectedResponse = new Shelf { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - client.AddComments(name, comments); + mockGrpcClient.Setup(x => x.GetShelf(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf response = client.GetShelf(request); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task AddCommentsAsync() + public async Task GetShelfAsync7() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + GetShelfRequest request = new GetShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, + ShelfName = new ShelfName("[SHELF]"), + Options = "options-1249474914", }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] + Shelf expectedResponse = new Shelf { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - await client.AddCommentsAsync(name, comments); + mockGrpcClient.Setup(x => x.GetShelfAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf response = await client.GetShelfAsync(request); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void AddComments2() + public void DeleteShelf() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest request = new AddCommentsRequest + DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddComments(request, It.IsAny())) + mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.AddComments(request); + ShelfName name = new ShelfName("[SHELF]"); + client.DeleteShelf(name); mockGrpcClient.VerifyAll(); } [Fact] - public async Task AddCommentsAsync2() + public async Task DeleteShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest request = new AddCommentsRequest + DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddCommentsAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - await client.AddCommentsAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + await client.DeleteShelfAsync(name); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBookFromArchive() + public void DeleteShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - ParentAsProjectName = new ProjectName("[PROJECT]"), - }; - BookFromArchive expectedResponse = new BookFromArchive + DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + Name = new ShelfName("[SHELF]"), }; - mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - BookFromArchive response = client.GetBookFromArchive(name, parent); - Assert.Same(expectedResponse, response); + ShelfName name = new ShelfName("[SHELF]"); + client.DeleteShelf(name); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookFromArchiveAsync() + public async Task DeleteShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - ParentAsProjectName = new ProjectName("[PROJECT]"), - }; - BookFromArchive expectedResponse = new BookFromArchive + DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + Name = new ShelfName("[SHELF]"), }; - mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - BookFromArchive response = await client.GetBookFromArchiveAsync(name, parent); - Assert.Same(expectedResponse, response); + ShelfName name = new ShelfName("[SHELF]"); + await client.DeleteShelfAsync(name); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBookFromArchive2() + public void DeleteShelf3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromArchiveRequest request = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - ParentAsProjectName = new ProjectName("[PROJECT]"), - }; - BookFromArchive expectedResponse = new BookFromArchive + DeleteShelfRequest request = new DeleteShelfRequest { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), }; - mockGrpcClient.Setup(x => x.GetBookFromArchive(request, It.IsAny())) + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelf(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromArchive response = client.GetBookFromArchive(request); - Assert.Same(expectedResponse, response); + client.DeleteShelf(request); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookFromArchiveAsync2() + public async Task DeleteShelfAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromArchiveRequest request = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - ParentAsProjectName = new ProjectName("[PROJECT]"), - }; - BookFromArchive expectedResponse = new BookFromArchive + DeleteShelfRequest request = new DeleteShelfRequest { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), }; - mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteShelfAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromArchive response = await client.GetBookFromArchiveAsync(request); - Assert.Same(expectedResponse, response); + await client.DeleteShelfAsync(request); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBookFromAnywhere() + public void MergeShelves() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName, place, folder); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = client.MergeShelves(name, otherShelfName); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookFromAnywhereAsync() + public async Task MergeShelvesAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName, place, folder); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = await client.MergeShelvesAsync(name, otherShelfName); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBookFromAnywhere2() + public void MergeShelves2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest + MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhere(request, It.IsAny())) + mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromAnywhere response = client.GetBookFromAnywhere(request); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = client.MergeShelves(name, otherShelfName); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookFromAnywhereAsync2() + public async Task MergeShelvesAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest + MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromAnywhere response = await client.GetBookFromAnywhereAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Shelf response = await client.MergeShelvesAsync(name, otherShelfName); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBookFromAbsolutelyAnywhere() + public void MergeShelves3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + MergeShelvesRequest request = new MergeShelvesRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); + Shelf response = client.MergeShelves(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync() + public async Task MergeShelvesAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + MergeShelvesRequest request = new MergeShelvesRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Shelf expectedResponse = new Shelf { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + ShelfName = new ShelfName("[SHELF]"), + Theme = "theme110327241", + InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.MergeShelvesAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); + Shelf response = await client.MergeShelvesAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBookFromAbsolutelyAnywhere2() + public void CreateBook() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + CreateBookRequest expectedRequest = new CreateBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), Author = "author-1406328437", Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(request, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(request); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = client.CreateBook(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync2() + public async Task CreateBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + CreateBookRequest expectedRequest = new CreateBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), }; - BookFromAnywhere expectedResponse = new BookFromAnywhere + Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), Author = "author-1406328437", Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(request); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = await client.CreateBookAsync(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void UpdateBookIndex() + public void CreateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + CreateBookRequest expectedRequest = new CreateBookRequest + { + Name = new ShelfName("[SHELF]"), + Book = new Book(), + }; + Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, + Author = "author-1406328437", + Title = "title110371416", + Read = true, }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "indexMapItem1918721251" }, - }; - client.UpdateBookIndex(name, indexName, indexMap); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = client.CreateBook(name, book); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task UpdateBookIndexAsync() + public async Task CreateBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + CreateBookRequest expectedRequest = new CreateBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, + Name = new ShelfName("[SHELF]"), + Book = new Book(), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary + Book expectedResponse = new Book { - { "default_key", "indexMapItem1918721251" }, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, }; - await client.UpdateBookIndexAsync(name, indexName, indexMap); + mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + Book response = await client.CreateBookAsync(name, book); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void UpdateBookIndex2() + public void CreateBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookIndexRequest request = new UpdateBookIndexRequest + CreateBookRequest request = new CreateBookRequest + { + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), + }; + Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, + Author = "author-1406328437", + Title = "title110371416", + Read = true, }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndex(request, It.IsAny())) + mockGrpcClient.Setup(x => x.CreateBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.UpdateBookIndex(request); + Book response = client.CreateBook(request); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task UpdateBookIndexAsync2() + public async Task CreateBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookIndexRequest request = new UpdateBookIndexRequest + CreateBookRequest request = new CreateBookRequest + { + ShelfName = new ShelfName("[SHELF]"), + Book = new Book(), + }; + Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - IndexName = "default index", - IndexMap = + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.CreateBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.CreateBookAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void PublishSeries() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + PublishSeriesRequest expectedRequest = new PublishSeriesRequest + { + Shelf = new Shelf(), + Books = { }, + Edition = 1887963714, + SeriesUuid = new SeriesUuid { - { "default_key", "indexMapItem1918721251" }, + SeriesString = "foobar", }, + PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + PublishSeriesResponse expectedResponse = new PublishSeriesResponse + { + BookNames = + { + "bookNamesElement1491670575", + }, + }; + mockGrpcClient.Setup(x => x.PublishSeries(expectedRequest, It.IsAny())) + .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - await client.UpdateBookIndexAsync(request); + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 1887963714; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + PublishSeriesResponse response = client.PublishSeries(shelf, books, edition, seriesUuid, publisher); + Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void TestOptionalRequiredFlatteningParams() + public async Task PublishSeriesAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + PublishSeriesRequest expectedRequest = new PublishSeriesRequest + { + Shelf = new Shelf(), + Books = { }, + Edition = 1887963714, + SeriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }, + PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), + }; + PublishSeriesResponse expectedResponse = new PublishSeriesResponse + { + BookNames = + { + "bookNamesElement1491670575", + }, + }; + mockGrpcClient.Setup(x => x.PublishSeriesAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 1887963714; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + PublishSeriesResponse response = await client.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void PublishSeries2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + PublishSeriesRequest expectedRequest = new PublishSeriesRequest + { + Shelf = new Shelf(), + Books = { }, + Edition = 1887963714, + SeriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }, + Publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), + }; + PublishSeriesResponse expectedResponse = new PublishSeriesResponse + { + BookNames = + { + "bookNamesElement1491670575", + }, + }; + mockGrpcClient.Setup(x => x.PublishSeries(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 1887963714; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + PublishSeriesResponse response = client.PublishSeries(shelf, books, edition, seriesUuid, publisher); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(); + [Fact] + public async Task PublishSeriesAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + PublishSeriesRequest expectedRequest = new PublishSeriesRequest + { + Shelf = new Shelf(), + Books = { }, + Edition = 1887963714, + SeriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }, + Publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), + }; + PublishSeriesResponse expectedResponse = new PublishSeriesResponse + { + BookNames = + { + "bookNamesElement1491670575", + }, + }; + mockGrpcClient.Setup(x => x.PublishSeriesAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 1887963714; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + PublishSeriesResponse response = await client.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync() + public void PublishSeries3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + PublishSeriesRequest request = new PublishSeriesRequest + { + Shelf = new Shelf(), + Books = { }, + SeriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }, + }; + PublishSeriesResponse expectedResponse = new PublishSeriesResponse + { + BookNames = + { + "bookNamesElement1491670575", + }, + }; + mockGrpcClient.Setup(x => x.PublishSeries(request, It.IsAny())) + .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + PublishSeriesResponse response = client.PublishSeries(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(); + [Fact] + public async Task PublishSeriesAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + PublishSeriesRequest request = new PublishSeriesRequest + { + Shelf = new Shelf(), + Books = { }, + SeriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }, + }; + PublishSeriesResponse expectedResponse = new PublishSeriesResponse + { + BookNames = + { + "bookNamesElement1491670575", + }, + }; + mockGrpcClient.Setup(x => x.PublishSeriesAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + PublishSeriesResponse response = await client.PublishSeriesAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void TestOptionalRequiredFlatteningParams2() + public void GetBook() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + GetBookRequest expectedRequest = new GetBookRequest { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceNameAsBookNameOneofs = { }, - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book response = client.GetBook(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync2() + public async Task GetBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + GetBookRequest expectedRequest = new GetBookRequest { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceNameAsBookNameOneofs = { }, - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book response = await client.GetBookAsync(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void TestOptionalRequiredFlatteningParams3() + public void GetBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + GetBookRequest expectedRequest = new GetBookRequest { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book response = client.GetBook(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync3() + public async Task GetBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + GetBookRequest expectedRequest = new GetBookRequest { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book response = await client.GetBookAsync(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBooks() + public void GetBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest + GetBookRequest request = new GetBookRequest { - Source = "source-896505829", - Destination = "destination-1429847026", - Publishers = { }, - Project = "project-309310695", + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - MoveBooksResponse expectedResponse = new MoveBooksResponse + Book expectedResponse = new Book { - Success = false, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - string source = "source-896505829"; - string destination = "destination-1429847026"; - IEnumerable publishers = new List(); - string project = "project-309310695"; - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Book response = client.GetBook(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBooksAsync() + public async Task GetBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest + GetBookRequest request = new GetBookRequest { - Source = "source-896505829", - Destination = "destination-1429847026", - Publishers = { }, - Project = "project-309310695", + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - MoveBooksResponse expectedResponse = new MoveBooksResponse + Book expectedResponse = new Book { - Success = false, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - string source = "source-896505829"; - string destination = "destination-1429847026"; - IEnumerable publishers = new List(); - string project = "project-309310695"; - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Book response = await client.GetBookAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBooks2() + public void DeleteBook() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBooksRequest request = new MoveBooksRequest(); - MoveBooksResponse expectedResponse = new MoveBooksResponse + DeleteBookRequest expectedRequest = new DeleteBookRequest { - Success = false, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - mockGrpcClient.Setup(x => x.MoveBooks(request, It.IsAny())) + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - MoveBooksResponse response = client.MoveBooks(request); - Assert.Same(expectedResponse, response); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + client.DeleteBook(name); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBooksAsync2() + public async Task DeleteBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBooksRequest request = new MoveBooksRequest(); - MoveBooksResponse expectedResponse = new MoveBooksResponse + DeleteBookRequest expectedRequest = new DeleteBookRequest { - Success = false, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - MoveBooksResponse response = await client.MoveBooksAsync(request); - Assert.Same(expectedResponse, response); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + await client.DeleteBookAsync(name); mockGrpcClient.VerifyAll(); } [Fact] - public void ArchiveBooks() + public void DeleteBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - Source = "source-896505829", - Archive = "archive-748101438", - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + DeleteBookRequest expectedRequest = new DeleteBookRequest { - Success = false, + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - string source = "source-896505829"; - string archive = "archive-748101438"; - ArchiveBooksResponse response = client.ArchiveBooks(source, archive); - Assert.Same(expectedResponse, response); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + client.DeleteBook(name); mockGrpcClient.VerifyAll(); } [Fact] - public async Task ArchiveBooksAsync() + public async Task DeleteBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - Source = "source-896505829", - Archive = "archive-748101438", - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + DeleteBookRequest expectedRequest = new DeleteBookRequest { - Success = false, + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - string source = "source-896505829"; - string archive = "archive-748101438"; - ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); - Assert.Same(expectedResponse, response); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + await client.DeleteBookAsync(name); mockGrpcClient.VerifyAll(); } [Fact] - public void ArchiveBooks2() + public void DeleteBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ArchiveBooksRequest request = new ArchiveBooksRequest(); - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + DeleteBookRequest request = new DeleteBookRequest { - Success = false, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - mockGrpcClient.Setup(x => x.ArchiveBooks(request, It.IsAny())) + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveBooksResponse response = client.ArchiveBooks(request); - Assert.Same(expectedResponse, response); + client.DeleteBook(request); mockGrpcClient.VerifyAll(); } [Fact] - public async Task ArchiveBooksAsync2() + public async Task DeleteBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ArchiveBooksRequest request = new ArchiveBooksRequest(); - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + DeleteBookRequest request = new DeleteBookRequest { - Success = false, + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - mockGrpcClient.Setup(x => x.ArchiveBooksAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveBooksResponse response = await client.ArchiveBooksAsync(request); - Assert.Same(expectedResponse, response); + await client.DeleteBookAsync(request); mockGrpcClient.VerifyAll(); } [Fact] - public void PrivateListShelves() + public void UpdateBook() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ListShelvesRequest expectedRequest = new ListShelvesRequest(); + UpdateBookRequest expectedRequest = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), @@ -10957,24 +11332,29 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.PrivateListShelves(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - - Book response = client.PrivateListShelves(); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); + Book response = client.UpdateBook(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task PrivateListShelvesAsync() + public async Task UpdateBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ListShelvesRequest expectedRequest = new ListShelvesRequest(); + UpdateBookRequest expectedRequest = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), @@ -10982,24 +11362,29 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.PrivateListShelvesAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - - Book response = await client.PrivateListShelvesAsync(); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); + Book response = await client.UpdateBookAsync(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void PrivateListShelves2() + public void UpdateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ListShelvesRequest request = new ListShelvesRequest(); + UpdateBookRequest expectedRequest = new UpdateBookRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), @@ -11007,23 +11392,29 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.PrivateListShelves(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.PrivateListShelves(request); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); + Book response = client.UpdateBook(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task PrivateListShelvesAsync2() + public async Task UpdateBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - ListShelvesRequest request = new ListShelvesRequest(); + UpdateBookRequest expectedRequest = new UpdateBookRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; Book expectedResponse = new Book { BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), @@ -11031,1424 +11422,11811 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.PrivateListShelvesAsync(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.PrivateListShelvesAsync(request); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); + Book response = await client.UpdateBookAsync(name, book); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } - } -} - -============== file: Google.Example.Library.V1/Google.Example.Library.V1.Tests/MyProtoClientTest.g.cs ============== -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated code. DO NOT EDIT! - -namespace Google.Example.Library.V1.Tests -{ - using Google.Api.Gax; - using Google.Api.Gax.Grpc; - using apis = Google.Example.Library.V1; - using Google.Protobuf.WellKnownTypes; - using Grpc.Core; - using Moq; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Threading; - using System.Threading.Tasks; - using Xunit; - - /// Generated unit tests - public class GeneratedMyProtoClientTest - { [Fact] - public void MyMethod() + public void UpdateBook3() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - MethodRequest request = new MethodRequest(); - MethodResponse expectedResponse = new MethodResponse + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookRequest expectedRequest = new UpdateBookRequest { - Myfield = "myfield1515208398", + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; - mockGrpcClient.Setup(x => x.MyMethod(request, It.IsAny())) + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); - MyProtoClient client = new MyProtoClientImpl(mockGrpcClient.Object, null); - MethodResponse response = client.MyMethod(request); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MyMethodAsync() + public async Task UpdateBookAsync3() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - MethodRequest request = new MethodRequest(); - MethodResponse expectedResponse = new MethodResponse + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookRequest expectedRequest = new UpdateBookRequest { - Myfield = "myfield1515208398", + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; - mockGrpcClient.Setup(x => x.MyMethodAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - MyProtoClient client = new MyProtoClientImpl(mockGrpcClient.Object, null); - MethodResponse response = await client.MyMethodAsync(request); + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } - } -} - -============== file: Google.Example.Library.V1/Google.Example.Library.V1/Google.Example.Library.V1.csproj ============== - - - + [Fact] + public void UpdateBook4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookRequest expectedRequest = new UpdateBookRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - - 1.0.0 + [Fact] + public async Task UpdateBookAsync4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookRequest expectedRequest = new UpdateBookRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalFoo = "optionalFoo1822578535", + Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = "optionalFoo1822578535"; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - - + [Fact] + public void UpdateBook5() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookRequest request = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = client.UpdateBook(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - - + [Fact] + public async Task UpdateBookAsync5() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookRequest request = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.UpdateBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.UpdateBookAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - - netstandard1.5;net45 - netstandard1.5 - latest - true - true - true + [Fact] + public void MoveBook() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = client.MoveBook(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - + [Fact] + public async Task MoveBookAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = await client.MoveBookAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - - - - + [Fact] + public void MoveBook2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = client.MoveBook(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - + [Fact] + public async Task MoveBookAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest expectedRequest = new MoveBookRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + Book response = await client.MoveBookAsync(name, otherShelfName); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } -============== file: Google.Example.Library.V1/Google.Example.Library.V1/LibraryServiceClient.cs ============== -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. + [Fact] + public void MoveBook3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest request = new MoveBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = client.MoveBook(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } -// Generated code. DO NOT EDIT! + [Fact] + public async Task MoveBookAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBookRequest request = new MoveBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.MoveBookAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } -using gax = Google.Api.Gax; -using gaxgrpc = Google.Api.Gax.Grpc; -using gctv = Google.Cloud.Tagger.V1; -using lro = Google.LongRunning; -using pb = Google.Protobuf; -using pbwkt = Google.Protobuf.WellKnownTypes; -using gtv = Google.Tagger.V1; -using grpccore = Grpc.Core; -using sys = System; -using sc = System.Collections; -using scg = System.Collections.Generic; -using sco = System.Collections.ObjectModel; -using linq = System.Linq; -using st = System.Threading; -using stt = System.Threading.Tasks; + [Fact] + public void AddComments() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + client.AddComments(name, comments); + mockGrpcClient.VerifyAll(); + } -namespace Google.Example.Library.V1 -{ - /// - /// Settings for a . - /// - public sealed partial class LibraryServiceSettings : gaxgrpc::ServiceSettingsBase - { - /// - /// Get a new instance of the default . - /// - /// - /// A new instance of the default . - /// - public static LibraryServiceSettings GetDefault() => new LibraryServiceSettings(); + [Fact] + public async Task AddCommentsAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + await client.AddCommentsAsync(name, comments); + mockGrpcClient.VerifyAll(); + } - /// - /// Constructs a new object with default settings. - /// - public LibraryServiceSettings() { } + [Fact] + public void AddComments2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + client.AddComments(name, comments); + mockGrpcClient.VerifyAll(); + } - private LibraryServiceSettings(LibraryServiceSettings existing) : base(existing) + [Fact] + public async Task AddCommentsAsync2() { - gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); - CreateShelfSettings = existing.CreateShelfSettings; - GetShelfSettings = existing.GetShelfSettings; - ListShelvesSettings = existing.ListShelvesSettings; - DeleteShelfSettings = existing.DeleteShelfSettings; - MergeShelvesSettings = existing.MergeShelvesSettings; - CreateBookSettings = existing.CreateBookSettings; - PublishSeriesSettings = existing.PublishSeriesSettings; - GetBookSettings = existing.GetBookSettings; - ListBooksSettings = existing.ListBooksSettings; - DeleteBookSettings = existing.DeleteBookSettings; - UpdateBookSettings = existing.UpdateBookSettings; - MoveBookSettings = existing.MoveBookSettings; - ListStringsSettings = existing.ListStringsSettings; - AddCommentsSettings = existing.AddCommentsSettings; - GetBookFromArchiveSettings = existing.GetBookFromArchiveSettings; - GetBookFromAnywhereSettings = existing.GetBookFromAnywhereSettings; - GetBookFromAbsolutelyAnywhereSettings = existing.GetBookFromAbsolutelyAnywhereSettings; - UpdateBookIndexSettings = existing.UpdateBookIndexSettings; - StreamShelvesSettings = existing.StreamShelvesSettings; - StreamBooksSettings = existing.StreamBooksSettings; - DiscussBookSettings = existing.DiscussBookSettings; - DiscussBookStreamingSettings = existing.DiscussBookStreamingSettings; - FindRelatedBooksSettings = existing.FindRelatedBooksSettings; - AddLabelSettings = existing.AddLabelSettings; - GetBigBookSettings = existing.GetBigBookSettings; - GetBigBookOperationsSettings = existing.GetBigBookOperationsSettings?.Clone(); - GetBigNothingSettings = existing.GetBigNothingSettings; - GetBigNothingOperationsSettings = existing.GetBigNothingOperationsSettings?.Clone(); - TestOptionalRequiredFlatteningParamsSettings = existing.TestOptionalRequiredFlatteningParamsSettings; - MoveBooksSettings = existing.MoveBooksSettings; - ArchiveBooksSettings = existing.ArchiveBooksSettings; - LongRunningArchiveBooksSettings = existing.LongRunningArchiveBooksSettings; - LongRunningArchiveBooksOperationsSettings = existing.LongRunningArchiveBooksOperationsSettings?.Clone(); - StreamingArchiveBooksSettings = existing.StreamingArchiveBooksSettings; - StreamingArchiveBooksStreamingSettings = existing.StreamingArchiveBooksStreamingSettings; - PrivateListShelvesSettings = existing.PrivateListShelvesSettings; - OnCopy(existing); + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest expectedRequest = new AddCommentsRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + await client.AddCommentsAsync(name, comments); + mockGrpcClient.VerifyAll(); } - partial void OnCopy(LibraryServiceSettings existing); + [Fact] + public void AddComments3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest request = new AddCommentsRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddComments(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + client.AddComments(request); + mockGrpcClient.VerifyAll(); + } - /// - /// The filter specifying which RPC s are eligible for retry - /// for "Idempotent" RPC methods. - /// - /// - /// The eligible RPC s for retry for "Idempotent" RPC methods are: - /// - /// - /// - /// - /// - public static sys::Predicate IdempotentRetryFilter { get; } = - gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable); - - /// - /// The filter specifying which RPC s are eligible for retry - /// for "NonIdempotent" RPC methods. - /// - /// - /// There are no RPC s eligible for retry for "NonIdempotent" RPC methods. - /// - public static sys::Predicate NonIdempotentRetryFilter { get; } = - gaxgrpc::RetrySettings.FilterForStatusCodes(); + [Fact] + public async Task AddCommentsAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + AddCommentsRequest request = new AddCommentsRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Comments = + { + new Comment + { + Comment = ByteString.CopyFromUtf8("95"), + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.AddCommentsAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + await client.AddCommentsAsync(request); + mockGrpcClient.VerifyAll(); + } - /// - /// "Default" retry backoff for RPC methods. - /// - /// - /// The "Default" retry backoff for RPC methods. - /// - /// - /// The "Default" retry backoff for RPC methods is defined as: - /// - /// Initial delay: 100 milliseconds - /// Maximum delay: 1000 milliseconds - /// Delay multiplier: 1.2 - /// - /// - public static gaxgrpc::BackoffSettings GetDefaultRetryBackoff() => new gaxgrpc::BackoffSettings( - delay: sys::TimeSpan.FromMilliseconds(100), - maxDelay: sys::TimeSpan.FromMilliseconds(1000), - delayMultiplier: 1.2 - ); + [Fact] + public void GetBookFromArchive() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + ParentAsProjectName = new ProjectName("[PROJECT]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + BookFromArchive response = client.GetBookFromArchive(name, parent); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// "Default" timeout backoff for RPC methods. - /// - /// - /// The "Default" timeout backoff for RPC methods. - /// - /// - /// The "Default" timeout backoff for RPC methods is defined as: - /// - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Maximum timeout: 3000 milliseconds - /// - /// - public static gaxgrpc::BackoffSettings GetDefaultTimeoutBackoff() => new gaxgrpc::BackoffSettings( - delay: sys::TimeSpan.FromMilliseconds(300), - maxDelay: sys::TimeSpan.FromMilliseconds(3000), - delayMultiplier: 1.3 - ); + [Fact] + public async Task GetBookFromArchiveAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + ParentAsProjectName = new ProjectName("[PROJECT]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + BookFromArchive response = await client.GetBookFromArchiveAsync(name, parent); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.CreateShelf and LibraryServiceClient.CreateShelfAsync. - /// - /// - /// The default LibraryServiceClient.CreateShelf and - /// LibraryServiceClient.CreateShelfAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings CreateShelfSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public void GetBookFromArchive2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest + { + Name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Parent = new ProjectName("[PROJECT]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + BookFromArchive response = client.GetBookFromArchive(name, parent); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.GetShelf and LibraryServiceClient.GetShelfAsync. - /// - /// - /// The default LibraryServiceClient.GetShelf and - /// LibraryServiceClient.GetShelfAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings GetShelfSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public async Task GetBookFromArchiveAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest + { + Name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Parent = new ProjectName("[PROJECT]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + BookFromArchive response = await client.GetBookFromArchiveAsync(name, parent); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.ListShelves and LibraryServiceClient.ListShelvesAsync. - /// - /// - /// The default LibraryServiceClient.ListShelves and - /// LibraryServiceClient.ListShelvesAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings ListShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); - - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.DeleteShelf and LibraryServiceClient.DeleteShelfAsync. - /// - /// - /// The default LibraryServiceClient.DeleteShelf and - /// LibraryServiceClient.DeleteShelfAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings DeleteShelfSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public void GetBookFromArchive3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest request = new GetBookFromArchiveRequest + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + ParentAsProjectName = new ProjectName("[PROJECT]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchive(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromArchive response = client.GetBookFromArchive(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.MergeShelves and LibraryServiceClient.MergeShelvesAsync. - /// - /// - /// The default LibraryServiceClient.MergeShelves and - /// LibraryServiceClient.MergeShelvesAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings MergeShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public async Task GetBookFromArchiveAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromArchiveRequest request = new GetBookFromArchiveRequest + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + ParentAsProjectName = new ProjectName("[PROJECT]"), + }; + BookFromArchive expectedResponse = new BookFromArchive + { + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromArchive response = await client.GetBookFromArchiveAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.CreateBook and LibraryServiceClient.CreateBookAsync. - /// - /// - /// The default LibraryServiceClient.CreateBook and - /// LibraryServiceClient.CreateBookAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings CreateBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public void GetBookFromAnywhere() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName, place, folder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.PublishSeries and LibraryServiceClient.PublishSeriesAsync. - /// - /// - /// The default LibraryServiceClient.PublishSeries and - /// LibraryServiceClient.PublishSeriesAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings PublishSeriesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public async Task GetBookFromAnywhereAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName, place, folder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.GetBook and LibraryServiceClient.GetBookAsync. - /// - /// - /// The default LibraryServiceClient.GetBook and - /// LibraryServiceClient.GetBookAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings GetBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); - - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.ListBooks and LibraryServiceClient.ListBooksAsync. - /// - /// - /// The default LibraryServiceClient.ListBooks and - /// LibraryServiceClient.ListBooksAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings ListBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public void GetBookFromAnywhere2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Place = new LocationName("[PROJECT]", "[LOCATION]"), + Folder = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName, place, folder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.DeleteBook and LibraryServiceClient.DeleteBookAsync. - /// - /// - /// The default LibraryServiceClient.DeleteBook and - /// LibraryServiceClient.DeleteBookAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings DeleteBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public async Task GetBookFromAnywhereAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Place = new LocationName("[PROJECT]", "[LOCATION]"), + Folder = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName, place, folder); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.UpdateBook and LibraryServiceClient.UpdateBookAsync. - /// - /// - /// The default LibraryServiceClient.UpdateBook and - /// LibraryServiceClient.UpdateBookAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings UpdateBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public void GetBookFromAnywhere3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhere(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromAnywhere response = client.GetBookFromAnywhere(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.MoveBook and LibraryServiceClient.MoveBookAsync. - /// - /// - /// The default LibraryServiceClient.MoveBook and - /// LibraryServiceClient.MoveBookAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings MoveBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public async Task GetBookFromAnywhereAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromAnywhere response = await client.GetBookFromAnywhereAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.ListStrings and LibraryServiceClient.ListStringsAsync. - /// - /// - /// The default LibraryServiceClient.ListStrings and - /// LibraryServiceClient.ListStringsAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings ListStringsSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); - - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.AddComments and LibraryServiceClient.AddCommentsAsync. - /// - /// - /// The default LibraryServiceClient.AddComments and - /// LibraryServiceClient.AddCommentsAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings AddCommentsSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public void GetBookFromAbsolutelyAnywhere() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.GetBookFromArchive and LibraryServiceClient.GetBookFromArchiveAsync. - /// - /// - /// The default LibraryServiceClient.GetBookFromArchive and - /// LibraryServiceClient.GetBookFromArchiveAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings GetBookFromArchiveSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public async Task GetBookFromAbsolutelyAnywhereAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.GetBookFromAnywhere and LibraryServiceClient.GetBookFromAnywhereAsync. - /// - /// - /// The default LibraryServiceClient.GetBookFromAnywhere and - /// LibraryServiceClient.GetBookFromAnywhereAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings GetBookFromAnywhereSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public void GetBookFromAbsolutelyAnywhere2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.GetBookFromAbsolutelyAnywhere and LibraryServiceClient.GetBookFromAbsolutelyAnywhereAsync. - /// - /// - /// The default LibraryServiceClient.GetBookFromAbsolutelyAnywhere and - /// LibraryServiceClient.GetBookFromAbsolutelyAnywhereAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings GetBookFromAbsolutelyAnywhereSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public async Task GetBookFromAbsolutelyAnywhereAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.UpdateBookIndex and LibraryServiceClient.UpdateBookIndexAsync. - /// - /// - /// The default LibraryServiceClient.UpdateBookIndex and - /// LibraryServiceClient.UpdateBookIndexAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings UpdateBookIndexSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public void GetBookFromAbsolutelyAnywhere3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for calls to LibraryServiceClient.StreamShelves. - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings StreamShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + [Fact] + public async Task GetBookFromAbsolutelyAnywhereAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + BookFromAnywhere expectedResponse = new BookFromAnywhere + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for calls to LibraryServiceClient.StreamBooks. - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings StreamBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + [Fact] + public void UpdateBookIndex() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + client.UpdateBookIndex(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } - /// - /// for calls to LibraryServiceClient.DiscussBook. - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings DiscussBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + [Fact] + public async Task UpdateBookIndexAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + await client.UpdateBookIndexAsync(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } - /// - /// for calls to - /// LibraryServiceClient.DiscussBook. - /// - /// - /// The default local send queue size is 100. - /// - public gaxgrpc::BidirectionalStreamingSettings DiscussBookStreamingSettings { get; set; } = - new gaxgrpc::BidirectionalStreamingSettings(100); + [Fact] + public void UpdateBookIndex2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + client.UpdateBookIndex(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.FindRelatedBooks and LibraryServiceClient.FindRelatedBooksAsync. - /// - /// - /// The default LibraryServiceClient.FindRelatedBooks and - /// LibraryServiceClient.FindRelatedBooksAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings FindRelatedBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + [Fact] + public async Task UpdateBookIndexAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + { + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "indexMapItem1918721251" }, + }; + await client.UpdateBookIndexAsync(name, indexName, indexMap); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.AddLabel and LibraryServiceClient.AddLabelAsync. - /// - /// - /// The default LibraryServiceClient.AddLabel and - /// LibraryServiceClient.AddLabelAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings AddLabelSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public void UpdateBookIndex3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest request = new UpdateBookIndexRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndex(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + client.UpdateBookIndex(request); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.GetBigBook and LibraryServiceClient.GetBigBookAsync. - /// - /// - /// The default LibraryServiceClient.GetBigBook and - /// LibraryServiceClient.GetBigBookAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings GetBigBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + [Fact] + public async Task UpdateBookIndexAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest request = new UpdateBookIndexRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + await client.UpdateBookIndexAsync(request); + mockGrpcClient.VerifyAll(); + } - /// - /// Long Running Operation settings for calls to LibraryServiceClient.GetBigBook. - /// - /// - /// Uses default of: - /// - /// Initial delay: 3000 milliseconds - /// Delay multiplier: 1.3 - /// Maximum delay: 30000 milliseconds - /// Total timeout: 86400000 milliseconds - /// - /// - public lro::OperationsSettings GetBigBookOperationsSettings { get; set; } = new lro::OperationsSettings + [Fact] + public void TestOptionalRequiredFlatteningParams() { - DefaultPollSettings = new gax::PollSettings( - gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(86400000L)), - sys::TimeSpan.FromMilliseconds(3000L), - 1.3, - sys::TimeSpan.FromMilliseconds(30000L)) - }; + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.GetBigNothing and LibraryServiceClient.GetBigNothingAsync. - /// - /// - /// The default LibraryServiceClient.GetBigNothing and - /// LibraryServiceClient.GetBigNothingAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings GetBigNothingSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// Long Running Operation settings for calls to LibraryServiceClient.GetBigNothing. - /// - /// - /// Uses default of: - /// - /// Initial delay: 3000 milliseconds - /// Delay multiplier: 1.3 - /// Maximum delay: 60000 milliseconds - /// Total timeout: 600000 milliseconds - /// - /// - public lro::OperationsSettings GetBigNothingOperationsSettings { get; set; } = new lro::OperationsSettings + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync() { - DefaultPollSettings = new gax::PollSettings( - gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000L)), - sys::TimeSpan.FromMilliseconds(3000L), - 1.3, - sys::TimeSpan.FromMilliseconds(60000L)) - }; - - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.TestOptionalRequiredFlatteningParams and LibraryServiceClient.TestOptionalRequiredFlatteningParamsAsync. - /// - /// - /// The default LibraryServiceClient.TestOptionalRequiredFlatteningParams and - /// LibraryServiceClient.TestOptionalRequiredFlatteningParamsAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings TestOptionalRequiredFlatteningParamsSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.MoveBooks and LibraryServiceClient.MoveBooksAsync. - /// - /// - /// The default LibraryServiceClient.MoveBooks and - /// LibraryServiceClient.MoveBooksAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings MoveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } - /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.ArchiveBooks and LibraryServiceClient.ArchiveBooksAsync. + [Fact] + public void TestOptionalRequiredFlatteningParams2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void TestOptionalRequiredFlatteningParams3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + OptionalSingularInt32 = 1196565723, + OptionalSingularInt64 = 1196565628L, + OptionalSingularFloat = -1.19939918E8f, + OptionalSingularDouble = 1.41902287E8, + OptionalSingularBool = false, + OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + OptionalSingularString = "optionalSingularString1852995162", + OptionalSingularBytes = ByteString.CopyFromUtf8("2"), + OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", + OptionalSingularFixed32 = 1648847958, + OptionalSingularFixed64 = 1648847863, + OptionalRepeatedInt32 = { }, + OptionalRepeatedInt64 = { }, + OptionalRepeatedFloat = { }, + OptionalRepeatedDouble = { }, + OptionalRepeatedBool = { }, + OptionalRepeatedEnum = { }, + OptionalRepeatedString = { }, + OptionalRepeatedBytes = { }, + OptionalRepeatedMessage = { }, + OptionalRepeatedResourceName = { }, + OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedFixed32 = { }, + OptionalRepeatedFixed64 = { }, + OptionalMap = { }, + AnyValue = new Any(), + StructValue = new Struct(), + ValueValue = new Value(), + ListValueValue = new ListValue(), + TimeValue = new Timestamp(), + DurationValue = new Duration(), + FieldMaskValue = new FieldMask(), + Int32Value = null, + Uint32Value = null, + Int64Value = null, + Uint64Value = null, + FloatValue = null, + DoubleValue = null, + StringValue = null, + BoolValue = null, + BytesValue = null, + RepeatedAnyValue = { }, + RepeatedStructValue = { }, + RepeatedValueValue = { }, + RepeatedListValueValue = { }, + RepeatedTimeValue = { }, + RepeatedDurationValue = { }, + RepeatedFieldMaskValue = { }, + RepeatedInt32Value = { }, + RepeatedUint32Value = { }, + RepeatedInt64Value = { }, + RepeatedUint64Value = { }, + RepeatedFloatValue = { }, + RepeatedDoubleValue = { }, + RepeatedStringValue = { }, + RepeatedBoolValue = { }, + RepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + int requiredSingularInt32 = 72313594; + long requiredSingularInt64 = 72313499L; + float requiredSingularFloat = -7514705.0f; + double requiredSingularDouble = 1.9111005E8; + bool requiredSingularBool = true; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = "requiredSingularString-1949894503"; + ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; + int requiredSingularFixed32 = 720656715; + long requiredSingularFixed64 = 720656810; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 1196565723; + long optionalSingularInt64 = 1196565628L; + float optionalSingularFloat = -1.19939918E8f; + double optionalSingularDouble = 1.41902287E8; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = "optionalSingularString1852995162"; + ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; + int optionalSingularFixed32 = 1648847958; + long optionalSingularFixed64 = 1648847863; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void TestOptionalRequiredFlatteningParams4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceName = { }, + RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, + }; + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsProjectName = new ProjectName("[PROJECT]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsProjectName = new ProjectName("[PROJECT]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + DestinationAsProjectName = new ProjectName("[PROJECT]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + DestinationAsProjectName = new ProjectName("[PROJECT]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + DestinationAsProjectName = new ProjectName("[PROJECT]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + DestinationAsProjectName = new ProjectName("[PROJECT]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks5() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsShelfName = new ShelfName("[SHELF]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync5() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsShelfName = new ShelfName("[SHELF]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks6() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync6() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks7() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + DestinationAsShelfName = new ShelfName("[SHELF]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync7() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + DestinationAsShelfName = new ShelfName("[SHELF]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks8() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync8() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks9() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + DestinationAsShelfName = new ShelfName("[SHELF]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync9() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + DestinationAsShelfName = new ShelfName("[SHELF]"), + Publishers = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks10() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + Source = new ArchiveName("[ARCHIVE]"), + Destination = new ProjectName("[PROJECT]"), + Publishers = { }, + Project = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable formattedPublishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = client.MoveBooks(source, destination, formattedPublishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync10() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest expectedRequest = new MoveBooksRequest + { + Source = new ArchiveName("[ARCHIVE]"), + Destination = new ProjectName("[PROJECT]"), + Publishers = { }, + Project = new ProjectName("[PROJECT]"), + }; + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable formattedPublishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, formattedPublishers, project); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void MoveBooks11() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest request = new MoveBooksRequest(); + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooks(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + MoveBooksResponse response = client.MoveBooks(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MoveBooksAsync11() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + MoveBooksRequest request = new MoveBooksRequest(); + MoveBooksResponse expectedResponse = new MoveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.MoveBooksAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + MoveBooksResponse response = await client.MoveBooksAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void ArchiveBooks() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = client.ArchiveBooks(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task ArchiveBooksAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void ArchiveBooks2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = client.ArchiveBooks(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task ArchiveBooksAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + SourceAsShelfName = new ShelfName("[SHELF]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void ArchiveBooks3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = client.ArchiveBooks(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task ArchiveBooksAsync3() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + SourceAsProjectName = new ProjectName("[PROJECT]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void ArchiveBooks4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + Source = new ArchiveName("[ARCHIVE]"), + Archive = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = client.ArchiveBooks(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task ArchiveBooksAsync4() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest + { + Source = new ArchiveName("[ARCHIVE]"), + Archive = new ArchiveName("[ARCHIVE]"), + }; + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void ArchiveBooks5() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest request = new ArchiveBooksRequest(); + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooks(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveBooksResponse response = client.ArchiveBooks(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task ArchiveBooksAsync5() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ArchiveBooksRequest request = new ArchiveBooksRequest(); + ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse + { + Success = false, + }; + mockGrpcClient.Setup(x => x.ArchiveBooksAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + ArchiveBooksResponse response = await client.ArchiveBooksAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void PrivateListShelves() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ListShelvesRequest expectedRequest = new ListShelvesRequest(); + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.PrivateListShelves(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + + Book response = client.PrivateListShelves(); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task PrivateListShelvesAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ListShelvesRequest expectedRequest = new ListShelvesRequest(); + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.PrivateListShelvesAsync(expectedRequest, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + + Book response = await client.PrivateListShelvesAsync(); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void PrivateListShelves2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ListShelvesRequest request = new ListShelvesRequest(); + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.PrivateListShelves(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = client.PrivateListShelves(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task PrivateListShelvesAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + ListShelvesRequest request = new ListShelvesRequest(); + Book expectedResponse = new Book + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Author = "author-1406328437", + Title = "title110371416", + Read = true, + }; + mockGrpcClient.Setup(x => x.PrivateListShelvesAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + Book response = await client.PrivateListShelvesAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + } +} + +============== file: Google.Example.Library.V1/Google.Example.Library.V1.Tests/MyProtoClientTest.g.cs ============== +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated code. DO NOT EDIT! + +namespace Google.Example.Library.V1.Tests +{ + using Google.Api.Gax; + using Google.Api.Gax.Grpc; + using apis = Google.Example.Library.V1; + using Google.Protobuf.WellKnownTypes; + using Grpc.Core; + using Moq; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Threading; + using System.Threading.Tasks; + using Xunit; + + /// Generated unit tests + public class GeneratedMyProtoClientTest + { + [Fact] + public void MyMethod() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + MethodRequest request = new MethodRequest(); + MethodResponse expectedResponse = new MethodResponse + { + Myfield = "myfield1515208398", + }; + mockGrpcClient.Setup(x => x.MyMethod(request, It.IsAny())) + .Returns(expectedResponse); + MyProtoClient client = new MyProtoClientImpl(mockGrpcClient.Object, null); + MethodResponse response = client.MyMethod(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task MyMethodAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + MethodRequest request = new MethodRequest(); + MethodResponse expectedResponse = new MethodResponse + { + Myfield = "myfield1515208398", + }; + mockGrpcClient.Setup(x => x.MyMethodAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + MyProtoClient client = new MyProtoClientImpl(mockGrpcClient.Object, null); + MethodResponse response = await client.MyMethodAsync(request); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + } +} + +============== file: Google.Example.Library.V1/Google.Example.Library.V1/Google.Example.Library.V1.csproj ============== + + + + + + 1.0.0 + + + + + + + + + netstandard1.5;net45 + netstandard1.5 + latest + true + true + true + + + + + + + + + + +============== file: Google.Example.Library.V1/Google.Example.Library.V1/LibraryServiceClient.cs ============== +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated code. DO NOT EDIT! + +using gax = Google.Api.Gax; +using gaxgrpc = Google.Api.Gax.Grpc; +using gctv = Google.Cloud.Tagger.V1; +using lro = Google.LongRunning; +using pb = Google.Protobuf; +using pbwkt = Google.Protobuf.WellKnownTypes; +using gtv = Google.Tagger.V1; +using grpccore = Grpc.Core; +using sys = System; +using sc = System.Collections; +using scg = System.Collections.Generic; +using sco = System.Collections.ObjectModel; +using linq = System.Linq; +using st = System.Threading; +using stt = System.Threading.Tasks; + +namespace Google.Example.Library.V1 +{ + /// + /// Settings for a . + /// + public sealed partial class LibraryServiceSettings : gaxgrpc::ServiceSettingsBase + { + /// + /// Get a new instance of the default . + /// + /// + /// A new instance of the default . + /// + public static LibraryServiceSettings GetDefault() => new LibraryServiceSettings(); + + /// + /// Constructs a new object with default settings. + /// + public LibraryServiceSettings() { } + + private LibraryServiceSettings(LibraryServiceSettings existing) : base(existing) + { + gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); + CreateShelfSettings = existing.CreateShelfSettings; + GetShelfSettings = existing.GetShelfSettings; + ListShelvesSettings = existing.ListShelvesSettings; + DeleteShelfSettings = existing.DeleteShelfSettings; + MergeShelvesSettings = existing.MergeShelvesSettings; + CreateBookSettings = existing.CreateBookSettings; + PublishSeriesSettings = existing.PublishSeriesSettings; + GetBookSettings = existing.GetBookSettings; + ListBooksSettings = existing.ListBooksSettings; + DeleteBookSettings = existing.DeleteBookSettings; + UpdateBookSettings = existing.UpdateBookSettings; + MoveBookSettings = existing.MoveBookSettings; + ListStringsSettings = existing.ListStringsSettings; + AddCommentsSettings = existing.AddCommentsSettings; + GetBookFromArchiveSettings = existing.GetBookFromArchiveSettings; + GetBookFromAnywhereSettings = existing.GetBookFromAnywhereSettings; + GetBookFromAbsolutelyAnywhereSettings = existing.GetBookFromAbsolutelyAnywhereSettings; + UpdateBookIndexSettings = existing.UpdateBookIndexSettings; + StreamShelvesSettings = existing.StreamShelvesSettings; + StreamBooksSettings = existing.StreamBooksSettings; + DiscussBookSettings = existing.DiscussBookSettings; + DiscussBookStreamingSettings = existing.DiscussBookStreamingSettings; + FindRelatedBooksSettings = existing.FindRelatedBooksSettings; + AddLabelSettings = existing.AddLabelSettings; + GetBigBookSettings = existing.GetBigBookSettings; + GetBigBookOperationsSettings = existing.GetBigBookOperationsSettings?.Clone(); + GetBigNothingSettings = existing.GetBigNothingSettings; + GetBigNothingOperationsSettings = existing.GetBigNothingOperationsSettings?.Clone(); + TestOptionalRequiredFlatteningParamsSettings = existing.TestOptionalRequiredFlatteningParamsSettings; + MoveBooksSettings = existing.MoveBooksSettings; + ArchiveBooksSettings = existing.ArchiveBooksSettings; + LongRunningArchiveBooksSettings = existing.LongRunningArchiveBooksSettings; + LongRunningArchiveBooksOperationsSettings = existing.LongRunningArchiveBooksOperationsSettings?.Clone(); + StreamingArchiveBooksSettings = existing.StreamingArchiveBooksSettings; + StreamingArchiveBooksStreamingSettings = existing.StreamingArchiveBooksStreamingSettings; + PrivateListShelvesSettings = existing.PrivateListShelvesSettings; + OnCopy(existing); + } + + partial void OnCopy(LibraryServiceSettings existing); + + /// + /// The filter specifying which RPC s are eligible for retry + /// for "Idempotent" RPC methods. + /// + /// + /// The eligible RPC s for retry for "Idempotent" RPC methods are: + /// + /// + /// + /// + /// + public static sys::Predicate IdempotentRetryFilter { get; } = + gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable); + + /// + /// The filter specifying which RPC s are eligible for retry + /// for "NonIdempotent" RPC methods. + /// + /// + /// There are no RPC s eligible for retry for "NonIdempotent" RPC methods. + /// + public static sys::Predicate NonIdempotentRetryFilter { get; } = + gaxgrpc::RetrySettings.FilterForStatusCodes(); + + /// + /// "Default" retry backoff for RPC methods. + /// + /// + /// The "Default" retry backoff for RPC methods. + /// + /// + /// The "Default" retry backoff for RPC methods is defined as: + /// + /// Initial delay: 100 milliseconds + /// Maximum delay: 1000 milliseconds + /// Delay multiplier: 1.2 + /// + /// + public static gaxgrpc::BackoffSettings GetDefaultRetryBackoff() => new gaxgrpc::BackoffSettings( + delay: sys::TimeSpan.FromMilliseconds(100), + maxDelay: sys::TimeSpan.FromMilliseconds(1000), + delayMultiplier: 1.2 + ); + + /// + /// "Default" timeout backoff for RPC methods. + /// + /// + /// The "Default" timeout backoff for RPC methods. + /// + /// + /// The "Default" timeout backoff for RPC methods is defined as: + /// + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Maximum timeout: 3000 milliseconds + /// + /// + public static gaxgrpc::BackoffSettings GetDefaultTimeoutBackoff() => new gaxgrpc::BackoffSettings( + delay: sys::TimeSpan.FromMilliseconds(300), + maxDelay: sys::TimeSpan.FromMilliseconds(3000), + delayMultiplier: 1.3 + ); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.CreateShelf and LibraryServiceClient.CreateShelfAsync. + /// + /// + /// The default LibraryServiceClient.CreateShelf and + /// LibraryServiceClient.CreateShelfAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings CreateShelfSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.GetShelf and LibraryServiceClient.GetShelfAsync. + /// + /// + /// The default LibraryServiceClient.GetShelf and + /// LibraryServiceClient.GetShelfAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings GetShelfSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.ListShelves and LibraryServiceClient.ListShelvesAsync. + /// + /// + /// The default LibraryServiceClient.ListShelves and + /// LibraryServiceClient.ListShelvesAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings ListShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.DeleteShelf and LibraryServiceClient.DeleteShelfAsync. + /// + /// + /// The default LibraryServiceClient.DeleteShelf and + /// LibraryServiceClient.DeleteShelfAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings DeleteShelfSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.MergeShelves and LibraryServiceClient.MergeShelvesAsync. + /// + /// + /// The default LibraryServiceClient.MergeShelves and + /// LibraryServiceClient.MergeShelvesAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings MergeShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.CreateBook and LibraryServiceClient.CreateBookAsync. + /// + /// + /// The default LibraryServiceClient.CreateBook and + /// LibraryServiceClient.CreateBookAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings CreateBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.PublishSeries and LibraryServiceClient.PublishSeriesAsync. + /// + /// + /// The default LibraryServiceClient.PublishSeries and + /// LibraryServiceClient.PublishSeriesAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings PublishSeriesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.GetBook and LibraryServiceClient.GetBookAsync. + /// + /// + /// The default LibraryServiceClient.GetBook and + /// LibraryServiceClient.GetBookAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings GetBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.ListBooks and LibraryServiceClient.ListBooksAsync. + /// + /// + /// The default LibraryServiceClient.ListBooks and + /// LibraryServiceClient.ListBooksAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings ListBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.DeleteBook and LibraryServiceClient.DeleteBookAsync. + /// + /// + /// The default LibraryServiceClient.DeleteBook and + /// LibraryServiceClient.DeleteBookAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings DeleteBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.UpdateBook and LibraryServiceClient.UpdateBookAsync. + /// + /// + /// The default LibraryServiceClient.UpdateBook and + /// LibraryServiceClient.UpdateBookAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings UpdateBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.MoveBook and LibraryServiceClient.MoveBookAsync. + /// + /// + /// The default LibraryServiceClient.MoveBook and + /// LibraryServiceClient.MoveBookAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings MoveBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.ListStrings and LibraryServiceClient.ListStringsAsync. + /// + /// + /// The default LibraryServiceClient.ListStrings and + /// LibraryServiceClient.ListStringsAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings ListStringsSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.AddComments and LibraryServiceClient.AddCommentsAsync. + /// + /// + /// The default LibraryServiceClient.AddComments and + /// LibraryServiceClient.AddCommentsAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings AddCommentsSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.GetBookFromArchive and LibraryServiceClient.GetBookFromArchiveAsync. + /// + /// + /// The default LibraryServiceClient.GetBookFromArchive and + /// LibraryServiceClient.GetBookFromArchiveAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings GetBookFromArchiveSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.GetBookFromAnywhere and LibraryServiceClient.GetBookFromAnywhereAsync. + /// + /// + /// The default LibraryServiceClient.GetBookFromAnywhere and + /// LibraryServiceClient.GetBookFromAnywhereAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings GetBookFromAnywhereSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.GetBookFromAbsolutelyAnywhere and LibraryServiceClient.GetBookFromAbsolutelyAnywhereAsync. + /// + /// + /// The default LibraryServiceClient.GetBookFromAbsolutelyAnywhere and + /// LibraryServiceClient.GetBookFromAbsolutelyAnywhereAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings GetBookFromAbsolutelyAnywhereSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.UpdateBookIndex and LibraryServiceClient.UpdateBookIndexAsync. + /// + /// + /// The default LibraryServiceClient.UpdateBookIndex and + /// LibraryServiceClient.UpdateBookIndexAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings UpdateBookIndexSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for calls to LibraryServiceClient.StreamShelves. + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings StreamShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + + /// + /// for calls to LibraryServiceClient.StreamBooks. + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings StreamBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + + /// + /// for calls to LibraryServiceClient.DiscussBook. + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings DiscussBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + + /// + /// for calls to + /// LibraryServiceClient.DiscussBook. + /// + /// + /// The default local send queue size is 100. + /// + public gaxgrpc::BidirectionalStreamingSettings DiscussBookStreamingSettings { get; set; } = + new gaxgrpc::BidirectionalStreamingSettings(100); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.FindRelatedBooks and LibraryServiceClient.FindRelatedBooksAsync. + /// + /// + /// The default LibraryServiceClient.FindRelatedBooks and + /// LibraryServiceClient.FindRelatedBooksAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings FindRelatedBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.AddLabel and LibraryServiceClient.AddLabelAsync. + /// + /// + /// The default LibraryServiceClient.AddLabel and + /// LibraryServiceClient.AddLabelAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings AddLabelSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.GetBigBook and LibraryServiceClient.GetBigBookAsync. + /// + /// + /// The default LibraryServiceClient.GetBigBook and + /// LibraryServiceClient.GetBigBookAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings GetBigBookSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// Long Running Operation settings for calls to LibraryServiceClient.GetBigBook. + /// + /// + /// Uses default of: + /// + /// Initial delay: 3000 milliseconds + /// Delay multiplier: 1.3 + /// Maximum delay: 30000 milliseconds + /// Total timeout: 86400000 milliseconds + /// + /// + public lro::OperationsSettings GetBigBookOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings( + gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(86400000L)), + sys::TimeSpan.FromMilliseconds(3000L), + 1.3, + sys::TimeSpan.FromMilliseconds(30000L)) + }; + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.GetBigNothing and LibraryServiceClient.GetBigNothingAsync. + /// + /// + /// The default LibraryServiceClient.GetBigNothing and + /// LibraryServiceClient.GetBigNothingAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings GetBigNothingSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// Long Running Operation settings for calls to LibraryServiceClient.GetBigNothing. + /// + /// + /// Uses default of: + /// + /// Initial delay: 3000 milliseconds + /// Delay multiplier: 1.3 + /// Maximum delay: 60000 milliseconds + /// Total timeout: 600000 milliseconds + /// + /// + public lro::OperationsSettings GetBigNothingOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings( + gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000L)), + sys::TimeSpan.FromMilliseconds(3000L), + 1.3, + sys::TimeSpan.FromMilliseconds(60000L)) + }; + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.TestOptionalRequiredFlatteningParams and LibraryServiceClient.TestOptionalRequiredFlatteningParamsAsync. + /// + /// + /// The default LibraryServiceClient.TestOptionalRequiredFlatteningParams and + /// LibraryServiceClient.TestOptionalRequiredFlatteningParamsAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings TestOptionalRequiredFlatteningParamsSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.MoveBooks and LibraryServiceClient.MoveBooksAsync. + /// + /// + /// The default LibraryServiceClient.MoveBooks and + /// LibraryServiceClient.MoveBooksAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings MoveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.ArchiveBooks and LibraryServiceClient.ArchiveBooksAsync. + /// + /// + /// The default LibraryServiceClient.ArchiveBooks and + /// LibraryServiceClient.ArchiveBooksAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings ArchiveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.LongRunningArchiveBooks and LibraryServiceClient.LongRunningArchiveBooksAsync. + /// + /// + /// The default LibraryServiceClient.LongRunningArchiveBooks and + /// LibraryServiceClient.LongRunningArchiveBooksAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// No status codes + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings LongRunningArchiveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: NonIdempotentRetryFilter + ))); + + /// + /// Long Running Operation settings for calls to LibraryServiceClient.LongRunningArchiveBooks. + /// + /// + /// Uses default of: + /// + /// Initial delay: 500 milliseconds + /// Delay multiplier: 1.5 + /// Maximum delay: 5000 milliseconds + /// Total timeout: 300000 milliseconds + /// + /// + public lro::OperationsSettings LongRunningArchiveBooksOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings( + gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(300000L)), + sys::TimeSpan.FromMilliseconds(500L), + 1.5, + sys::TimeSpan.FromMilliseconds(5000L)) + }; + + /// + /// for calls to LibraryServiceClient.StreamingArchiveBooks. + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings StreamingArchiveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + + /// + /// for calls to + /// LibraryServiceClient.StreamingArchiveBooks. + /// + /// + /// The default local send queue size is 100. + /// + public gaxgrpc::BidirectionalStreamingSettings StreamingArchiveBooksStreamingSettings { get; set; } = + new gaxgrpc::BidirectionalStreamingSettings(100); + + /// + /// for synchronous and asynchronous calls to + /// LibraryServiceClient.PrivateListShelves and LibraryServiceClient.PrivateListShelvesAsync. + /// + /// + /// The default LibraryServiceClient.PrivateListShelves and + /// LibraryServiceClient.PrivateListShelvesAsync are: + /// + /// Initial retry delay: 100 milliseconds + /// Retry delay multiplier: 1.2 + /// Retry maximum delay: 1000 milliseconds + /// Initial timeout: 300 milliseconds + /// Timeout multiplier: 1.3 + /// Timeout maximum delay: 3000 milliseconds + /// + /// Retry will be attempted on the following response status codes: + /// + /// + /// + /// + /// Default RPC expiration is 30000 milliseconds. + /// + public gaxgrpc::CallSettings PrivateListShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( + gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( + retryBackoff: GetDefaultRetryBackoff(), + timeoutBackoff: GetDefaultTimeoutBackoff(), + totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), + retryFilter: IdempotentRetryFilter + ))); + + /// + /// Creates a deep clone of this object, with all the same property values. + /// + /// A deep clone of this object. + public LibraryServiceSettings Clone() => new LibraryServiceSettings(this); + } + + /// + /// Builder class for to provide simple configuration of credentials, endpoint etc. + /// + public sealed partial class LibraryServiceClientBuilder : gaxgrpc::ClientBuilderBase + { + /// + /// The settings to use for RPCs, or null for the default settings. + /// + public LibraryServiceSettings Settings { get; set; } + + /// + public override LibraryServiceClient Build() + { + Validate(); + grpccore::CallInvoker callInvoker = CreateCallInvoker(); + return LibraryServiceClient.Create(callInvoker, Settings); + } + + /// + public override async stt::Task BuildAsync(st::CancellationToken cancellationToken = default) + { + Validate(); + grpccore::CallInvoker callInvoker = await CreateCallInvokerAsync(cancellationToken).ConfigureAwait(false); + return LibraryServiceClient.Create(callInvoker, Settings); + } + + /// + protected override gaxgrpc::ServiceEndpoint GetDefaultEndpoint() => LibraryServiceClient.DefaultEndpoint; + + /// + protected override scg::IReadOnlyList GetDefaultScopes() => LibraryServiceClient.DefaultScopes; + + /// + protected override gaxgrpc::ChannelPool GetChannelPool() => LibraryServiceClient.ChannelPool; + } + + /// + /// LibraryService client wrapper, for convenient use. + /// + public abstract partial class LibraryServiceClient + { + /// + /// The default endpoint for the LibraryService service, which is a host of "library-example.googleapis.com" and a port of 1234. + /// + public static gaxgrpc::ServiceEndpoint DefaultEndpoint { get; } = new gaxgrpc::ServiceEndpoint("library-example.googleapis.com", 1234); + + /// + /// The default LibraryService scopes. + /// + /// + /// The default LibraryService scopes are: + /// + /// "https://www.googleapis.com/auth/cloud-platform" + /// "https://www.googleapis.com/auth/library" + /// + /// + public static scg::IReadOnlyList DefaultScopes { get; } = new sco::ReadOnlyCollection(new string[] { + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/library", + }); + + private static readonly gaxgrpc::ChannelPool s_channelPool = new gaxgrpc::ChannelPool(DefaultScopes); + + internal static gaxgrpc::ChannelPool ChannelPool => s_channelPool; + + /// + /// Asynchronously creates a , applying defaults for all unspecified settings, + /// and creating a channel connecting to the given endpoint with application default credentials where + /// necessary. See the example for how to use custom credentials. + /// + /// + /// This sample shows how to create a client using default credentials: + /// + /// using Google.Example.Library.V1; + /// ... + /// // When running on Google Cloud Platform this will use the project Compute Credential. + /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON + /// // credential file to use that credential. + /// LibraryServiceClient client = await LibraryServiceClient.CreateAsync(); + /// + /// This sample shows how to create a client using credentials loaded from a JSON file: + /// + /// using Google.Example.Library.V1; + /// using Google.Apis.Auth.OAuth2; + /// using Grpc.Auth; + /// using Grpc.Core; + /// ... + /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); + /// Channel channel = new Channel( + /// LibraryServiceClient.DefaultEndpoint.Host, LibraryServiceClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); + /// LibraryServiceClient client = LibraryServiceClient.Create(channel); + /// ... + /// // Shutdown the channel when it is no longer required. + /// await channel.ShutdownAsync(); + /// + /// + /// Optional . + /// Optional . + /// The task representing the created . + public static async stt::Task CreateAsync(gaxgrpc::ServiceEndpoint endpoint = null, LibraryServiceSettings settings = null) + { + grpccore::Channel channel = await s_channelPool.GetChannelAsync(endpoint ?? DefaultEndpoint).ConfigureAwait(false); + return Create(channel, settings); + } + + /// + /// Synchronously creates a , applying defaults for all unspecified settings, + /// and creating a channel connecting to the given endpoint with application default credentials where + /// necessary. See the example for how to use custom credentials. + /// + /// + /// This sample shows how to create a client using default credentials: + /// + /// using Google.Example.Library.V1; + /// ... + /// // When running on Google Cloud Platform this will use the project Compute Credential. + /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON + /// // credential file to use that credential. + /// LibraryServiceClient client = LibraryServiceClient.Create(); + /// + /// This sample shows how to create a client using credentials loaded from a JSON file: + /// + /// using Google.Example.Library.V1; + /// using Google.Apis.Auth.OAuth2; + /// using Grpc.Auth; + /// using Grpc.Core; + /// ... + /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); + /// Channel channel = new Channel( + /// LibraryServiceClient.DefaultEndpoint.Host, LibraryServiceClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); + /// LibraryServiceClient client = LibraryServiceClient.Create(channel); + /// ... + /// // Shutdown the channel when it is no longer required. + /// channel.ShutdownAsync().Wait(); + /// + /// + /// Optional . + /// Optional . + /// The created . + public static LibraryServiceClient Create(gaxgrpc::ServiceEndpoint endpoint = null, LibraryServiceSettings settings = null) + { + grpccore::Channel channel = s_channelPool.GetChannel(endpoint ?? DefaultEndpoint); + return Create(channel, settings); + } + + /// + /// Creates a which uses the specified channel for remote operations. + /// + /// The for remote operations. Must not be null. + /// Optional . + /// The created . + public static LibraryServiceClient Create(grpccore::Channel channel, LibraryServiceSettings settings = null) + { + gax::GaxPreconditions.CheckNotNull(channel, nameof(channel)); + return Create(new grpccore::DefaultCallInvoker(channel), settings); + } + + /// + /// Creates a which uses the specified call invoker for remote operations. + /// + /// The for remote operations. Must not be null. + /// Optional . + /// The created . + public static LibraryServiceClient Create(grpccore::CallInvoker callInvoker, LibraryServiceSettings settings = null) + { + gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); + grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor; + if (interceptor != null) + { + callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor); + } + LibraryService.LibraryServiceClient grpcClient = new LibraryService.LibraryServiceClient(callInvoker); + return new LibraryServiceClientImpl(grpcClient, settings); + } + + /// + /// Shuts down any channels automatically created by + /// and . Channels which weren't automatically + /// created are not affected. + /// + /// After calling this method, further calls to + /// and will create new channels, which could + /// in turn be shut down by another call to this method. + /// A task representing the asynchronous shutdown operation. + public static stt::Task ShutdownDefaultChannelsAsync() => s_channelPool.ShutdownChannelsAsync(); + + /// + /// The underlying gRPC LibraryService client. + /// + public virtual LibraryService.LibraryServiceClient GrpcClient + { + get { throw new sys::NotImplementedException(); } + } + + /// + /// Creates a shelf, and returns the new Shelf. + /// RPC method comment may include special characters: <>&"`'@. + /// + /// + /// The shelf to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateShelfAsync( + Shelf shelf, + gaxgrpc::CallSettings callSettings = null) => CreateShelfAsync( + new CreateShelfRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + }, + callSettings); + + /// + /// Creates a shelf, and returns the new Shelf. + /// RPC method comment may include special characters: <>&"`'@. + /// + /// + /// The shelf to create. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateShelfAsync( + Shelf shelf, + st::CancellationToken cancellationToken) => CreateShelfAsync( + shelf, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a shelf, and returns the new Shelf. + /// RPC method comment may include special characters: <>&"`'@. + /// + /// + /// The shelf to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf CreateShelf( + Shelf shelf, + gaxgrpc::CallSettings callSettings = null) => CreateShelf( + new CreateShelfRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + }, + callSettings); + + /// + /// Creates a shelf, and returns the new Shelf. + /// RPC method comment may include special characters: <>&"`'@. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateShelfAsync( + CreateShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Creates a shelf, and returns the new Shelf. + /// RPC method comment may include special characters: <>&"`'@. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateShelfAsync( + CreateShelfRequest request, + st::CancellationToken cancellationToken) => CreateShelfAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a shelf, and returns the new Shelf. + /// RPC method comment may include special characters: <>&"`'@. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf CreateShelf( + CreateShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + ShelfName name, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + SomeMessage message, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + ShelfName name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + ShelfName name, + SomeMessage message, + StringBuilder stringBuilder, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + stringBuilder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + ShelfName name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + StringBuilder stringBuilder, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + stringBuilder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + string name, + SomeMessage message, + StringBuilder stringBuilder, + st::CancellationToken cancellationToken) => GetShelfAsync( + name, + message, + stringBuilder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The name of the shelf to retrieve. + /// + /// + /// Field to verify that message-type query parameter gets flattened. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + string name, + SomeMessage message, + StringBuilder stringBuilder, + gaxgrpc::CallSettings callSettings = null) => GetShelf( + new GetShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Message = message, // Optional + StringBuilder = stringBuilder, // Optional + }, + callSettings); + + /// + /// Gets a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + GetShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetShelfAsync( + GetShelfRequest request, + st::CancellationToken cancellationToken) => GetShelfAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf GetShelf( + GetShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Lists shelves. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListShelvesAsync( + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListShelvesAsync( + new ListShelvesRequest + { + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists shelves. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListShelves( + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListShelves( + new ListShelvesRequest + { + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists shelves. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListShelvesAsync( + ListShelvesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Lists shelves. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListShelves( + ListShelvesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + ShelfName name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( + new DeleteShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + ShelfName name, + st::CancellationToken cancellationToken) => DeleteShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteShelf( + ShelfName name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelf( + new DeleteShelfRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + string name, + st::CancellationToken cancellationToken) => DeleteShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteShelf( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelf( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + string name, + st::CancellationToken cancellationToken) => DeleteShelfAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a shelf. + /// + /// + /// The name of the shelf to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteShelf( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteShelf( + new DeleteShelfRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + DeleteShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Deletes a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteShelfAsync( + DeleteShelfRequest request, + st::CancellationToken cancellationToken) => DeleteShelfAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteShelf( + DeleteShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + ShelfName name, + ShelfName otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( + new MergeShelvesRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + ShelfName name, + ShelfName otherShelfName, + st::CancellationToken cancellationToken) => MergeShelvesAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf MergeShelves( + ShelfName name, + ShelfName otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelves( + new MergeShelvesRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MergeShelvesAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf MergeShelves( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelves( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MergeShelvesAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The name of the shelf we're adding books to. + /// + /// + /// The name of the shelf we're removing books from and deleting. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf MergeShelves( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MergeShelves( + new MergeShelvesRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + MergeShelvesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MergeShelvesAsync( + MergeShelvesRequest request, + st::CancellationToken cancellationToken) => MergeShelvesAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Merges two shelves by adding all books from the shelf named + /// `other_shelf_name` to shelf `name`, and deletes + /// `other_shelf_name`. Returns the updated shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Shelf MergeShelves( + MergeShelvesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + ShelfName name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( + new CreateBookRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + ShelfName name, + Book book, + st::CancellationToken cancellationToken) => CreateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book CreateBook( + ShelfName name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBook( + new CreateBookRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + st::CancellationToken cancellationToken) => CreateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book CreateBook( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBook( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + string name, + Book book, + st::CancellationToken cancellationToken) => CreateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a book. + /// + /// + /// The name of the shelf in which the book is created. + /// + /// + /// The book to create. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book CreateBook( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => CreateBook( + new CreateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Creates a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + CreateBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Creates a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task CreateBookAsync( + CreateBookRequest request, + st::CancellationToken cancellationToken) => CreateBookAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book CreateBook( + CreateBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + PublisherName publisher, + gaxgrpc::CallSettings callSettings = null) => PublishSeriesAsync( + new PublishSeriesRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, + Edition = edition ?? 0, // Optional + SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), + PublisherAsPublisherName = publisher, // Optional + }, + callSettings); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + PublisherName publisher, + st::CancellationToken cancellationToken) => PublishSeriesAsync( + shelf, + books, + edition, + seriesUuid, + publisher, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual PublishSeriesResponse PublishSeries( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + PublisherName publisher, + gaxgrpc::CallSettings callSettings = null) => PublishSeries( + new PublishSeriesRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, + Edition = edition ?? 0, // Optional + SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), + PublisherAsPublisherName = publisher, // Optional + }, + callSettings); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + string publisher, + gaxgrpc::CallSettings callSettings = null) => PublishSeriesAsync( + new PublishSeriesRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, + Edition = edition ?? 0, // Optional + SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), + Publisher = publisher ?? "", // Optional + }, + callSettings); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + string publisher, + st::CancellationToken cancellationToken) => PublishSeriesAsync( + shelf, + books, + edition, + seriesUuid, + publisher, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual PublishSeriesResponse PublishSeries( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + string publisher, + gaxgrpc::CallSettings callSettings = null) => PublishSeries( + new PublishSeriesRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, + Edition = edition ?? 0, // Optional + SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), + Publisher = publisher ?? "", // Optional + }, + callSettings); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + string publisher, + gaxgrpc::CallSettings callSettings = null) => PublishSeriesAsync( + new PublishSeriesRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, + Edition = edition ?? 0, // Optional + SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), + Publisher = publisher ?? "", // Optional + }, + callSettings); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + string publisher, + st::CancellationToken cancellationToken) => PublishSeriesAsync( + shelf, + books, + edition, + seriesUuid, + publisher, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a series of books. + /// + /// + /// The shelf in which the series is created. + /// + /// + /// The books to publish in the series. + /// + /// + /// The edition of the series + /// + /// + /// Uniquely identifies the series to the publishing house. + /// + /// + /// The publisher of the series. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual PublishSeriesResponse PublishSeries( + Shelf shelf, + scg::IEnumerable books, + uint? edition, + SeriesUuid seriesUuid, + string publisher, + gaxgrpc::CallSettings callSettings = null) => PublishSeries( + new PublishSeriesRequest + { + Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, + Edition = edition ?? 0, // Optional + SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), + Publisher = publisher ?? "", // Optional + }, + callSettings); + + /// + /// Creates a series of books. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + PublishSeriesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Creates a series of books. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task PublishSeriesAsync( + PublishSeriesRequest request, + st::CancellationToken cancellationToken) => PublishSeriesAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates a series of books. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual PublishSeriesResponse PublishSeries( + PublishSeriesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBookAsync( + new GetBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + BookNameOneof name, + st::CancellationToken cancellationToken) => GetBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book GetBook( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBook( + new GetBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book GetBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book GetBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Gets a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookAsync( + GetBookRequest request, + st::CancellationToken cancellationToken) => GetBookAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book GetBook( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListBooksAsync( + ShelfName name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( + new ListBooksRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListBooks( + ShelfName name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooks( + new ListBooksRequest + { + ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListBooksAsync( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListBooks( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooks( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListBooksAsync( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// To test python built-in wrapping. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListBooks( + string name, + string filter, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListBooks( + new ListBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Filter = filter ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists books in a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListBooksAsync( + ListBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Lists books in a shelf. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListBooks( + ListBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( + new DeleteBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + BookNameOneof name, + st::CancellationToken cancellationToken) => DeleteBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteBook( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => DeleteBook( + new DeleteBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + st::CancellationToken cancellationToken) => DeleteBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteBook( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBook( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + string name, + st::CancellationToken cancellationToken) => DeleteBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a book. + /// + /// + /// The name of the book to delete. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteBook( + string name, + gaxgrpc::CallSettings callSettings = null) => DeleteBook( + new DeleteBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Deletes a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + DeleteBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Deletes a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task DeleteBookAsync( + DeleteBookRequest request, + st::CancellationToken cancellationToken) => DeleteBookAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void DeleteBook( + DeleteBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + BookNameOneof name, + Book book, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + BookNameOneof name, + Book book, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + BookNameOneof name, + Book book, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + Book book, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + Book book, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + book, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The book to update with. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + string name, + Book book, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + BookNameOneof name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + BookNameOneof name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + optionalFoo, + book, + updateMask, + physicalMask, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + BookNameOneof name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + optionalFoo, + book, + updateMask, + physicalMask, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + st::CancellationToken cancellationToken) => UpdateBookAsync( + name, + optionalFoo, + book, + updateMask, + physicalMask, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The name of the book to update. + /// + /// + /// An optional foo. + /// + /// + /// The book to update with. + /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + string name, + string optionalFoo, + Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, + gaxgrpc::CallSettings callSettings = null) => UpdateBook( + new UpdateBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional + Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional + }, + callSettings); + + /// + /// Updates a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + UpdateBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Updates a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task UpdateBookAsync( + UpdateBookRequest request, + st::CancellationToken cancellationToken) => UpdateBookAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book UpdateBook( + UpdateBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + BookNameOneof name, + ShelfName otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( + new MoveBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + BookNameOneof name, + ShelfName otherShelfName, + st::CancellationToken cancellationToken) => MoveBookAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book MoveBook( + BookNameOneof name, + ShelfName otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBook( + new MoveBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MoveBookAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book MoveBook( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBook( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + string name, + string otherShelfName, + st::CancellationToken cancellationToken) => MoveBookAsync( + name, + otherShelfName, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The name of the book to move. + /// + /// + /// The name of the destination shelf. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book MoveBook( + string name, + string otherShelfName, + gaxgrpc::CallSettings callSettings = null) => MoveBook( + new MoveBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), + }, + callSettings); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + MoveBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBookAsync( + MoveBookRequest request, + st::CancellationToken cancellationToken) => MoveBookAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Moves a book to another shelf, and returns the new book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual Book MoveBook( + MoveBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListStringsAsync( + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( + new ListStringsRequest + { + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListStrings( + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStrings( + new ListStringsRequest + { + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListStringsAsync( + IResourceName name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( + new ListStringsRequest + { + AsResourceName = name, // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListStrings( + IResourceName name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStrings( + new ListStringsRequest + { + AsResourceName = name, // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListStringsAsync( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListStrings( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStrings( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListStringsAsync( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListStrings( + string name, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => ListStrings( + new ListStringsRequest + { + Name = name ?? "", // Optional + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable ListStringsAsync( + ListStringsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Lists a primitive resource. To test go page streaming. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable ListStrings( + ListStringsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + BookNameOneof name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( + new AddCommentsRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + BookNameOneof name, + scg::IEnumerable comments, + st::CancellationToken cancellationToken) => AddCommentsAsync( + name, + comments, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void AddComments( + BookNameOneof name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddComments( + new AddCommentsRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + st::CancellationToken cancellationToken) => AddCommentsAsync( + name, + comments, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void AddComments( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddComments( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + string name, + scg::IEnumerable comments, + st::CancellationToken cancellationToken) => AddCommentsAsync( + name, + comments, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds comments to a book + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void AddComments( + string name, + scg::IEnumerable comments, + gaxgrpc::CallSettings callSettings = null) => AddComments( + new AddCommentsRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, + }, + callSettings); + + /// + /// Adds comments to a book + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + AddCommentsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Adds comments to a book + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task AddCommentsAsync( + AddCommentsRequest request, + st::CancellationToken cancellationToken) => AddCommentsAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds comments to a book + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void AddComments( + AddCommentsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + ArchivedBookName name, + ProjectName parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( + new GetBookFromArchiveRequest + { + ArchivedBookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + ParentAsProjectName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + ArchivedBookName name, + ProjectName parent, + st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( + name, + parent, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromArchive GetBookFromArchive( + ArchivedBookName name, + ProjectName parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( + new GetBookFromArchiveRequest + { + ArchivedBookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + ParentAsProjectName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + string name, + string parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + string name, + string parent, + st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( + name, + parent, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromArchive GetBookFromArchive( + string name, + string parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + string name, + string parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + string name, + string parent, + st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( + name, + parent, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from an archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromArchive GetBookFromArchive( + string name, + string parent, + gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( + new GetBookFromArchiveRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + }, + callSettings); + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromArchiveAsync( + GetBookFromArchiveRequest request, + st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from an archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromArchive GetBookFromArchive( + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + BookNameOneof name, + BookNameOneof altBookName, + LocationName place, + FolderName folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( + new GetBookFromAnywhereRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + AltBookNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(altBookName, nameof(altBookName)), + PlaceAsLocationName = gax::GaxPreconditions.CheckNotNull(place, nameof(place)), + FolderAsFolderName = gax::GaxPreconditions.CheckNotNull(folder, nameof(folder)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + BookNameOneof name, + BookNameOneof altBookName, + LocationName place, + FolderName folder, + st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( + name, + altBookName, + place, + folder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAnywhere( + BookNameOneof name, + BookNameOneof altBookName, + LocationName place, + FolderName folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( + new GetBookFromAnywhereRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + AltBookNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(altBookName, nameof(altBookName)), + PlaceAsLocationName = gax::GaxPreconditions.CheckNotNull(place, nameof(place)), + FolderAsFolderName = gax::GaxPreconditions.CheckNotNull(folder, nameof(folder)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + string place, + string folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), + Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + string place, + string folder, + st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( + name, + altBookName, + place, + folder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAnywhere( + string name, + string altBookName, + string place, + string folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), + Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + string place, + string folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), + Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + string name, + string altBookName, + string place, + string folder, + st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( + name, + altBookName, + place, + folder, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAnywhere( + string name, + string altBookName, + string place, + string folder, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( + new GetBookFromAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), + Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), + Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), + }, + callSettings); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + GetBookFromAnywhereRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAnywhereAsync( + GetBookFromAnywhereRequest request, + st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Gets a book from a shelf or archive. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAnywhere( + GetBookFromAnywhereRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( + new GetBookFromAbsolutelyAnywhereRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + BookNameOneof name, + st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( + new GetBookFromAbsolutelyAnywhereRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + string name, + st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( + new GetBookFromAbsolutelyAnywhereRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + GetBookFromAbsolutelyAnywhereRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( + GetBookFromAbsolutelyAnywhereRequest request, + st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test proper OneOf-Any resource name mapping + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( + GetBookFromAbsolutelyAnywhereRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + BookNameOneof name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( + new UpdateBookIndexRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + BookNameOneof name, + string indexName, + scg::IDictionary indexMap, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + name, + indexName, + indexMap, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + BookNameOneof name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( + new UpdateBookIndexRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + name, + indexName, + indexMap, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + string name, + string indexName, + scg::IDictionary indexMap, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + name, + indexName, + indexMap, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The name of the book to update. + /// + /// + /// The name of the index for the book + /// + /// + /// The index to update the book with + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + string name, + string indexName, + scg::IDictionary indexMap, + gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( + new UpdateBookIndexRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), + IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, + }, + callSettings); + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task that completes when the RPC has completed. + /// + public virtual stt::Task UpdateBookIndexAsync( + UpdateBookIndexRequest request, + st::CancellationToken cancellationToken) => UpdateBookIndexAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Updates the index of a book. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + public virtual void UpdateBookIndex( + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test server streaming + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamShelvesStream StreamShelves( + StreamShelvesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Server streaming methods for StreamShelves. + /// + public abstract partial class StreamShelvesStream : gaxgrpc::ServerStreamingBase + { + } + + /// + /// Test server streaming, non-paged responses. + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The name of the shelf whose books we'd like to list. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamBooksStream StreamBooks( + string name, + gaxgrpc::CallSettings callSettings = null) => StreamBooks( + new StreamBooksRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test server streaming, non-paged responses. + /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The server stream. + /// + public virtual StreamBooksStream StreamBooks( + StreamBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Server streaming methods for StreamBooks. + /// + public abstract partial class StreamBooksStream : gaxgrpc::ServerStreamingBase + { + } + + /// + /// Test bidi-streaming. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// Test bidi-streaming. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// Test bidi-streaming. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// Test bidi-streaming. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// If not null, applies streaming overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + public virtual DiscussBookStream DiscussBook( + gaxgrpc::CallSettings callSettings = null, + gaxgrpc::BidirectionalStreamingSettings streamingSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Bidirectional streaming methods for DiscussBook. + /// + public abstract partial class DiscussBookStream : gaxgrpc::BidirectionalStreamingBase + { + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + FindRelatedBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + FindRelatedBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Adds a label to the entity. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task AddLabelAsync( + gtv::AddLabelRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Adds a label to the entity. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task AddLabelAsync( + gtv::AddLabelRequest request, + st::CancellationToken cancellationToken) => AddLabelAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Adds a label to the entity. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual gtv::AddLabelResponse AddLabel( + gtv::AddLabelRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( + new GetBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + BookNameOneof name, + st::CancellationToken cancellationToken) => GetBigBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBigBook( + new GetBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBigBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + string name, + st::CancellationToken cancellationToken) => GetBigBookAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigBook( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations /// - /// - /// The default LibraryServiceClient.ArchiveBooks and - /// LibraryServiceClient.ArchiveBooksAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings ArchiveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigBookAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.LongRunningArchiveBooks and LibraryServiceClient.LongRunningArchiveBooksAsync. + /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigBookAsync. /// - /// - /// The default LibraryServiceClient.LongRunningArchiveBooks and - /// LibraryServiceClient.LongRunningArchiveBooksAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings LongRunningArchiveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: NonIdempotentRetryFilter - ))); + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceGetBigBookAsync( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigBookOperationsClient, + callSettings); /// - /// Long Running Operation settings for calls to LibraryServiceClient.LongRunningArchiveBooks. + /// Test long-running operations /// - /// - /// Uses default of: - /// - /// Initial delay: 500 milliseconds - /// Delay multiplier: 1.5 - /// Maximum delay: 5000 milliseconds - /// Total timeout: 300000 milliseconds - /// - /// - public lro::OperationsSettings LongRunningArchiveBooksOperationsSettings { get; set; } = new lro::OperationsSettings + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigBook( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) { - DefaultPollSettings = new gax::PollSettings( - gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(300000L)), - sys::TimeSpan.FromMilliseconds(500L), - 1.5, - sys::TimeSpan.FromMilliseconds(5000L)) - }; + throw new sys::NotImplementedException(); + } /// - /// for calls to LibraryServiceClient.StreamingArchiveBooks. + /// The long-running operations client for GetBigBook. /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings StreamingArchiveBooksSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromTimeout(sys::TimeSpan.FromMilliseconds(30000))); + public virtual lro::OperationsClient GetBigBookOperationsClient + { + get { throw new sys::NotImplementedException(); } + } /// - /// for calls to - /// LibraryServiceClient.StreamingArchiveBooks. + /// Poll an operation once, using an operationName from a previous invocation of GetBigBook. /// - /// - /// The default local send queue size is 100. - /// - public gaxgrpc::BidirectionalStreamingSettings StreamingArchiveBooksStreamingSettings { get; set; } = - new gaxgrpc::BidirectionalStreamingSettings(100); + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceGetBigBook( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigBookOperationsClient, + callSettings); /// - /// for synchronous and asynchronous calls to - /// LibraryServiceClient.PrivateListShelves and LibraryServiceClient.PrivateListShelvesAsync. + /// Test long-running operations with empty return type. /// - /// - /// The default LibraryServiceClient.PrivateListShelves and - /// LibraryServiceClient.PrivateListShelvesAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.2 - /// Retry maximum delay: 1000 milliseconds - /// Initial timeout: 300 milliseconds - /// Timeout multiplier: 1.3 - /// Timeout maximum delay: 3000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 30000 milliseconds. - /// - public gaxgrpc::CallSettings PrivateListShelvesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(30000)), - retryFilter: IdempotentRetryFilter - ))); + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + BookNameOneof name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + BookNameOneof name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); /// - /// Creates a deep clone of this object, with all the same property values. + /// Test long-running operations with empty return type. /// - /// A deep clone of this object. - public LibraryServiceSettings Clone() => new LibraryServiceSettings(this); - } + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - /// - /// Builder class for to provide simple configuration of credentials, endpoint etc. - /// - public sealed partial class LibraryServiceClientBuilder : gaxgrpc::ClientBuilderBase - { /// - /// The settings to use for RPCs, or null for the default settings. + /// Test long-running operations with empty return type. /// - public LibraryServiceSettings Settings { get; set; } - - /// - public override LibraryServiceClient Build() - { - Validate(); - grpccore::CallInvoker callInvoker = CreateCallInvoker(); - return LibraryServiceClient.Create(callInvoker, Settings); - } - - /// - public override async stt::Task BuildAsync(st::CancellationToken cancellationToken = default) - { - Validate(); - grpccore::CallInvoker callInvoker = await CreateCallInvokerAsync(cancellationToken).ConfigureAwait(false); - return LibraryServiceClient.Create(callInvoker, Settings); - } - - /// - protected override gaxgrpc::ServiceEndpoint GetDefaultEndpoint() => LibraryServiceClient.DefaultEndpoint; - - /// - protected override scg::IReadOnlyList GetDefaultScopes() => LibraryServiceClient.DefaultScopes; - - /// - protected override gaxgrpc::ChannelPool GetChannelPool() => LibraryServiceClient.ChannelPool; - } + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); - /// - /// LibraryService client wrapper, for convenient use. - /// - public abstract partial class LibraryServiceClient - { /// - /// The default endpoint for the LibraryService service, which is a host of "library-example.googleapis.com" and a port of 1234. + /// Test long-running operations with empty return type. /// - public static gaxgrpc::ServiceEndpoint DefaultEndpoint { get; } = new gaxgrpc::ServiceEndpoint("library-example.googleapis.com", 1234); + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); /// - /// The default LibraryService scopes. + /// Test long-running operations with empty return type. /// - /// - /// The default LibraryService scopes are: - /// - /// "https://www.googleapis.com/auth/cloud-platform" - /// "https://www.googleapis.com/auth/library" - /// - /// - public static scg::IReadOnlyList DefaultScopes { get; } = new sco::ReadOnlyCollection(new string[] { - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/library", - }); - - private static readonly gaxgrpc::ChannelPool s_channelPool = new gaxgrpc::ChannelPool(DefaultScopes); + /// + /// The name of the book to retrieve. + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + string name, + st::CancellationToken cancellationToken) => GetBigNothingAsync( + name, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - internal static gaxgrpc::ChannelPool ChannelPool => s_channelPool; + /// + /// Test long-running operations with empty return type. + /// + /// + /// The name of the book to retrieve. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + string name, + gaxgrpc::CallSettings callSettings = null) => GetBigNothing( + new GetBookRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, + callSettings); /// - /// Asynchronously creates a , applying defaults for all unspecified settings, - /// and creating a channel connecting to the given endpoint with application default credentials where - /// necessary. See the example for how to use custom credentials. + /// Test long-running operations with empty return type. /// - /// - /// This sample shows how to create a client using default credentials: - /// - /// using Google.Example.Library.V1; - /// ... - /// // When running on Google Cloud Platform this will use the project Compute Credential. - /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON - /// // credential file to use that credential. - /// LibraryServiceClient client = await LibraryServiceClient.CreateAsync(); - /// - /// This sample shows how to create a client using credentials loaded from a JSON file: - /// - /// using Google.Example.Library.V1; - /// using Google.Apis.Auth.OAuth2; - /// using Grpc.Auth; - /// using Grpc.Core; - /// ... - /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); - /// Channel channel = new Channel( - /// LibraryServiceClient.DefaultEndpoint.Host, LibraryServiceClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); - /// LibraryServiceClient client = LibraryServiceClient.Create(channel); - /// ... - /// // Shutdown the channel when it is no longer required. - /// await channel.ShutdownAsync(); - /// - /// - /// Optional . - /// Optional . - /// The task representing the created . - public static async stt::Task CreateAsync(gaxgrpc::ServiceEndpoint endpoint = null, LibraryServiceSettings settings = null) + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> GetBigNothingAsync( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) { - grpccore::Channel channel = await s_channelPool.GetChannelAsync(endpoint ?? DefaultEndpoint).ConfigureAwait(false); - return Create(channel, settings); + throw new sys::NotImplementedException(); } /// - /// Synchronously creates a , applying defaults for all unspecified settings, - /// and creating a channel connecting to the given endpoint with application default credentials where - /// necessary. See the example for how to use custom credentials. + /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigNothingAsync. /// - /// - /// This sample shows how to create a client using default credentials: - /// - /// using Google.Example.Library.V1; - /// ... - /// // When running on Google Cloud Platform this will use the project Compute Credential. - /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON - /// // credential file to use that credential. - /// LibraryServiceClient client = LibraryServiceClient.Create(); - /// - /// This sample shows how to create a client using credentials loaded from a JSON file: - /// - /// using Google.Example.Library.V1; - /// using Google.Apis.Auth.OAuth2; - /// using Grpc.Auth; - /// using Grpc.Core; - /// ... - /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); - /// Channel channel = new Channel( - /// LibraryServiceClient.DefaultEndpoint.Host, LibraryServiceClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); - /// LibraryServiceClient client = LibraryServiceClient.Create(channel); - /// ... - /// // Shutdown the channel when it is no longer required. - /// channel.ShutdownAsync().Wait(); - /// - /// - /// Optional . - /// Optional . - /// The created . - public static LibraryServiceClient Create(gaxgrpc::ServiceEndpoint endpoint = null, LibraryServiceSettings settings = null) + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceGetBigNothingAsync( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigNothingOperationsClient, + callSettings); + + /// + /// Test long-running operations with empty return type. + /// + /// + /// The request object containing all of the parameters for the API call. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) { - grpccore::Channel channel = s_channelPool.GetChannel(endpoint ?? DefaultEndpoint); - return Create(channel, settings); + throw new sys::NotImplementedException(); } /// - /// Creates a which uses the specified channel for remote operations. + /// The long-running operations client for GetBigNothing. /// - /// The for remote operations. Must not be null. - /// Optional . - /// The created . - public static LibraryServiceClient Create(grpccore::Channel channel, LibraryServiceSettings settings = null) + public virtual lro::OperationsClient GetBigNothingOperationsClient { - gax::GaxPreconditions.CheckNotNull(channel, nameof(channel)); - return Create(new grpccore::DefaultCallInvoker(channel), settings); + get { throw new sys::NotImplementedException(); } } /// - /// Creates a which uses the specified call invoker for remote operations. + /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. /// - /// The for remote operations. Must not be null. - /// Optional . - /// The created . - public static LibraryServiceClient Create(grpccore::CallInvoker callInvoker, LibraryServiceSettings settings = null) - { - gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); - grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor; - if (interceptor != null) - { - callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor); - } - LibraryService.LibraryServiceClient grpcClient = new LibraryService.LibraryServiceClient(callInvoker); - return new LibraryServiceClientImpl(grpcClient, settings); - } + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceGetBigNothing( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigNothingOperationsClient, + callSettings); /// - /// Shuts down any channels automatically created by - /// and . Channels which weren't automatically - /// created are not affected. + /// Test optional flattening parameters of all types /// - /// After calling this method, further calls to - /// and will create new channels, which could - /// in turn be shut down by another call to this method. - /// A task representing the asynchronous shutdown operation. - public static stt::Task ShutdownDefaultChannelsAsync() => s_channelPool.ShutdownChannelsAsync(); + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest + { + }, + callSettings); /// - /// The underlying gRPC LibraryService client. + /// Test optional flattening parameters of all types /// - public virtual LibraryService.LibraryServiceClient GrpcClient - { - get { throw new sys::NotImplementedException(); } - } + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// - /// Creates a shelf, and returns the new Shelf. - /// RPC method comment may include special characters: <>&"`'@. + /// Test optional flattening parameters of all types /// - /// - /// The shelf to create. + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( + new TestOptionalRequiredFlatteningParamsRequest + { + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -12456,4883 +23234,3124 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task CreateShelfAsync( - Shelf shelf, - gaxgrpc::CallSettings callSettings = null) => CreateShelfAsync( - new CreateShelfRequest + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookNameOneof requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookNameOneof optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), + RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), + RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), + RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), + RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), + RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), + RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), + RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), + RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), + RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), + RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), + RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), + RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), + RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), + RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), + RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), + RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, + RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, + RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, + RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, + RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, + RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, + RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, + RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, + RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, + RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, + RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, + RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, + RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, + RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, + RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, + RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceNameAsBookNameOneof = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); /// - /// Creates a shelf, and returns the new Shelf. - /// RPC method comment may include special characters: <>&"`'@. + /// Test optional flattening parameters of all types /// - /// - /// The shelf to create. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateShelfAsync( - Shelf shelf, - st::CancellationToken cancellationToken) => CreateShelfAsync( - shelf, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a shelf, and returns the new Shelf. - /// RPC method comment may include special characters: <>&"`'@. - /// - /// - /// The shelf to create. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf CreateShelf( - Shelf shelf, - gaxgrpc::CallSettings callSettings = null) => CreateShelf( - new CreateShelfRequest - { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), - }, - callSettings); - - /// - /// Creates a shelf, and returns the new Shelf. - /// RPC method comment may include special characters: <>&"`'@. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateShelfAsync( - CreateShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Creates a shelf, and returns the new Shelf. - /// RPC method comment may include special characters: <>&"`'@. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateShelfAsync( - CreateShelfRequest request, - st::CancellationToken cancellationToken) => CreateShelfAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a shelf, and returns the new Shelf. - /// RPC method comment may include special characters: <>&"`'@. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf CreateShelf( - CreateShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - ShelfName name, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - ShelfName name, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - ShelfName name, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - ShelfName name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - ShelfName name, - SomeMessage message, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// + /// + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - ShelfName name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - ShelfName name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - ShelfName name, - SomeMessage message, - StringBuilder stringBuilder, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - stringBuilder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - ShelfName name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - stringBuilder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. + /// + /// /// - /// - /// Field to verify that message-type query parameter gets flattened. + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - GetShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - GetShelfRequest request, - st::CancellationToken cancellationToken) => GetShelfAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - GetShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists shelves. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListShelvesAsync( - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListShelvesAsync( - new ListShelvesRequest - { - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists shelves. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListShelves( - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListShelves( - new ListShelvesRequest - { - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists shelves. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListShelvesAsync( - ListShelvesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists shelves. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListShelves( - ListShelvesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a shelf. - /// - /// - /// The name of the shelf to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - ShelfName name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( - new DeleteShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a shelf. - /// - /// - /// The name of the shelf to delete. + /// + /// + /// + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - ShelfName name, - st::CancellationToken cancellationToken) => DeleteShelfAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a shelf. - /// - /// - /// The name of the shelf to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void DeleteShelf( - ShelfName name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelf( - new DeleteShelfRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a shelf. - /// - /// - /// The name of the shelf to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a shelf. - /// - /// - /// The name of the shelf to delete. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - string name, - st::CancellationToken cancellationToken) => DeleteShelfAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a shelf. - /// - /// - /// The name of the shelf to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void DeleteShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelf( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - st::CancellationToken cancellationToken) => DeleteShelfAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void DeleteShelf( - DeleteShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. + /// + /// /// - /// - /// The name of the shelf we're removing books from and deleting. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - ShelfName name, - ShelfName otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( - new MergeShelvesRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. + /// + /// /// - /// - /// The name of the shelf we're removing books from and deleting. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - ShelfName name, - ShelfName otherShelfName, - st::CancellationToken cancellationToken) => MergeShelvesAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. + /// + /// /// - /// - /// The name of the shelf we're removing books from and deleting. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf MergeShelves( - ShelfName name, - ShelfName otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelves( - new MergeShelvesRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. + /// + /// + /// + /// + /// /// - /// - /// The name of the shelf we're removing books from and deleting. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. /// /// /// A Task containing the RPC response. /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookNameOneof requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookNameOneof optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + requiredSingularInt32, + requiredSingularInt64, + requiredSingularFloat, + requiredSingularDouble, + requiredSingularBool, + requiredSingularEnum, + requiredSingularString, + requiredSingularBytes, + requiredSingularMessage, + requiredSingularResourceName, + requiredSingularResourceNameOneof, + requiredSingularResourceNameCommon, + requiredSingularFixed32, + requiredSingularFixed64, + requiredRepeatedInt32, + requiredRepeatedInt64, + requiredRepeatedFloat, + requiredRepeatedDouble, + requiredRepeatedBool, + requiredRepeatedEnum, + requiredRepeatedString, + requiredRepeatedBytes, + requiredRepeatedMessage, + requiredRepeatedResourceName, + requiredRepeatedResourceNameOneof, + requiredRepeatedResourceNameCommon, + requiredRepeatedFixed32, + requiredRepeatedFixed64, + requiredMap, + requiredAnyValue, + requiredStructValue, + requiredValueValue, + requiredListValueValue, + requiredTimeValue, + requiredDurationValue, + requiredFieldMaskValue, + requiredInt32Value, + requiredUint32Value, + requiredInt64Value, + requiredUint64Value, + requiredFloatValue, + requiredDoubleValue, + requiredStringValue, + requiredBoolValue, + requiredBytesValue, + requiredRepeatedAnyValue, + requiredRepeatedStructValue, + requiredRepeatedValueValue, + requiredRepeatedListValueValue, + requiredRepeatedTimeValue, + requiredRepeatedDurationValue, + requiredRepeatedFieldMaskValue, + requiredRepeatedInt32Value, + requiredRepeatedUint32Value, + requiredRepeatedInt64Value, + requiredRepeatedUint64Value, + requiredRepeatedFloatValue, + requiredRepeatedDoubleValue, + requiredRepeatedStringValue, + requiredRepeatedBoolValue, + requiredRepeatedBytesValue, + optionalSingularInt32, + optionalSingularInt64, + optionalSingularFloat, + optionalSingularDouble, + optionalSingularBool, + optionalSingularEnum, + optionalSingularString, + optionalSingularBytes, + optionalSingularMessage, + optionalSingularResourceName, + optionalSingularResourceNameOneof, + optionalSingularResourceNameCommon, + optionalSingularFixed32, + optionalSingularFixed64, + optionalRepeatedInt32, + optionalRepeatedInt64, + optionalRepeatedFloat, + optionalRepeatedDouble, + optionalRepeatedBool, + optionalRepeatedEnum, + optionalRepeatedString, + optionalRepeatedBytes, + optionalRepeatedMessage, + optionalRepeatedResourceName, + optionalRepeatedResourceNameOneof, + optionalRepeatedResourceNameCommon, + optionalRepeatedFixed32, + optionalRepeatedFixed64, + optionalMap, + anyValue, + structValue, + valueValue, + listValueValue, + timeValue, + durationValue, + fieldMaskValue, + int32Value, + uint32Value, + int64Value, + uint64Value, + floatValue, + doubleValue, + stringValue, + boolValue, + bytesValue, + repeatedAnyValue, + repeatedStructValue, + repeatedValueValue, + repeatedListValueValue, + repeatedTimeValue, + repeatedDurationValue, + repeatedFieldMaskValue, + repeatedInt32Value, + repeatedUint32Value, + repeatedInt64Value, + repeatedUint64Value, + repeatedFloatValue, + repeatedDoubleValue, + repeatedStringValue, + repeatedBoolValue, + repeatedBytesValue, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. + /// Test optional flattening parameters of all types /// - /// - /// The name of the shelf we're adding books to. + /// + /// /// - /// - /// The name of the shelf we're removing books from and deleting. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MergeShelvesAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. + /// + /// /// - /// - /// The name of the shelf we're removing books from and deleting. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf MergeShelves( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelves( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - MergeShelvesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - MergeShelvesRequest request, - st::CancellationToken cancellationToken) => MergeShelvesAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Shelf MergeShelves( - MergeShelvesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. + /// + /// /// - /// - /// The book to create. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - ShelfName name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( - new CreateBookRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. + /// + /// /// - /// - /// The book to create. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - ShelfName name, - Book book, - st::CancellationToken cancellationToken) => CreateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. + /// + /// /// - /// - /// The book to create. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book CreateBook( - ShelfName name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBook( - new CreateBookRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// The book to create. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. + /// + /// /// - /// - /// The book to create. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - st::CancellationToken cancellationToken) => CreateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. + /// + /// /// - /// - /// The book to create. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book CreateBook( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBook( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Creates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - CreateBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Creates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - CreateBookRequest request, - st::CancellationToken cancellationToken) => CreateBookAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book CreateBook( - CreateBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Creates a series of books. - /// - /// - /// The shelf in which the series is created. + /// + /// /// - /// - /// The books to publish in the series. + /// + /// /// - /// - /// The edition of the series + /// + /// /// - /// - /// Uniquely identifies the series to the publishing house. + /// + /// /// - /// - /// The publisher of the series. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - PublisherName publisher, - gaxgrpc::CallSettings callSettings = null) => PublishSeriesAsync( - new PublishSeriesRequest - { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), - Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, - Edition = edition ?? 0, // Optional - SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), - PublisherAsPublisherName = publisher, // Optional - }, - callSettings); - - /// - /// Creates a series of books. - /// - /// - /// The shelf in which the series is created. + /// + /// /// - /// - /// The books to publish in the series. + /// + /// /// - /// - /// The edition of the series + /// + /// /// - /// - /// Uniquely identifies the series to the publishing house. + /// + /// /// - /// - /// The publisher of the series. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - PublisherName publisher, - st::CancellationToken cancellationToken) => PublishSeriesAsync( - shelf, - books, - edition, - seriesUuid, - publisher, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a series of books. - /// - /// - /// The shelf in which the series is created. + /// + /// /// - /// - /// The books to publish in the series. + /// + /// /// - /// - /// The edition of the series + /// + /// /// - /// - /// Uniquely identifies the series to the publishing house. + /// + /// /// - /// - /// The publisher of the series. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual PublishSeriesResponse PublishSeries( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - PublisherName publisher, - gaxgrpc::CallSettings callSettings = null) => PublishSeries( - new PublishSeriesRequest - { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), - Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, - Edition = edition ?? 0, // Optional - SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), - PublisherAsPublisherName = publisher, // Optional - }, - callSettings); - - /// - /// Creates a series of books. - /// - /// - /// The shelf in which the series is created. + /// + /// /// - /// - /// The books to publish in the series. + /// + /// /// - /// - /// The edition of the series + /// + /// /// - /// - /// Uniquely identifies the series to the publishing house. + /// + /// /// - /// - /// The publisher of the series. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - string publisher, - gaxgrpc::CallSettings callSettings = null) => PublishSeriesAsync( - new PublishSeriesRequest - { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), - Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, - Edition = edition ?? 0, // Optional - SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), - Publisher = publisher ?? "", // Optional - }, - callSettings); - - /// - /// Creates a series of books. - /// - /// - /// The shelf in which the series is created. + /// + /// /// - /// - /// The books to publish in the series. + /// + /// /// - /// - /// The edition of the series + /// + /// /// - /// - /// Uniquely identifies the series to the publishing house. + /// + /// /// - /// - /// The publisher of the series. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - string publisher, - st::CancellationToken cancellationToken) => PublishSeriesAsync( - shelf, - books, - edition, - seriesUuid, - publisher, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a series of books. - /// - /// - /// The shelf in which the series is created. + /// + /// /// - /// - /// The books to publish in the series. + /// + /// /// - /// - /// The edition of the series + /// + /// /// - /// - /// Uniquely identifies the series to the publishing house. + /// + /// /// - /// - /// The publisher of the series. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual PublishSeriesResponse PublishSeries( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - string publisher, - gaxgrpc::CallSettings callSettings = null) => PublishSeries( - new PublishSeriesRequest - { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), - Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, - Edition = edition ?? 0, // Optional - SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), - Publisher = publisher ?? "", // Optional - }, - callSettings); - - /// - /// Creates a series of books. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - PublishSeriesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Creates a series of books. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - PublishSeriesRequest request, - st::CancellationToken cancellationToken) => PublishSeriesAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a series of books. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual PublishSeriesResponse PublishSeries( - PublishSeriesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBookAsync( - new GetBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - BookNameOneof name, - st::CancellationToken cancellationToken) => GetBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book GetBook( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBook( - new GetBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - string name, - st::CancellationToken cancellationToken) => GetBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book GetBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - GetBookRequest request, - st::CancellationToken cancellationToken) => GetBookAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book GetBook( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// /// - /// - /// To test python built-in wrapping. + /// + /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListBooksAsync( - ShelfName name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( - new ListBooksRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// /// - /// - /// To test python built-in wrapping. + /// + /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListBooks( - ShelfName name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooks( - new ListBooksRequest - { - ShelfName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// + /// + /// + /// /// - /// - /// To test python built-in wrapping. + /// + /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. /// /// - /// A pageable asynchronous sequence of resources. + /// The RPC response. /// - public virtual gax::PagedAsyncEnumerable ListBooksAsync( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( - new ListBooksRequest + public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + BookNameOneof requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + BookNameOneof optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( + new TestOptionalRequiredFlatteningParamsRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), + RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), + RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), + RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), + RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), + RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), + RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), + RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), + RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), + RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), + RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), + RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), + RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), + RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), + RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), + RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), + RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, + RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, + RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, + RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, + RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, + RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, + RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, + RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, + RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, + RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, + RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, + RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, + RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, + RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, + RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, + RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceNameAsBookNameOneof = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); /// - /// Lists books in a shelf. + /// Test optional flattening parameters of all types /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// /// - /// - /// To test python built-in wrapping. + /// + /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListBooks( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooks( - new ListBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists books in a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListBooksAsync( - ListBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists books in a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListBooks( - ListBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( - new DeleteBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - BookNameOneof name, - st::CancellationToken cancellationToken) => DeleteBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void DeleteBook( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => DeleteBook( - new DeleteBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - string name, - st::CancellationToken cancellationToken) => DeleteBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void DeleteBook( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBook( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - DeleteBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - DeleteBookRequest request, - st::CancellationToken cancellationToken) => DeleteBookAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void DeleteBook( - DeleteBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - BookNameOneof name, - Book book, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - BookNameOneof name, - Book book, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - BookNameOneof name, - Book book, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - Book book, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// An optional foo. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A field mask to apply, rendered as an HTTP parameter. + /// + /// /// - /// - /// To test Python import clash resolution. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - BookNameOneof name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// An optional foo. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A field mask to apply, rendered as an HTTP parameter. + /// + /// /// - /// - /// To test Python import clash resolution. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - BookNameOneof name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - optionalFoo, - book, - updateMask, - physicalMask, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// An optional foo. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A field mask to apply, rendered as an HTTP parameter. + /// + /// /// - /// - /// To test Python import clash resolution. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - BookNameOneof name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// An optional foo. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A field mask to apply, rendered as an HTTP parameter. + /// + /// /// - /// - /// To test Python import clash resolution. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// An optional foo. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A field mask to apply, rendered as an HTTP parameter. + /// + /// /// - /// - /// To test Python import clash resolution. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - optionalFoo, - book, - updateMask, - physicalMask, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// An optional foo. + /// + /// /// - /// - /// The book to update with. + /// + /// /// - /// - /// A field mask to apply, rendered as an HTTP parameter. + /// + /// /// - /// - /// To test Python import clash resolution. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - UpdateBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - UpdateBookRequest request, - st::CancellationToken cancellationToken) => UpdateBookAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - UpdateBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. + /// + /// /// - /// - /// The name of the destination shelf. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - BookNameOneof name, - ShelfName otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( - new MoveBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. + /// + /// /// - /// - /// The name of the destination shelf. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - BookNameOneof name, - ShelfName otherShelfName, - st::CancellationToken cancellationToken) => MoveBookAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. + /// + /// /// - /// - /// The name of the destination shelf. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book MoveBook( - BookNameOneof name, - ShelfName otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBook( - new MoveBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - OtherShelfNameAsShelfName = gax::GaxPreconditions.CheckNotNull(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. + /// + /// /// - /// - /// The name of the destination shelf. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. + /// + /// /// - /// - /// The name of the destination shelf. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MoveBookAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. + /// + /// /// - /// - /// The name of the destination shelf. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book MoveBook( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBook( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - MoveBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - MoveBookRequest request, - st::CancellationToken cancellationToken) => MoveBookAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual Book MoveBook( - MoveBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// /// /// If not null, applies overrides to this RPC call. /// /// - /// A pageable asynchronous sequence of resources. + /// A Task containing the RPC response. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( - new ListStringsRequest + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest { - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), + RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), + RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), + RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), + RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), + RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), + RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), + RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), + RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), + RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), + RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), + RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), + RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), + RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), + RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), + RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), + RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, + RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, + RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, + RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, + RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, + RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, + RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, + RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, + RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, + RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, + RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, + RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, + RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, + RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, + RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, + RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); /// - /// Lists a primitive resource. To test go page streaming. + /// Test optional flattening parameters of all types /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListStrings( - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStrings( - new ListStringsRequest - { - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( - IResourceName name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( - new ListStringsRequest - { - AsResourceName = name, // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListStrings( - IResourceName name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStrings( - new ListStringsRequest - { - AsResourceName = name, // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListStrings( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStrings( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( - ListStringsRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListStrings( - ListStringsRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Adds comments to a book - /// - /// + /// + /// + /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - BookNameOneof name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( - new AddCommentsRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - - /// - /// Adds comments to a book - /// - /// + /// /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - BookNameOneof name, - scg::IEnumerable comments, - st::CancellationToken cancellationToken) => AddCommentsAsync( - name, - comments, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds comments to a book - /// - /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void AddComments( - BookNameOneof name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddComments( - new AddCommentsRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - - /// - /// Adds comments to a book - /// - /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - - /// - /// Adds comments to a book - /// - /// + /// /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - st::CancellationToken cancellationToken) => AddCommentsAsync( - name, - comments, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds comments to a book - /// - /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void AddComments( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddComments( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - - /// - /// Adds comments to a book - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - AddCommentsRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Adds comments to a book - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - AddCommentsRequest request, - st::CancellationToken cancellationToken) => AddCommentsAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds comments to a book - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void AddComments( - AddCommentsRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from an archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - ArchivedBookName name, - ProjectName parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( - new GetBookFromArchiveRequest - { - ArchivedBookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - ParentAsProjectName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), - }, - callSettings); - - /// - /// Gets a book from an archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - ArchivedBookName name, - ProjectName parent, - st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - name, - parent, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from an archive. - /// - /// - /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromArchive GetBookFromArchive( - ArchivedBookName name, - ProjectName parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( - new GetBookFromArchiveRequest - { - ArchivedBookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - ParentAsProjectName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), - }, - callSettings); - - /// - /// Gets a book from an archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - string name, - string parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), - }, - callSettings); - - /// - /// Gets a book from an archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - string name, - string parent, - st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - name, - parent, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from an archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromArchive GetBookFromArchive( - string name, - string parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), - }, - callSettings); - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromArchive GetBookFromArchive( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. + /// + /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - BookNameOneof name, - BookNameOneof altBookName, - LocationName place, - FolderName folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( - new GetBookFromAnywhereRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - AltBookNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(altBookName, nameof(altBookName)), - PlaceAsLocationName = gax::GaxPreconditions.CheckNotNull(place, nameof(place)), - FolderAsFolderName = gax::GaxPreconditions.CheckNotNull(folder, nameof(folder)), - }, - callSettings); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. + /// + /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - BookNameOneof name, - BookNameOneof altBookName, - LocationName place, - FolderName folder, - st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( - name, - altBookName, - place, - folder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. + /// + /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAnywhere( - BookNameOneof name, - BookNameOneof altBookName, - LocationName place, - FolderName folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( - new GetBookFromAnywhereRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - AltBookNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(altBookName, nameof(altBookName)), - PlaceAsLocationName = gax::GaxPreconditions.CheckNotNull(place, nameof(place)), - FolderAsFolderName = gax::GaxPreconditions.CheckNotNull(folder, nameof(folder)), - }, - callSettings); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. + /// + /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - string place, - string folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), - Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), - }, - callSettings); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. + /// + /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - string place, - string folder, - st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( - name, - altBookName, - place, - folder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. + /// + /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAnywhere( - string name, - string altBookName, - string place, - string folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), - Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), - }, - callSettings); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - GetBookFromAnywhereRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - GetBookFromAnywhereRequest request, - st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAnywhere( - GetBookFromAnywhereRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( - new GetBookFromAbsolutelyAnywhereRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - BookNameOneof name, - st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. + /// + /// + /// + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. /// /// - /// The RPC response. + /// A Task containing the RPC response. /// - public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( - new GetBookFromAbsolutelyAnywhereRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + requiredSingularInt32, + requiredSingularInt64, + requiredSingularFloat, + requiredSingularDouble, + requiredSingularBool, + requiredSingularEnum, + requiredSingularString, + requiredSingularBytes, + requiredSingularMessage, + requiredSingularResourceName, + requiredSingularResourceNameOneof, + requiredSingularResourceNameCommon, + requiredSingularFixed32, + requiredSingularFixed64, + requiredRepeatedInt32, + requiredRepeatedInt64, + requiredRepeatedFloat, + requiredRepeatedDouble, + requiredRepeatedBool, + requiredRepeatedEnum, + requiredRepeatedString, + requiredRepeatedBytes, + requiredRepeatedMessage, + requiredRepeatedResourceName, + requiredRepeatedResourceNameOneof, + requiredRepeatedResourceNameCommon, + requiredRepeatedFixed32, + requiredRepeatedFixed64, + requiredMap, + requiredAnyValue, + requiredStructValue, + requiredValueValue, + requiredListValueValue, + requiredTimeValue, + requiredDurationValue, + requiredFieldMaskValue, + requiredInt32Value, + requiredUint32Value, + requiredInt64Value, + requiredUint64Value, + requiredFloatValue, + requiredDoubleValue, + requiredStringValue, + requiredBoolValue, + requiredBytesValue, + requiredRepeatedAnyValue, + requiredRepeatedStructValue, + requiredRepeatedValueValue, + requiredRepeatedListValueValue, + requiredRepeatedTimeValue, + requiredRepeatedDurationValue, + requiredRepeatedFieldMaskValue, + requiredRepeatedInt32Value, + requiredRepeatedUint32Value, + requiredRepeatedInt64Value, + requiredRepeatedUint64Value, + requiredRepeatedFloatValue, + requiredRepeatedDoubleValue, + requiredRepeatedStringValue, + requiredRepeatedBoolValue, + requiredRepeatedBytesValue, + optionalSingularInt32, + optionalSingularInt64, + optionalSingularFloat, + optionalSingularDouble, + optionalSingularBool, + optionalSingularEnum, + optionalSingularString, + optionalSingularBytes, + optionalSingularMessage, + optionalSingularResourceName, + optionalSingularResourceNameOneof, + optionalSingularResourceNameCommon, + optionalSingularFixed32, + optionalSingularFixed64, + optionalRepeatedInt32, + optionalRepeatedInt64, + optionalRepeatedFloat, + optionalRepeatedDouble, + optionalRepeatedBool, + optionalRepeatedEnum, + optionalRepeatedString, + optionalRepeatedBytes, + optionalRepeatedMessage, + optionalRepeatedResourceName, + optionalRepeatedResourceNameOneof, + optionalRepeatedResourceNameCommon, + optionalRepeatedFixed32, + optionalRepeatedFixed64, + optionalMap, + anyValue, + structValue, + valueValue, + listValueValue, + timeValue, + durationValue, + fieldMaskValue, + int32Value, + uint32Value, + int64Value, + uint64Value, + floatValue, + doubleValue, + stringValue, + boolValue, + bytesValue, + repeatedAnyValue, + repeatedStructValue, + repeatedValueValue, + repeatedListValueValue, + repeatedTimeValue, + repeatedDurationValue, + repeatedFieldMaskValue, + repeatedInt32Value, + repeatedUint32Value, + repeatedInt64Value, + repeatedUint64Value, + repeatedFloatValue, + repeatedDoubleValue, + repeatedStringValue, + repeatedBoolValue, + repeatedBytesValue, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// - /// Test proper OneOf-Any resource name mapping + /// Test optional flattening parameters of all types /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - GetBookFromAbsolutelyAnywhereRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - GetBookFromAbsolutelyAnywhereRequest request, - st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( - GetBookFromAbsolutelyAnywhereRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - BookNameOneof name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( - new UpdateBookIndexRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - BookNameOneof name, - string indexName, - scg::IDictionary indexMap, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - name, - indexName, - indexMap, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void UpdateBookIndex( - BookNameOneof name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( - new UpdateBookIndexRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - name, - indexName, - indexMap, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. + /// + /// /// - /// - /// The name of the index for the book + /// + /// /// - /// - /// The index to update the book with + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void UpdateBookIndex( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - public virtual void UpdateBookIndex( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test server streaming - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamShelvesStream StreamShelves( - StreamShelvesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Server streaming methods for StreamShelves. - /// - public abstract partial class StreamShelvesStream : gaxgrpc::ServerStreamingBase - { - } - - /// - /// Test server streaming, non-paged responses. - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamBooksStream StreamBooks( - string name, - gaxgrpc::CallSettings callSettings = null) => StreamBooks( - new StreamBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test server streaming, non-paged responses. - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The server stream. - /// - public virtual StreamBooksStream StreamBooks( - StreamBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Server streaming methods for StreamBooks. - /// - public abstract partial class StreamBooksStream : gaxgrpc::ServerStreamingBase - { - } - - /// - /// Test bidi-streaming. - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The client-server stream. - /// - *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - - /// - /// Test bidi-streaming. - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The client-server stream. - /// - *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - - /// - /// Test bidi-streaming. - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// If not null, applies streaming overrides to this RPC call. + /// + /// /// - /// - /// The client-server stream. - /// - public virtual DiscussBookStream DiscussBook( - gaxgrpc::CallSettings callSettings = null, - gaxgrpc::BidirectionalStreamingSettings streamingSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Bidirectional streaming methods for DiscussBook. - /// - public abstract partial class DiscussBookStream : gaxgrpc::BidirectionalStreamingBase - { - } - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( - new FindRelatedBooksRequest - { - BookNameOneofs = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable FindRelatedBooks( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( - new FindRelatedBooksRequest - { - BookNameOneofs = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( - new FindRelatedBooksRequest - { - Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. + /// + /// /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable FindRelatedBooks( - scg::IEnumerable names, - scg::IEnumerable shelves, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( - new FindRelatedBooksRequest - { - Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, - Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// + /// /// - /// - /// - /// The request object containing all of the parameters for the API call. /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( - FindRelatedBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// + /// /// - /// - /// - /// The request object containing all of the parameters for the API call. /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable FindRelatedBooks( - FindRelatedBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Adds a label to the entity. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task AddLabelAsync( - gtv::AddLabelRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Adds a label to the entity. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task AddLabelAsync( - gtv::AddLabelRequest request, - st::CancellationToken cancellationToken) => AddLabelAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds a label to the entity. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual gtv::AddLabelResponse AddLabel( - gtv::AddLabelRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( - new GetBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - BookNameOneof name, - st::CancellationToken cancellationToken) => GetBigBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBigBook( - new GetBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - st::CancellationToken cancellationToken) => GetBigBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigBookAsync. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// A task representing the result of polling the operation. - public virtual stt::Task> PollOnceGetBigBookAsync( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigBookOperationsClient, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// The long-running operations client for GetBigBook. - /// - public virtual lro::OperationsClient GetBigBookOperationsClient - { - get { throw new sys::NotImplementedException(); } - } - - /// - /// Poll an operation once, using an operationName from a previous invocation of GetBigBook. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// The result of polling the operation. - public virtual lro::Operation PollOnceGetBigBook( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigBookOperationsClient, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// + /// + /// + /// + /// + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - BookNameOneof name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - BookNameOneof name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - BookNameOneof = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Asynchronously poll an operation once, using an operationName from a previous invocation of GetBigNothingAsync. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// A task representing the result of polling the operation. - public virtual stt::Task> PollOnceGetBigNothingAsync( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromNameAsync( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigNothingOperationsClient, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// The long-running operations client for GetBigNothing. - /// - public virtual lro::OperationsClient GetBigNothingOperationsClient - { - get { throw new sys::NotImplementedException(); } - } - - /// - /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// The result of polling the operation. - public virtual lro::Operation PollOnceGetBigNothing( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigNothingOperationsClient, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest - { - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// A to use for this RPC. + /// + /// /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// /// /// If not null, applies overrides to this RPC call. /// @@ -17340,9 +26359,253 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + int requiredSingularInt32, + long requiredSingularInt64, + float requiredSingularFloat, + double requiredSingularDouble, + bool requiredSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, + string requiredSingularString, + pb::ByteString requiredSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, + string requiredSingularResourceNameCommon, + int requiredSingularFixed32, + long requiredSingularFixed64, + scg::IEnumerable requiredRepeatedInt32, + scg::IEnumerable requiredRepeatedInt64, + scg::IEnumerable requiredRepeatedFloat, + scg::IEnumerable requiredRepeatedDouble, + scg::IEnumerable requiredRepeatedBool, + scg::IEnumerable requiredRepeatedEnum, + scg::IEnumerable requiredRepeatedString, + scg::IEnumerable requiredRepeatedBytes, + scg::IEnumerable requiredRepeatedMessage, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedFixed32, + scg::IEnumerable requiredRepeatedFixed64, + scg::IDictionary requiredMap, + pbwkt::Any requiredAnyValue, + pbwkt::Struct requiredStructValue, + pbwkt::Value requiredValueValue, + pbwkt::ListValue requiredListValueValue, + pbwkt::Timestamp requiredTimeValue, + pbwkt::Duration requiredDurationValue, + pbwkt::FieldMask requiredFieldMaskValue, + int? requiredInt32Value, + uint? requiredUint32Value, + long? requiredInt64Value, + ulong? requiredUint64Value, + float? requiredFloatValue, + double? requiredDoubleValue, + string requiredStringValue, + bool? requiredBoolValue, + pb::ByteString requiredBytesValue, + scg::IEnumerable requiredRepeatedAnyValue, + scg::IEnumerable requiredRepeatedStructValue, + scg::IEnumerable requiredRepeatedValueValue, + scg::IEnumerable requiredRepeatedListValueValue, + scg::IEnumerable requiredRepeatedTimeValue, + scg::IEnumerable requiredRepeatedDurationValue, + scg::IEnumerable requiredRepeatedFieldMaskValue, + scg::IEnumerable requiredRepeatedInt32Value, + scg::IEnumerable requiredRepeatedUint32Value, + scg::IEnumerable requiredRepeatedInt64Value, + scg::IEnumerable requiredRepeatedUint64Value, + scg::IEnumerable requiredRepeatedFloatValue, + scg::IEnumerable requiredRepeatedDoubleValue, + scg::IEnumerable requiredRepeatedStringValue, + scg::IEnumerable requiredRepeatedBoolValue, + scg::IEnumerable requiredRepeatedBytesValue, + int? optionalSingularInt32, + long? optionalSingularInt64, + float? optionalSingularFloat, + double? optionalSingularDouble, + bool? optionalSingularBool, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, + string optionalSingularString, + pb::ByteString optionalSingularBytes, + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, + string optionalSingularResourceNameCommon, + int? optionalSingularFixed32, + long? optionalSingularFixed64, + scg::IEnumerable optionalRepeatedInt32, + scg::IEnumerable optionalRepeatedInt64, + scg::IEnumerable optionalRepeatedFloat, + scg::IEnumerable optionalRepeatedDouble, + scg::IEnumerable optionalRepeatedBool, + scg::IEnumerable optionalRepeatedEnum, + scg::IEnumerable optionalRepeatedString, + scg::IEnumerable optionalRepeatedBytes, + scg::IEnumerable optionalRepeatedMessage, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedFixed32, + scg::IEnumerable optionalRepeatedFixed64, + scg::IDictionary optionalMap, + pbwkt::Any anyValue, + pbwkt::Struct structValue, + pbwkt::Value valueValue, + pbwkt::ListValue listValueValue, + pbwkt::Timestamp timeValue, + pbwkt::Duration durationValue, + pbwkt::FieldMask fieldMaskValue, + int? int32Value, + uint? uint32Value, + long? int64Value, + ulong? uint64Value, + float? floatValue, + double? doubleValue, + string stringValue, + bool? boolValue, + pb::ByteString bytesValue, + scg::IEnumerable repeatedAnyValue, + scg::IEnumerable repeatedStructValue, + scg::IEnumerable repeatedValueValue, + scg::IEnumerable repeatedListValueValue, + scg::IEnumerable repeatedTimeValue, + scg::IEnumerable repeatedDurationValue, + scg::IEnumerable repeatedFieldMaskValue, + scg::IEnumerable repeatedInt32Value, + scg::IEnumerable repeatedUint32Value, + scg::IEnumerable repeatedInt64Value, + scg::IEnumerable repeatedUint64Value, + scg::IEnumerable repeatedFloatValue, + scg::IEnumerable repeatedDoubleValue, + scg::IEnumerable repeatedStringValue, + scg::IEnumerable repeatedBoolValue, + scg::IEnumerable repeatedBytesValue, gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( new TestOptionalRequiredFlatteningParamsRequest { + RequiredSingularInt32 = requiredSingularInt32, + RequiredSingularInt64 = requiredSingularInt64, + RequiredSingularFloat = requiredSingularFloat, + RequiredSingularDouble = requiredSingularDouble, + RequiredSingularBool = requiredSingularBool, + RequiredSingularEnum = requiredSingularEnum, + RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), + RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), + RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularFixed32 = requiredSingularFixed32, + RequiredSingularFixed64 = requiredSingularFixed64, + RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, + RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, + RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, + RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, + RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, + RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, + RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, + RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, + RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, + RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, + RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, + RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), + RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), + RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), + RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), + RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), + RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), + RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), + RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), + RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), + RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), + RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), + RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), + RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), + RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), + RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), + RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), + RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, + RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, + RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, + RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, + RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, + RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, + RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, + RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, + RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, + RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, + RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, + RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, + RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, + RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, + RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, + RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, + OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional + OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional + OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional + OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional + OptionalSingularBool = optionalSingularBool ?? false, // Optional + OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional + OptionalSingularString = optionalSingularString ?? "", // Optional + OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional + OptionalSingularMessage = optionalSingularMessage, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional + OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional + OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional + OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional + OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional + AnyValue = anyValue, // Optional + StructValue = structValue, // Optional + ValueValue = valueValue, // Optional + ListValueValue = listValueValue, // Optional + TimeValue = timeValue, // Optional + DurationValue = durationValue, // Optional + FieldMaskValue = fieldMaskValue, // Optional + Int32Value = int32Value, // Optional + Uint32Value = uint32Value, // Optional + Int64Value = int64Value, // Optional + Uint64Value = uint64Value, // Optional + FloatValue = floatValue, // Optional + DoubleValue = doubleValue, // Optional + StringValue = stringValue, // Optional + BoolValue = boolValue, // Optional + BytesValue = bytesValue, // Optional + RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional + RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional + RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); @@ -17731,8 +26994,8 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookNameOneof requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, @@ -17745,8 +27008,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, @@ -17792,8 +27055,8 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookNameOneof optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, @@ -17806,8 +27069,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, @@ -17856,8 +27119,8 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, @@ -17870,8 +27133,8 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceNameAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, @@ -17917,8 +27180,8 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookNameOneof = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional @@ -17931,8 +27194,8 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameAsBookNameOneofs = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional @@ -18357,8 +27620,8 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookNameOneof requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, @@ -18371,8 +27634,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, @@ -18418,8 +27681,8 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookNameOneof optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, @@ -18432,8 +27695,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, @@ -18980,8 +28243,8 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookNameOneof requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, + string requiredSingularResourceName, + string requiredSingularResourceNameOneof, string requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, @@ -18994,8 +28257,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, @@ -19041,8 +28304,8 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookNameOneof optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, + string optionalSingularResourceName, + string optionalSingularResourceNameOneof, string optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, @@ -19055,8 +28318,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, @@ -19105,8 +28368,8 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, @@ -19119,8 +28382,8 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceNameAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, @@ -19166,8 +28429,8 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookNameOneof = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional + OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional @@ -19180,8 +28443,8 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameAsBookNameOneofs = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional @@ -19224,370 +28487,702 @@ namespace Google.Example.Library.V1 /// /// Test optional flattening parameters of all types /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + TestOptionalRequiredFlatteningParamsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test optional flattening parameters of all types + /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// + /// + /// A to use for this RPC. /// - /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + TestOptionalRequiredFlatteningParamsRequest request, + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + TestOptionalRequiredFlatteningParamsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ArchiveName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsArchiveName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ArchiveName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ArchiveName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsArchiveName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ShelfName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsShelfName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ShelfName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ShelfName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsShelfName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsProjectName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ProjectName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsProjectName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// /// @@ -19596,1247 +29191,1912 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest + public virtual stt::Task MoveBooksAsync( + ArchiveName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsArchiveName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ArchiveName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ArchiveName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), - RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), - RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), - RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), - RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), - RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), - RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), - RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), - RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), - RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), - RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), - RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), - RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), - RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), - RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), - RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), - RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, - RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, - RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, - RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, - RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, - RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, - RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, - RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, - RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, - RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, - RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, - RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, - RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, - RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, - RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, - RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional + SourceAsArchiveName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional }, callSettings); /// - /// Test optional flattening parameters of all types + /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ArchiveName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsArchiveName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ArchiveName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ArchiveName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsArchiveName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ShelfName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsShelfName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ShelfName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ShelfName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsShelfName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ShelfName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsShelfName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ShelfName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ShelfName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsShelfName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsProjectName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ProjectName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsProjectName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// A to use for this RPC. + /// + /// If not null, applies overrides to this RPC call. /// /// /// A Task containing the RPC response. /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - requiredSingularInt32, - requiredSingularInt64, - requiredSingularFloat, - requiredSingularDouble, - requiredSingularBool, - requiredSingularEnum, - requiredSingularString, - requiredSingularBytes, - requiredSingularMessage, - requiredSingularResourceName, - requiredSingularResourceNameOneof, - requiredSingularResourceNameCommon, - requiredSingularFixed32, - requiredSingularFixed64, - requiredRepeatedInt32, - requiredRepeatedInt64, - requiredRepeatedFloat, - requiredRepeatedDouble, - requiredRepeatedBool, - requiredRepeatedEnum, - requiredRepeatedString, - requiredRepeatedBytes, - requiredRepeatedMessage, - requiredRepeatedResourceName, - requiredRepeatedResourceNameOneof, - requiredRepeatedResourceNameCommon, - requiredRepeatedFixed32, - requiredRepeatedFixed64, - requiredMap, - requiredAnyValue, - requiredStructValue, - requiredValueValue, - requiredListValueValue, - requiredTimeValue, - requiredDurationValue, - requiredFieldMaskValue, - requiredInt32Value, - requiredUint32Value, - requiredInt64Value, - requiredUint64Value, - requiredFloatValue, - requiredDoubleValue, - requiredStringValue, - requiredBoolValue, - requiredBytesValue, - requiredRepeatedAnyValue, - requiredRepeatedStructValue, - requiredRepeatedValueValue, - requiredRepeatedListValueValue, - requiredRepeatedTimeValue, - requiredRepeatedDurationValue, - requiredRepeatedFieldMaskValue, - requiredRepeatedInt32Value, - requiredRepeatedUint32Value, - requiredRepeatedInt64Value, - requiredRepeatedUint64Value, - requiredRepeatedFloatValue, - requiredRepeatedDoubleValue, - requiredRepeatedStringValue, - requiredRepeatedBoolValue, - requiredRepeatedBytesValue, - optionalSingularInt32, - optionalSingularInt64, - optionalSingularFloat, - optionalSingularDouble, - optionalSingularBool, - optionalSingularEnum, - optionalSingularString, - optionalSingularBytes, - optionalSingularMessage, - optionalSingularResourceName, - optionalSingularResourceNameOneof, - optionalSingularResourceNameCommon, - optionalSingularFixed32, - optionalSingularFixed64, - optionalRepeatedInt32, - optionalRepeatedInt64, - optionalRepeatedFloat, - optionalRepeatedDouble, - optionalRepeatedBool, - optionalRepeatedEnum, - optionalRepeatedString, - optionalRepeatedBytes, - optionalRepeatedMessage, - optionalRepeatedResourceName, - optionalRepeatedResourceNameOneof, - optionalRepeatedResourceNameCommon, - optionalRepeatedFixed32, - optionalRepeatedFixed64, - optionalMap, - anyValue, - structValue, - valueValue, - listValueValue, - timeValue, - durationValue, - fieldMaskValue, - int32Value, - uint32Value, - int64Value, - uint64Value, - floatValue, - doubleValue, - stringValue, - boolValue, - bytesValue, - repeatedAnyValue, - repeatedStructValue, - repeatedValueValue, - repeatedListValueValue, - repeatedTimeValue, - repeatedDurationValue, - repeatedFieldMaskValue, - repeatedInt32Value, - repeatedUint32Value, - repeatedInt64Value, - repeatedUint64Value, - repeatedFloatValue, - repeatedDoubleValue, - repeatedStringValue, - repeatedBoolValue, - repeatedBytesValue, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + SourceAsProjectName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); /// - /// Test optional flattening parameters of all types + /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + ProjectName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + SourceAsProjectName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( + source, + destination, + publishers, + project, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest + { + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional + }, + callSettings); + + /// /// + /// + /// + /// The request object containing all of the parameters for the API call. /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + MoveBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// /// + /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task MoveBooksAsync( + MoveBooksRequest request, + st::CancellationToken cancellationToken) => MoveBooksAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// + /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual MoveBooksResponse MoveBooks( + MoveBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + ArchiveName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + ArchiveName source, + ArchiveName archive, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual ArchiveBooksResponse ArchiveBooks( + ArchiveName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest + { + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual ArchiveBooksResponse ArchiveBooks( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + ShelfName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + SourceAsShelfName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + ShelfName source, + ArchiveName archive, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual ArchiveBooksResponse ArchiveBooks( + ShelfName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest + { + SourceAsShelfName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual ArchiveBooksResponse ArchiveBooks( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + ProjectName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + SourceAsProjectName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + ProjectName source, + ArchiveName archive, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual ArchiveBooksResponse ArchiveBooks( + ProjectName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest + { + SourceAsProjectName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// The RPC response. + /// + public virtual ArchiveBooksResponse ArchiveBooks( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// - /// - /// + /// + /// A to use for this RPC. /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task ArchiveBooksAsync( + string source, + string archive, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// /// @@ -20845,259 +31105,19 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( - new TestOptionalRequiredFlatteningParamsRequest + public virtual ArchiveBooksResponse ArchiveBooks( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), - RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), - RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), - RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), - RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), - RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), - RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), - RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), - RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), - RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), - RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), - RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), - RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), - RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), - RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), - RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), - RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, - RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, - RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, - RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, - RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, - RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, - RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, - RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, - RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, - RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, - RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, - RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, - RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, - RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, - RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, - RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional }, callSettings); /// - /// Test optional flattening parameters of all types + /// /// /// /// The request object containing all of the parameters for the API call. @@ -21108,15 +31128,15 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - TestOptionalRequiredFlatteningParamsRequest request, + public virtual stt::Task ArchiveBooksAsync( + ArchiveBooksRequest request, gaxgrpc::CallSettings callSettings = null) { throw new sys::NotImplementedException(); } /// - /// Test optional flattening parameters of all types + /// /// /// /// The request object containing all of the parameters for the API call. @@ -21127,14 +31147,14 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - TestOptionalRequiredFlatteningParamsRequest request, - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + public virtual stt::Task ArchiveBooksAsync( + ArchiveBooksRequest request, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// - /// Test optional flattening parameters of all types + /// /// /// /// The request object containing all of the parameters for the API call. @@ -21145,8 +31165,8 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - TestOptionalRequiredFlatteningParamsRequest request, + public virtual ArchiveBooksResponse ArchiveBooks( + ArchiveBooksRequest request, gaxgrpc::CallSettings callSettings = null) { throw new sys::NotImplementedException(); @@ -21158,33 +31178,72 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> LongRunningArchiveBooksAsync( + ArchiveName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( + new ArchiveBooksRequest + { + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> LongRunningArchiveBooksAsync( + ArchiveName source, + ArchiveName archive, + st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// + /// + /// + /// /// /// /// /// If not null, applies overrides to this RPC call. /// /// - /// A Task containing the RPC response. + /// The RPC response. /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest + public virtual lro::Operation LongRunningArchiveBooks( + ArchiveName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( + new ArchiveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -21194,13 +31253,33 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> LongRunningArchiveBooksAsync( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// /// /// /// @@ -21209,16 +31288,12 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task MoveBooksAsync( + public virtual stt::Task> LongRunningArchiveBooksAsync( string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( + string archive, + st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( source, - destination, - publishers, - project, + archive, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -21227,13 +31302,82 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// /// /// - /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation LongRunningArchiveBooks( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); + + /// + /// + /// + /// /// /// - /// + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> LongRunningArchiveBooksAsync( + ShelfName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( + new ArchiveBooksRequest + { + SourceAsShelfName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task> LongRunningArchiveBooksAsync( + ShelfName source, + ArchiveName archive, + st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( + source, + archive, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -21242,26 +31386,25 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest + public virtual lro::Operation LongRunningArchiveBooks( + ShelfName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( + new ArchiveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + SourceAsShelfName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -21269,18 +31412,25 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task MoveBooksAsync( - MoveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + public virtual stt::Task> LongRunningArchiveBooksAsync( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// A to use for this RPC. @@ -21288,30 +31438,39 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task MoveBooksAsync( - MoveBooksRequest request, - st::CancellationToken cancellationToken) => MoveBooksAsync( - request, + public virtual stt::Task> LongRunningArchiveBooksAsync( + string source, + string archive, + st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( + source, + archive, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. /// /// /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - MoveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + /// + public virtual lro::Operation LongRunningArchiveBooks( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); /// /// @@ -21328,14 +31487,14 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + public virtual stt::Task> LongRunningArchiveBooksAsync( + ProjectName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -21354,10 +31513,10 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( + public virtual stt::Task> LongRunningArchiveBooksAsync( + ProjectName source, + ArchiveName archive, + st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( source, archive, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); @@ -21377,22 +31536,25 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual ArchiveBooksResponse ArchiveBooks( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + public virtual lro::Operation LongRunningArchiveBooks( + ProjectName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -21400,18 +31562,25 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - ArchiveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + public virtual stt::Task> LongRunningArchiveBooksAsync( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// A to use for this RPC. @@ -21419,17 +31588,22 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - ArchiveBooksRequest request, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( - request, + public virtual stt::Task> LongRunningArchiveBooksAsync( + string source, + string archive, + st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( + source, + archive, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -21437,12 +31611,16 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual ArchiveBooksResponse ArchiveBooks( - ArchiveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + public virtual lro::Operation LongRunningArchiveBooks( + string source, + string archive, + gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( + new ArchiveBooksRequest + { + Source = source ?? "", // Optional + Archive = archive ?? "", // Optional + }, + callSettings); /// /// @@ -21602,6 +31780,72 @@ namespace Google.Example.Library.V1 /// *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + + /// + /// + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The client-server stream. + /// + *** ERROR: Cannot handle streaming type 'BidiStreaming' *** + /// /// /// @@ -22511,12 +32755,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable ListStringsAsync( + public override gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); } /// @@ -22531,12 +32775,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable ListStrings( + public override gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); } /// @@ -22910,12 +33154,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -22930,12 +33174,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable FindRelatedBooks( + public override gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -23395,24 +33639,24 @@ namespace Google.Example.Library.V1 } public partial class ListStringsRequest : gaxgrpc::IPageRequest { } - public partial class ListStringsResponse : gaxgrpc::IPageResponse + public partial class ListStringsResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => StringsAsResourceNames.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => Strings.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } public partial class FindRelatedBooksRequest : gaxgrpc::IPageRequest { } - public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse + public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => BookNameOneofs.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => Names.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); @@ -23975,6 +34219,97 @@ using linq = System.Linq; namespace Google.Example.Library.V1 { + /// + /// Resource name for the 'archive' resource. + /// + public sealed partial class ArchiveName : gax::IResourceName, sys::IEquatable + { + private static readonly gax::PathTemplate s_template = new gax::PathTemplate("archives/{archive}"); + + /// + /// Parses the given archive resource name in string form into a new + /// instance. + /// + /// The archive resource name in string form. Must not be null. + /// The parsed if successful. + public static ArchiveName Parse(string archiveName) + { + gax::GaxPreconditions.CheckNotNull(archiveName, nameof(archiveName)); + gax::TemplatedResourceName resourceName = s_template.ParseName(archiveName); + return new ArchiveName(resourceName[0]); + } + + /// + /// Tries to parse the given archive resource name in string form into a new + /// instance. + /// + /// + /// This method still throws if is null, + /// as this would usually indicate a programming error rather than a data error. + /// + /// The archive resource name in string form. Must not be null. + /// When this method returns, the parsed , + /// or null if parsing fails. + /// true if the name was parsed successfully; false otherwise. + public static bool TryParse(string archiveName, out ArchiveName result) + { + gax::GaxPreconditions.CheckNotNull(archiveName, nameof(archiveName)); + gax::TemplatedResourceName resourceName; + if (s_template.TryParseName(archiveName, out resourceName)) + { + result = new ArchiveName(resourceName[0]); + return true; + } + else + { + result = null; + return false; + } + } + + /// Formats the IDs into the string representation of the . + /// The archive ID. Must not be null. + /// The string representation of the . + public static string Format(string archiveId) => + s_template.Expand(gax::GaxPreconditions.CheckNotNull(archiveId, nameof(archiveId))); + + /// + /// Constructs a new instance of the resource name class + /// from its component parts. + /// + /// The archive ID. Must not be null. + public ArchiveName(string archiveId) + { + ArchiveId = gax::GaxPreconditions.CheckNotNull(archiveId, nameof(archiveId)); + } + + /// + /// The archive ID. Never null. + /// + public string ArchiveId { get; } + + /// + public gax::ResourceNameKind Kind => gax::ResourceNameKind.Simple; + + /// + public override string ToString() => s_template.Expand(ArchiveId); + + /// + public override int GetHashCode() => ToString().GetHashCode(); + + /// + public override bool Equals(object obj) => Equals(obj as ArchiveName); + + /// + public bool Equals(ArchiveName other) => ToString() == other?.ToString(); + + /// + public static bool operator ==(ArchiveName a, ArchiveName b) => ReferenceEquals(a, b) || (a?.Equals(b) ?? false); + + /// + public static bool operator !=(ArchiveName a, ArchiveName b) => !(a == b); + } + /// /// Resource name for the 'archived_book' resource. /// @@ -25100,6 +35435,28 @@ namespace Google.Example.Library.V1 } + public partial class ArchiveBooksRequest + { + /// + /// -typed view over the resource name property. + /// + public Google.Example.Library.V1.ArchiveName SourceAsArchiveName + { + get { return string.IsNullOrEmpty(Source) ? null : Google.Example.Library.V1.ArchiveName.Parse(Source); } + set { Source = value != null ? value.ToString() : ""; } + } + + /// + /// -typed view over the resource name property. + /// + public Google.Example.Library.V1.ArchiveName ArchiveAsArchiveName + { + get { return string.IsNullOrEmpty(Archive) ? null : Google.Example.Library.V1.ArchiveName.Parse(Archive); } + set { Archive = value != null ? value.ToString() : ""; } + } + + } + public partial class Book { /// @@ -25402,6 +35759,44 @@ namespace Google.Example.Library.V1 } + public partial class MoveBooksRequest + { + /// + /// -typed view over the resource name property. + /// + public Google.Example.Library.V1.ArchiveName SourceAsArchiveName + { + get { return string.IsNullOrEmpty(Source) ? null : Google.Example.Library.V1.ArchiveName.Parse(Source); } + set { Source = value != null ? value.ToString() : ""; } + } + + /// + /// -typed view over the resource name property. + /// + public Google.Example.Library.V1.ArchiveName DestinationAsArchiveName + { + get { return string.IsNullOrEmpty(Destination) ? null : Google.Example.Library.V1.ArchiveName.Parse(Destination); } + set { Destination = value != null ? value.ToString() : ""; } + } + + /// + /// -typed view over the resource name property. + /// + public gax::ResourceNameList PublishersAsPublisherNames => + new gax::ResourceNameList(Publishers, + str => PublisherName.Parse(str)); + + /// + /// -typed view over the resource name property. + /// + public Google.Example.Library.V1.ProjectName ProjectAsProjectName + { + get { return string.IsNullOrEmpty(Project) ? null : Google.Example.Library.V1.ProjectName.Parse(Project); } + set { Project = value != null ? value.ToString() : ""; } + } + + } + public partial class PublishSeriesRequest { /// diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index d294523a57..89968cb658 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -748,8 +748,8 @@ public class FindRelatedBooksCallableCallableListOdyssey { .build(); while (true) { FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request); - for (BookName responseItem : BookName.parseList(response.getNamesList())) { - BookName book = responseItem; + for (String responseItem : response.getNamesList()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } String nextPageToken = response.getNextPageToken(); @@ -794,7 +794,6 @@ public class FindRelatedBooksCallableCallableListOdyssey { package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; import java.util.Arrays; @@ -806,7 +805,6 @@ public class FindRelatedBooksFlattenedPagedOdyssey { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; * import java.util.Arrays; @@ -824,8 +822,8 @@ public class FindRelatedBooksFlattenedPagedOdyssey { // Do something - for (BookName responseItem : future.get().iterateAllAsBookName()) { - BookName book = responseItem; + for (String responseItem : future.get().iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -903,8 +901,8 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { // Do something - for (BookName responseItem : future.get().iterateAllAsBookName()) { - BookName book = responseItem; + for (String responseItem : future.get().iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -974,8 +972,8 @@ public class FindRelatedBooksRequestPagedOdyssey { .addAllNames(BookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); - for (BookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) { - BookName book = responseItem; + for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -6259,7 +6257,7 @@ public class LibraryClient implements BackgroundResource { *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6280,7 +6278,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6305,7 +6303,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6330,7 +6328,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6354,7 +6352,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6374,7 +6372,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
    +   *     for (String element : response.getStringsList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7110,7 +7108,7 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (BookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7120,11 +7118,11 @@ public class LibraryClient implements BackgroundResource {
        * @param shelves
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) {
    +  public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) {
         FindRelatedBooksRequest request =
             FindRelatedBooksRequest.newBuilder()
    -            .addAllNames(names == null ? null : BookName.toStringList(names))
    -            .addAllShelves(shelves == null ? null : ShelfName.toStringList(shelves))
    +            .addAllNames(names)
    +            .addAllShelves(shelves)
                 .build();
         return findRelatedBooks(request);
       }
    @@ -7143,7 +7141,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(BookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7173,7 +7171,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (BookName element : future.get().iterateAllAsBookName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7199,7 +7197,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (BookName element : BookName.parseList(response.getNamesList())) {
    +   *     for (String element : response.getNamesList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7769,7 +7767,7 @@ public class LibraryClient implements BackgroundResource {
        * @param repeatedBytesValue
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, BookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, BookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) {
    +  public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, BookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, BookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) {
         TestOptionalRequiredFlatteningParamsRequest request =
             TestOptionalRequiredFlatteningParamsRequest.newBuilder()
                 .setRequiredSingularInt32(requiredSingularInt32)
    @@ -7795,8 +7793,8 @@ public class LibraryClient implements BackgroundResource {
                 .addAllRequiredRepeatedString(requiredRepeatedString)
                 .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
                 .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
    -            .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : BookName.toStringList(requiredRepeatedResourceName))
    -            .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof))
    +            .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName)
    +            .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof)
                 .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
                 .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
                 .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
    @@ -7856,8 +7854,8 @@ public class LibraryClient implements BackgroundResource {
                 .addAllOptionalRepeatedString(optionalRepeatedString)
                 .addAllOptionalRepeatedBytes(optionalRepeatedBytes)
                 .addAllOptionalRepeatedMessage(optionalRepeatedMessage)
    -            .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : BookName.toStringList(optionalRepeatedResourceName))
    -            .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof))
    +            .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName)
    +            .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof)
                 .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon)
                 .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32)
                 .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64)
    @@ -8588,12 +8586,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8620,12 +8618,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8652,12 +8650,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8684,12 +8682,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8716,12 +8714,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8748,12 +8746,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8780,12 +8778,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8812,12 +8810,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -8844,12 +8842,12 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
                 .setDestination(destination == null ? null : destination.toString())
    -            .addAllPublishers(publishers == null ? null : PublisherName.toStringList(publishers))
    +            .addAllPublishers(publishers)
                 .setProject(project == null ? null : project.toString())
                 .build();
         return moveBooks(request);
    @@ -9540,15 +9538,7 @@ public class LibraryClient implements BackgroundResource {
         private ListStringsPagedResponse(ListStringsPage page) {
           super(page, ListStringsFixedSizeCollection.createEmptyCollection());
         }
    -    public Iterable iterateAllAsResourceName() {
    -      return Iterables.transform(iterateAll(), new Function() {
    -          @Override
    -          public ResourceName apply(String arg0) {
    -            return UntypedResourceName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
    +
     
       }
     
    @@ -9581,25 +9571,9 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    -    public Iterable iterateAllAsResourceName() {
    -      return Iterables.transform(iterateAll(), new Function() {
    -          @Override
    -          public ResourceName apply(String arg0) {
    -            return UntypedResourceName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
     
    -    public Iterable getValuesAsResourceName() {
    -      return Iterables.transform(getValues(), new Function() {
    -          @Override
    -          public ResourceName apply(String arg0) {
    -            return UntypedResourceName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
    +
    +
     
       }
     
    @@ -9623,15 +9597,7 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new ListStringsFixedSizeCollection(pages, collectionSize);
         }
    -    public Iterable getValuesAsResourceName() {
    -      return Iterables.transform(getValues(), new Function() {
    -          @Override
    -          public ResourceName apply(String arg0) {
    -            return UntypedResourceName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
    +
     
       }
       public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse<
    @@ -9660,15 +9626,7 @@ public class LibraryClient implements BackgroundResource {
         private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) {
           super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection());
         }
    -    public Iterable iterateAllAsBookName() {
    -      return Iterables.transform(iterateAll(), new Function() {
    -          @Override
    -          public BookName apply(String arg0) {
    -            return BookName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
    +
     
       }
     
    @@ -9701,25 +9659,9 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    -    public Iterable iterateAllAsBookName() {
    -      return Iterables.transform(iterateAll(), new Function() {
    -          @Override
    -          public BookName apply(String arg0) {
    -            return BookName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
     
    -    public Iterable getValuesAsBookName() {
    -      return Iterables.transform(getValues(), new Function() {
    -          @Override
    -          public BookName apply(String arg0) {
    -            return BookName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
    +
    +
     
       }
     
    @@ -9743,15 +9685,7 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new FindRelatedBooksFixedSizeCollection(pages, collectionSize);
         }
    -    public Iterable getValuesAsBookName() {
    -      return Iterables.transform(getValues(), new Function() {
    -          @Override
    -          public BookName apply(String arg0) {
    -            return BookName.parse(arg0);
    -          }
    -        }
    -      );
    -    }
    +
     
       }
     }
    @@ -14810,6 +14744,7 @@ import com.google.api.gax.rpc.StatusCode;
     import com.google.api.resourcenames.ResourceName;
     import com.google.common.collect.Lists;
     import com.google.example.library.v1.Comment;
    +import static com.google.example.library.v1.LibraryClient.FindRelatedBooksPagedResponse;
     import static com.google.example.library.v1.LibraryClient.ListBooksPagedResponse;
     import static com.google.example.library.v1.LibraryClient.ListShelvesPagedResponse;
     import static com.google.example.library.v1.LibraryClient.ListStringsPagedResponse;
    @@ -15640,10 +15575,6 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    -    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    -    Assert.assertEquals(1, resourceNames.size());
    -    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    -        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -15688,10 +15619,6 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    -    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    -    Assert.assertEquals(1, resourceNames.size());
    -    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    -        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -16145,6 +16072,58 @@ public class LibraryClientTest {
         }
       }
     
    +  @Test
    +  @SuppressWarnings("all")
    +  public void findRelatedBooksTest() {
    +    String nextPageToken = "";
    +    BookName namesElement2 = ShelfBookName.of("[SHELF]", "[BOOK]");
    +    List names2 = Arrays.asList(namesElement2);
    +    FindRelatedBooksResponse expectedResponse = FindRelatedBooksResponse.newBuilder()
    +      .setNextPageToken(nextPageToken)
    +      .addAllNames(BookName.toStringList(names2))
    +      .build();
    +    mockLibraryService.addResponse(expectedResponse);
    +
    +    String namesElement = "namesElement-249113339";
    +    List names = Arrays.asList(namesElement);
    +    List formattedShelves = new ArrayList<>();
    +
    +    FindRelatedBooksPagedResponse pagedListResponse = client.findRelatedBooks(formattedNames, formattedShelves);
    +
    +    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
    +    Assert.assertEquals(1, resources.size());
    +    Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0));
    +
    +    List actualRequests = mockLibraryService.getRequests();
    +    Assert.assertEquals(1, actualRequests.size());
    +    FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0);
    +
    +    Assert.assertEquals(formattedNames, actualRequest.getNamesList());
    +    Assert.assertEquals(formattedShelves, actualRequest.getShelvesList());
    +    Assert.assertTrue(
    +        channelProvider.isHeaderSent(
    +            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
    +            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
    +  }
    +
    +  @Test
    +  @SuppressWarnings("all")
    +  public void findRelatedBooksExceptionTest() throws Exception {
    +    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
    +    mockLibraryService.addException(exception);
    +
    +    try {
    +      String namesElement = "namesElement-249113339";
    +      List names = Arrays.asList(namesElement);
    +      List formattedShelves = new ArrayList<>();
    +
    +      client.findRelatedBooks(formattedNames, formattedShelves);
    +      Assert.fail("No exception raised");
    +    } catch (InvalidArgumentException e) {
    +      // Expected exception
    +    }
    +  }
    +
       @Test
       @SuppressWarnings("all")
       public void getBigBookTest() throws Exception {
    diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline
    index c33a594c4d..9f092d4559 100644
    --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline
    +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline
    @@ -1633,7 +1633,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *
    -   *   for (ResourceName element : libraryServiceClient.listStrings().iterateAllAsResourceName()) {
    +   *   for (String element : libraryServiceClient.listStrings().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1653,8 +1653,8 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    -   *   for (ResourceName element : libraryServiceClient.listStrings(name).iterateAllAsResourceName()) {
    +   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    +   *   for (String element : libraryServiceClient.listStrings(name).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1678,8 +1678,8 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    -   *   for (ResourceName element : libraryServiceClient.listStrings(name.toString()).iterateAllAsResourceName()) {
    +   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    +   *   for (String element : libraryServiceClient.listStrings(name.toString()).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1704,7 +1704,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (ResourceName element : libraryServiceClient.listStrings(request).iterateAllAsResourceName()) {
    +   *   for (String element : libraryServiceClient.listStrings(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1728,7 +1728,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryServiceClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1748,7 +1748,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryServiceClient.listStringsCallable().call(request);
    -   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
    +   *     for (String element : response.getStringsList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -2443,7 +2443,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   List<String> names = new ArrayList<>();
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (BookName element : libraryServiceClient.findRelatedBooks(names, formattedShelves).iterateAllAsBookName()) {
    +   *   for (String element : libraryServiceClient.findRelatedBooks(names, formattedShelves).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -2475,7 +2475,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *     .addAllNames(BookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (BookName element : libraryServiceClient.findRelatedBooks(request).iterateAllAsBookName()) {
    +   *   for (String element : libraryServiceClient.findRelatedBooks(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -2504,7 +2504,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryServiceClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (BookName element : future.get().iterateAllAsBookName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -2529,7 +2529,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryServiceClient.findRelatedBooksCallable().call(request);
    -   *     for (BookName element : BookName.parseList(response.getNamesList())) {
    +   *     for (String element : response.getNamesList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -2553,7 +2553,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ResourceName resource = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    +   *   ResourceName resource = ArchiveName.of("[ARCHIVE]");
        *   String tag = "";
        *   AddTagResponse response = libraryServiceClient.addTag(resource, tag);
        * }
    @@ -2580,7 +2580,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ResourceName resource = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    +   *   ResourceName resource = ArchiveName.of("[ARCHIVE]");
        *   String tag = "";
        *   AddTagResponse response = libraryServiceClient.addTag(resource.toString(), tag);
        * }
    @@ -2607,7 +2607,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ResourceName resource = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    +   *   ResourceName resource = ArchiveName.of("[ARCHIVE]");
        *   String tag = "";
        *   AddTagRequest request = AddTagRequest.newBuilder()
        *     .setResource(resource.toString())
    @@ -2631,7 +2631,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ResourceName resource = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    +   *   ResourceName resource = ArchiveName.of("[ARCHIVE]");
        *   String tag = "";
        *   AddTagRequest request = AddTagRequest.newBuilder()
        *     .setResource(resource.toString())
    @@ -2882,11 +2882,299 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   String source = "";
    -   *   String destination = "";
    -   *   List<String> publishers = new ArrayList<>();
    -   *   String project = "";
    -   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, publishers, project);
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryServiceClient.moveBooks(source.toString(), destination.toString(), formattedPublishers, project.toString());
        * }
        * 
    * @@ -2951,8 +3239,60 @@ public class LibraryServiceClient implements BackgroundResource { * Sample code: *
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   String source = "";
    -   *   String archive = "";
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryServiceClient.archiveBooks(source, archive);
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ArchiveName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryServiceClient.archiveBooks(source, archive);
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ShelfName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
        *   ArchiveBooksResponse response = libraryServiceClient.archiveBooks(source, archive);
        * }
        * 
    @@ -2961,6 +3301,32 @@ public class LibraryServiceClient implements BackgroundResource { * @param archive * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ + public final ArchiveBooksResponse archiveBooks(ProjectName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryServiceClient.archiveBooks(source.toString(), archive.toString());
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ public final ArchiveBooksResponse archiveBooks(String source, String archive) { ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder() @@ -3014,8 +3380,8 @@ public class LibraryServiceClient implements BackgroundResource { * Sample code: *
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   String source = "";
    -   *   String archive = "";
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
        *   ArchiveBooksResponse response = libraryServiceClient.longRunningArchiveBooksAsync(source, archive).get();
        * }
        * 
    @@ -3025,6 +3391,87 @@ public class LibraryServiceClient implements BackgroundResource { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ArchiveName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryServiceClient.longRunningArchiveBooksAsync(source, archive).get();
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ShelfName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryServiceClient.longRunningArchiveBooksAsync(source, archive).get();
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ProjectName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryServiceClient.longRunningArchiveBooksAsync(source.toString(), archive.toString()).get();
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture longRunningArchiveBooksAsync(String source, String archive) { ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder() @@ -3261,7 +3708,7 @@ public class LibraryServiceClient implements BackgroundResource { * List<StringValue> repeatedStringValue = new ArrayList<>(); * List<BoolValue> repeatedBoolValue = new ArrayList<>(); * List<BytesValue> repeatedBytesValue = new ArrayList<>(); - * TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + * TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); * } *
    * @@ -3389,7 +3836,7 @@ public class LibraryServiceClient implements BackgroundResource { * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, String requiredSingularResourceName, String requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String optionalSingularResourceName, String optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, BookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, BookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder() .setRequiredSingularInt32(requiredSingularInt32) @@ -3401,8 +3848,8 @@ public class LibraryServiceClient implements BackgroundResource { .setRequiredSingularString(requiredSingularString) .setRequiredSingularBytes(requiredSingularBytes) .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredSingularResourceName(requiredSingularResourceName) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) + .setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof == null ? null : requiredSingularResourceNameOneof.toString()) .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) .setRequiredSingularFixed32(requiredSingularFixed32) .setRequiredSingularFixed64(requiredSingularFixed64) @@ -3462,8 +3909,8 @@ public class LibraryServiceClient implements BackgroundResource { .setOptionalSingularString(optionalSingularString) .setOptionalSingularBytes(optionalSingularBytes) .setOptionalSingularMessage(optionalSingularMessage) - .setOptionalSingularResourceName(optionalSingularResourceName) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) + .setOptionalSingularResourceName(optionalSingularResourceName == null ? null : optionalSingularResourceName.toString()) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof == null ? null : optionalSingularResourceNameOneof.toString()) .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) .setOptionalSingularFixed32(optionalSingularFixed32) .setOptionalSingularFixed64(optionalSingularFixed64) @@ -3647,7 +4094,7 @@ public class LibraryServiceClient implements BackgroundResource { * List<StringValue> repeatedStringValue = new ArrayList<>(); * List<BoolValue> repeatedBoolValue = new ArrayList<>(); * List<BytesValue> repeatedBytesValue = new ArrayList<>(); - * TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + * TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); * } *
    * @@ -4387,15 +4834,7 @@ public class LibraryServiceClient implements BackgroundResource { private ListStringsPagedResponse(ListStringsPage page) { super(page, ListStringsFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } @@ -4428,25 +4867,9 @@ public class LibraryServiceClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + + } @@ -4470,15 +4893,7 @@ public class LibraryServiceClient implements BackgroundResource { List pages, int collectionSize) { return new ListStringsFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse< @@ -4507,15 +4922,7 @@ public class LibraryServiceClient implements BackgroundResource { private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) { super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + } @@ -4548,25 +4955,9 @@ public class LibraryServiceClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + + } @@ -4590,15 +4981,7 @@ public class LibraryServiceClient implements BackgroundResource { List pages, int collectionSize) { return new FindRelatedBooksFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + } } @@ -5912,6 +6295,7 @@ import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksMetadata; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -6098,6 +6482,7 @@ import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksMetadata; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -7348,6 +7733,7 @@ import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksMetadata; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -9948,7 +10334,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10035,7 +10421,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10084,7 +10470,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -10138,7 +10524,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -10195,7 +10581,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( @@ -10224,7 +10610,7 @@ public class LibraryServiceClientTest { @SuppressWarnings("all") public void listStringsTest() { String nextPageToken = ""; - ResourceName stringsElement = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); List strings = Arrays.asList(stringsElement); ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() .setNextPageToken(nextPageToken) @@ -10237,10 +10623,6 @@ public class LibraryServiceClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -10270,7 +10652,7 @@ public class LibraryServiceClientTest { @SuppressWarnings("all") public void listStringsTest2() { String nextPageToken = ""; - ResourceName stringsElement = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); List strings = Arrays.asList(stringsElement); ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() .setNextPageToken(nextPageToken) @@ -10278,17 +10660,13 @@ public class LibraryServiceClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); ListStringsPagedResponse pagedListResponse = client.listStrings(name); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -10308,7 +10686,7 @@ public class LibraryServiceClientTest { mockLibraryService.addException(exception); try { - ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); client.listStrings(name); Assert.fail("No exception raised"); @@ -10332,7 +10710,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertEquals(comments, actualRequest.getCommentsList()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -10436,8 +10814,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(altBookName, actualRequest.getAltBookName()); Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); Assert.assertTrue( @@ -10490,7 +10868,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10529,7 +10907,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertEquals(indexName, actualRequest.getIndexName()); Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); Assert.assertTrue( @@ -10738,10 +11116,6 @@ public class LibraryServiceClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -10778,7 +11152,7 @@ public class LibraryServiceClientTest { AddTagResponse expectedResponse = AddTagResponse.newBuilder().build(); mockLibraryService.addResponse(expectedResponse); - ResourceName resource = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName resource = ArchiveName.of("[ARCHIVE]"); String tag = "tag114586"; AddTagResponse actualResponse = @@ -10804,7 +11178,7 @@ public class LibraryServiceClientTest { mockLibraryService.addException(exception); try { - ResourceName resource = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName resource = ArchiveName.of("[ARCHIVE]"); String tag = "tag114586"; client.addTag(resource, tag); @@ -10845,7 +11219,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10893,7 +11267,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10928,23 +11302,23 @@ public class LibraryServiceClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - String source = "source-896505829"; - String destination = "destination-1429847026"; - List publishers = new ArrayList<>(); - String project = "project-309310695"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); MoveBooksResponse actualResponse = - client.moveBooks(source, destination, publishers, project); + client.moveBooks(source, destination, formattedPublishers, project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(publishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10958,12 +11332,12 @@ public class LibraryServiceClientTest { mockLibraryService.addException(exception); try { - String source = "source-896505829"; - String destination = "destination-1429847026"; - List publishers = new ArrayList<>(); - String project = "project-309310695"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - client.moveBooks(source, destination, publishers, project); + client.moveBooks(source, destination, formattedPublishers, project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -10979,8 +11353,8 @@ public class LibraryServiceClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); ArchiveBooksResponse actualResponse = client.archiveBooks(source, archive); @@ -10990,8 +11364,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -11005,8 +11379,8 @@ public class LibraryServiceClientTest { mockLibraryService.addException(exception); try { - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); client.archiveBooks(source, archive); Assert.fail("No exception raised"); @@ -11030,8 +11404,8 @@ public class LibraryServiceClientTest { .build(); mockLibraryService.addResponse(resultOperation); - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); ArchiveBooksResponse actualResponse = client.longRunningArchiveBooksAsync(source, archive).get(); @@ -11041,8 +11415,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -11056,8 +11430,8 @@ public class LibraryServiceClientTest { mockLibraryService.addException(exception); try { - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); client.longRunningArchiveBooksAsync(source, archive).get(); Assert.fail("No exception raised"); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline index e80abda7ca..e61cf6e34a 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline @@ -748,8 +748,8 @@ public class FindRelatedBooksCallableCallableListOdyssey { .build(); while (true) { FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request); - for (BookName responseItem : BookName.parseList(response.getNamesList())) { - BookName book = responseItem; + for (String responseItem : response.getNamesList()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } String nextPageToken = response.getNextPageToken(); @@ -794,7 +794,6 @@ public class FindRelatedBooksCallableCallableListOdyssey { package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; -import com.google.example.library.v1.BookName; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; import java.util.Arrays; @@ -806,7 +805,6 @@ public class FindRelatedBooksFlattenedPagedOdyssey { * Please include the following imports to run this sample. * * import com.google.api.core.ApiFuture; - * import com.google.example.library.v1.BookName; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; * import java.util.Arrays; @@ -824,8 +822,8 @@ public class FindRelatedBooksFlattenedPagedOdyssey { // Do something - for (BookName responseItem : future.get().iterateAllAsBookName()) { - BookName book = responseItem; + for (String responseItem : future.get().iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -903,8 +901,8 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { // Do something - for (BookName responseItem : future.get().iterateAllAsBookName()) { - BookName book = responseItem; + for (String responseItem : future.get().iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -974,8 +972,8 @@ public class FindRelatedBooksRequestPagedOdyssey { .addAllNames(BookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); - for (BookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) { - BookName book = responseItem; + for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) { + String book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -4470,6 +4468,9 @@ public class LibraryClient implements BackgroundResource { private final LibraryServiceStub stub; private final OperationsClient operationsClient; + private static final PathTemplate ARCHIVE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("archives/{archive}"); + private static final PathTemplate ARCHIVED_BOOK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("archives/{archive}/books/{book}"); @@ -4497,6 +4498,18 @@ public class LibraryClient implements BackgroundResource { private static final PathTemplate SHELF_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("shelves/{shelf}"); + /** + * Formats a string containing the fully-qualified path to represent + * a archive resource. + * + * @deprecated Use the {@link ArchiveName} class instead. + */ + @Deprecated + public static final String formatArchiveName(String archive) { + return ARCHIVE_PATH_TEMPLATE.instantiate( + "archive", archive); + } + /** * Formats a string containing the fully-qualified path to represent * a archived_book resource. @@ -4612,6 +4625,17 @@ public class LibraryClient implements BackgroundResource { "shelf", shelf); } + /** + * Parses the archive from the given fully-qualified path which + * represents a archive resource. + * + * @deprecated Use the {@link ArchiveName} class instead. + */ + @Deprecated + public static final String parseArchiveFromArchiveName(String archiveName) { + return ARCHIVE_PATH_TEMPLATE.parse(archiveName).get("archive"); + } + /** * Parses the archive from the given fully-qualified path which * represents a archived_book resource. @@ -6233,7 +6257,7 @@ public class LibraryClient implements BackgroundResource { *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6253,8 +6277,8 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    -   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
    +   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    +   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6278,8 +6302,8 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]");
    -   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
    +   *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    +   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6304,7 +6328,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
    +   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6328,7 +6352,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6348,7 +6372,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
    +   *     for (String element : response.getStringsList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7084,7 +7108,7 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (BookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7117,7 +7141,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(BookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
    +   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7147,7 +7171,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (BookName element : future.get().iterateAllAsBookName()) {
    +   *   for (String element : future.get().iterateAll()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7173,7 +7197,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (BookName element : BookName.parseList(response.getNamesList())) {
    +   *     for (String element : response.getNamesList()) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7615,7 +7639,7 @@ public class LibraryClient implements BackgroundResource {
        *   List<StringValue> repeatedStringValue = new ArrayList<>();
        *   List<BoolValue> repeatedBoolValue = new ArrayList<>();
        *   List<BytesValue> repeatedBytesValue = new ArrayList<>();
    -   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +   *   TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
        * }
        * 
    * @@ -7743,7 +7767,7 @@ public class LibraryClient implements BackgroundResource { * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, String requiredSingularResourceName, String requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, String optionalSingularResourceName, String optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, BookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, String requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, BookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, String optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder() .setRequiredSingularInt32(requiredSingularInt32) @@ -7755,8 +7779,8 @@ public class LibraryClient implements BackgroundResource { .setRequiredSingularString(requiredSingularString) .setRequiredSingularBytes(requiredSingularBytes) .setRequiredSingularMessage(requiredSingularMessage) - .setRequiredSingularResourceName(requiredSingularResourceName) - .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) + .setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) + .setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof == null ? null : requiredSingularResourceNameOneof.toString()) .setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) .setRequiredSingularFixed32(requiredSingularFixed32) .setRequiredSingularFixed64(requiredSingularFixed64) @@ -7816,8 +7840,8 @@ public class LibraryClient implements BackgroundResource { .setOptionalSingularString(optionalSingularString) .setOptionalSingularBytes(optionalSingularBytes) .setOptionalSingularMessage(optionalSingularMessage) - .setOptionalSingularResourceName(optionalSingularResourceName) - .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof) + .setOptionalSingularResourceName(optionalSingularResourceName == null ? null : optionalSingularResourceName.toString()) + .setOptionalSingularResourceNameOneof(optionalSingularResourceNameOneof == null ? null : optionalSingularResourceNameOneof.toString()) .setOptionalSingularResourceNameCommon(optionalSingularResourceNameCommon) .setOptionalSingularFixed32(optionalSingularFixed32) .setOptionalSingularFixed64(optionalSingularFixed64) @@ -7888,8 +7912,8 @@ public class LibraryClient implements BackgroundResource { * String requiredSingularString = ""; * ByteString requiredSingularBytes = ByteString.copyFromUtf8(""); * TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - * String formattedRequiredSingularResourceName = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedRequiredSingularResourceNameOneof = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); + * BookName requiredSingularResourceName = ShelfBookName.of("[SHELF]", "[BOOK]"); + * BookName requiredSingularResourceNameOneof = ShelfBookName.of("[SHELF]", "[BOOK]"); * String requiredSingularResourceNameCommon = ""; * int requiredSingularFixed32 = 0; * long requiredSingularFixed64 = 0L; @@ -7949,8 +7973,8 @@ public class LibraryClient implements BackgroundResource { * String optionalSingularString = ""; * ByteString optionalSingularBytes = ByteString.copyFromUtf8(""); * TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage = TestOptionalRequiredFlatteningParamsRequest.InnerMessage.newBuilder().build(); - * String formattedOptionalSingularResourceName = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); - * String formattedOptionalSingularResourceNameOneof = LibraryClient.formatShelfBookName("[SHELF]", "[BOOK]"); + * BookName optionalSingularResourceName = ShelfBookName.of("[SHELF]", "[BOOK]"); + * BookName optionalSingularResourceNameOneof = ShelfBookName.of("[SHELF]", "[BOOK]"); * String optionalSingularResourceNameCommon = ""; * int optionalSingularFixed32 = 0; * long optionalSingularFixed64 = 0L; @@ -8001,7 +8025,7 @@ public class LibraryClient implements BackgroundResource { * List<StringValue> repeatedStringValue = new ArrayList<>(); * List<BoolValue> repeatedBoolValue = new ArrayList<>(); * List<BytesValue> repeatedBytesValue = new ArrayList<>(); - * TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, formattedRequiredSingularResourceName, formattedRequiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, formattedOptionalSingularResourceName, formattedOptionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + * TestOptionalRequiredFlatteningParamsResponse response = libraryClient.testOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName.toString(), requiredSingularResourceNameOneof.toString(), requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName.toString(), optionalSingularResourceNameOneof.toString(), optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); * } *
    * @@ -8548,11 +8572,299 @@ public class LibraryClient implements BackgroundResource { * Sample code: *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   String source = "";
    -   *   String destination = "";
    -   *   List<String> publishers = new ArrayList<>();
    -   *   String project = "";
    -   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, publishers, project);
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    +   * }
    +   * 
    + * + * @param source + * @param destination + * @param publishers + * @param project + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) { + MoveBooksRequest request = + MoveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setDestination(destination == null ? null : destination.toString()) + .addAllPublishers(publishers) + .setProject(project == null ? null : project.toString()) + .build(); + return moveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   List<String> formattedPublishers = new ArrayList<>();
    +   *   ProjectName project = ProjectName.of("[PROJECT]");
    +   *   MoveBooksResponse response = libraryClient.moveBooks(source.toString(), destination.toString(), formattedPublishers, project.toString());
        * }
        * 
    * @@ -8617,8 +8929,8 @@ public class LibraryClient implements BackgroundResource { * Sample code: *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   String source = "";
    -   *   String archive = "";
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
        *   ArchiveBooksResponse response = libraryClient.archiveBooks(source, archive);
        * }
        * 
    @@ -8627,6 +8939,84 @@ public class LibraryClient implements BackgroundResource { * @param archive * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ + public final ArchiveBooksResponse archiveBooks(ArchiveName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryClient.archiveBooks(source, archive);
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ShelfName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryClient.archiveBooks(source, archive);
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ArchiveBooksResponse archiveBooks(ProjectName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return archiveBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryClient.archiveBooks(source.toString(), archive.toString());
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ public final ArchiveBooksResponse archiveBooks(String source, String archive) { ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder() @@ -8680,8 +9070,8 @@ public class LibraryClient implements BackgroundResource { * Sample code: *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   String source = "";
    -   *   String archive = "";
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
        *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source, archive).get();
        * }
        * 
    @@ -8691,6 +9081,87 @@ public class LibraryClient implements BackgroundResource { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ArchiveName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ShelfName source = ShelfName.of("[SHELF]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source, archive).get();
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ShelfName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source, archive).get();
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture longRunningArchiveBooksAsync(ProjectName source, ArchiveName archive) { + ArchiveBooksRequest request = + ArchiveBooksRequest.newBuilder() + .setSource(source == null ? null : source.toString()) + .setArchive(archive == null ? null : archive.toString()) + .build(); + return longRunningArchiveBooksAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveName archive = ArchiveName.of("[ARCHIVE]");
    +   *   ArchiveBooksResponse response = libraryClient.longRunningArchiveBooksAsync(source.toString(), archive.toString()).get();
    +   * }
    +   * 
    + * + * @param source + * @param archive + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture longRunningArchiveBooksAsync(String source, String archive) { ArchiveBooksRequest request = ArchiveBooksRequest.newBuilder() @@ -9067,15 +9538,7 @@ public class LibraryClient implements BackgroundResource { private ListStringsPagedResponse(ListStringsPage page) { super(page, ListStringsFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } @@ -9108,25 +9571,9 @@ public class LibraryClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsResourceName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + + } @@ -9150,15 +9597,7 @@ public class LibraryClient implements BackgroundResource { List pages, int collectionSize) { return new ListStringsFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsResourceName() { - return Iterables.transform(getValues(), new Function() { - @Override - public ResourceName apply(String arg0) { - return UntypedResourceName.parse(arg0); - } - } - ); - } + } public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse< @@ -9187,15 +9626,7 @@ public class LibraryClient implements BackgroundResource { private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) { super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection()); } - public Iterable iterateAllAsBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + } @@ -9228,25 +9659,9 @@ public class LibraryClient implements BackgroundResource { ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } - public Iterable iterateAllAsBookName() { - return Iterables.transform(iterateAll(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } - public Iterable getValuesAsBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + + } @@ -9270,15 +9685,7 @@ public class LibraryClient implements BackgroundResource { List pages, int collectionSize) { return new FindRelatedBooksFixedSizeCollection(pages, collectionSize); } - public Iterable getValuesAsBookName() { - return Iterables.transform(getValues(), new Function() { - @Override - public BookName apply(String arg0) { - return BookName.parse(arg0); - } - } - ); - } + } } @@ -10604,6 +11011,7 @@ import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksMetadata; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -10791,6 +11199,7 @@ import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksMetadata; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -12049,6 +12458,7 @@ import com.google.example.library.v1.AddCommentsRequest; import com.google.example.library.v1.ArchiveBooksMetadata; import com.google.example.library.v1.ArchiveBooksRequest; import com.google.example.library.v1.ArchiveBooksResponse; +import com.google.example.library.v1.ArchiveName; import com.google.example.library.v1.ArchivedBookName; import com.google.example.library.v1.Book; import com.google.example.library.v1.BookFromAnywhere; @@ -15156,7 +15566,7 @@ public class LibraryClientTest { @SuppressWarnings("all") public void listStringsTest() { String nextPageToken = ""; - ResourceName stringsElement = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); List strings = Arrays.asList(stringsElement); ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() .setNextPageToken(nextPageToken) @@ -15169,10 +15579,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -15202,7 +15608,7 @@ public class LibraryClientTest { @SuppressWarnings("all") public void listStringsTest2() { String nextPageToken = ""; - ResourceName stringsElement = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName stringsElement = ArchiveName.of("[ARCHIVE]"); List strings = Arrays.asList(stringsElement); ListStringsResponse expectedResponse = ListStringsResponse.newBuilder() .setNextPageToken(nextPageToken) @@ -15210,17 +15616,13 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); ListStringsPagedResponse pagedListResponse = client.listStrings(name); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -15240,7 +15642,7 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - ResourceName name = ArchivedBookName.of("[ARCHIVE]", "[BOOK]"); + ResourceName name = ArchiveName.of("[ARCHIVE]"); client.listStrings(name); Assert.fail("No exception raised"); @@ -15695,10 +16097,6 @@ public class LibraryClientTest { List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0)); - List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName()); - Assert.assertEquals(1, resourceNames.size()); - Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)), - resourceNames.get(0)); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); @@ -16015,8 +16413,8 @@ public class LibraryClientTest { Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredSingularResourceName, BookNames.parse(actualRequest.getRequiredSingularResourceName())); + Assert.assertEquals(requiredSingularResourceNameOneof, BookNames.parse(actualRequest.getRequiredSingularResourceNameOneof())); Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); @@ -16076,8 +16474,8 @@ public class LibraryClientTest { Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(optionalSingularResourceName, BookNames.parse(actualRequest.getOptionalSingularResourceName())); + Assert.assertEquals(optionalSingularResourceNameOneof, BookNames.parse(actualRequest.getOptionalSingularResourceNameOneof())); Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); @@ -16280,23 +16678,23 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - String source = "source-896505829"; - String destination = "destination-1429847026"; - List publishers = new ArrayList<>(); - String project = "project-309310695"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); MoveBooksResponse actualResponse = - client.moveBooks(source, destination, publishers, project); + client.moveBooks(source, destination, formattedPublishers, project); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockLibraryService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(destination, actualRequest.getDestination()); - Assert.assertEquals(publishers, actualRequest.getPublishersList()); - Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination())); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16310,12 +16708,12 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - String source = "source-896505829"; - String destination = "destination-1429847026"; - List publishers = new ArrayList<>(); - String project = "project-309310695"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ProjectName destination = ProjectName.of("[PROJECT]"); + List formattedPublishers = new ArrayList<>(); + ProjectName project = ProjectName.of("[PROJECT]"); - client.moveBooks(source, destination, publishers, project); + client.moveBooks(source, destination, formattedPublishers, project); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -16331,8 +16729,8 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(expectedResponse); - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); ArchiveBooksResponse actualResponse = client.archiveBooks(source, archive); @@ -16342,8 +16740,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16357,8 +16755,8 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); client.archiveBooks(source, archive); Assert.fail("No exception raised"); @@ -16382,8 +16780,8 @@ public class LibraryClientTest { .build(); mockLibraryService.addResponse(resultOperation); - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); ArchiveBooksResponse actualResponse = client.longRunningArchiveBooksAsync(source, archive).get(); @@ -16393,8 +16791,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); ArchiveBooksRequest actualRequest = (ArchiveBooksRequest)actualRequests.get(0); - Assert.assertEquals(source, actualRequest.getSource()); - Assert.assertEquals(archive, actualRequest.getArchive()); + Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); + Assert.assertEquals(archive, ArchiveName.parse(actualRequest.getArchive())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16408,8 +16806,8 @@ public class LibraryClientTest { mockLibraryService.addException(exception); try { - String source = "source-896505829"; - String archive = "archive-748101438"; + ArchiveName source = ArchiveName.of("[ARCHIVE]"); + ArchiveName archive = ArchiveName.of("[ARCHIVE]"); client.longRunningArchiveBooksAsync(source, archive).get(); Assert.fail("No exception raised"); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/nodejs_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/nodejs_library.baseline index e79bacd6ae..e5326cb789 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/nodejs_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/nodejs_library.baseline @@ -5105,6 +5105,9 @@ class LibraryServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { + archivePathTemplate: new gaxModule.PathTemplate( + 'archives/{archive}' + ), archivedBookPathTemplate: new gaxModule.PathTemplate( 'archives/{archive}/books/{book}' ), @@ -7996,6 +7999,18 @@ class LibraryServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified archive resource name string. + * + * @param {String} archive + * @returns {String} + */ + archivePath(archive) { + return this._pathTemplates.archivePathTemplate.render({ + archive: archive, + }); + } + /** * Return a fully-qualified archived_book resource name string. * @@ -8121,6 +8136,19 @@ class LibraryServiceClient { }); } + /** + * Parse the archiveName from a archive resource. + * + * @param {String} archiveName + * A fully-qualified path representing a archive resources. + * @returns {String} - A string representing the archive. + */ + matchArchiveFromArchiveName(archiveName) { + return this._pathTemplates.archivePathTemplate + .match(archiveName) + .archive; + } + /** * Parse the archivedBookName from a archived_book resource. * diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library.baseline index 696776b423..6c8a565a0a 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library.baseline @@ -2434,6 +2434,7 @@ class LibraryServiceGapicClient 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/library', ]; + private static $archiveNameTemplate; private static $archivedBookNameTemplate; private static $bookNameTemplate; private static $bookFromArchiveNameTemplate; @@ -2465,6 +2466,15 @@ class LibraryServiceGapicClient ]; } + private static function getArchiveNameTemplate() + { + if (self::$archiveNameTemplate == null) { + self::$archiveNameTemplate = new PathTemplate('archives/{archive}'); + } + + return self::$archiveNameTemplate; + } + private static function getArchivedBookNameTemplate() { if (self::$archivedBookNameTemplate == null) { @@ -2551,6 +2561,7 @@ class LibraryServiceGapicClient { if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ + 'archive' => self::getArchiveNameTemplate(), 'archivedBook' => self::getArchivedBookNameTemplate(), 'book' => self::getBookNameTemplate(), 'bookFromArchive' => self::getBookFromArchiveNameTemplate(), @@ -2564,6 +2575,21 @@ class LibraryServiceGapicClient } return self::$pathTemplateMap; } + /** + * Formats a string containing the fully-qualified path to represent + * a archive resource. + * + * @param string $archive + * @return string The formatted archive resource. + * @experimental + */ + public static function archiveName($archive) + { + return self::getArchiveNameTemplate()->render([ + 'archive' => $archive, + ]); + } + /** * Formats a string containing the fully-qualified path to represent * a archived_book resource. @@ -2720,6 +2746,7 @@ class LibraryServiceGapicClient * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - archive: archives/{archive} * - archivedBook: archives/{archive}/books/{book} * - book: shelves/{shelf}/books/{book} * - bookFromArchive: archives/{archive}/books/{book} diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library_with_grpc_service_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library_with_grpc_service_config.baseline index ce021940e2..20fe7adb0b 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library_with_grpc_service_config.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/php_library_with_grpc_service_config.baseline @@ -2434,6 +2434,7 @@ class LibraryServiceGapicClient 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/library', ]; + private static $archiveNameTemplate; private static $archivedBookNameTemplate; private static $bookNameTemplate; private static $bookFromArchiveNameTemplate; @@ -2465,6 +2466,15 @@ class LibraryServiceGapicClient ]; } + private static function getArchiveNameTemplate() + { + if (self::$archiveNameTemplate == null) { + self::$archiveNameTemplate = new PathTemplate('archives/{archive}'); + } + + return self::$archiveNameTemplate; + } + private static function getArchivedBookNameTemplate() { if (self::$archivedBookNameTemplate == null) { @@ -2551,6 +2561,7 @@ class LibraryServiceGapicClient { if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ + 'archive' => self::getArchiveNameTemplate(), 'archivedBook' => self::getArchivedBookNameTemplate(), 'book' => self::getBookNameTemplate(), 'bookFromArchive' => self::getBookFromArchiveNameTemplate(), @@ -2564,6 +2575,21 @@ class LibraryServiceGapicClient } return self::$pathTemplateMap; } + /** + * Formats a string containing the fully-qualified path to represent + * a archive resource. + * + * @param string $archive + * @return string The formatted archive resource. + * @experimental + */ + public static function archiveName($archive) + { + return self::getArchiveNameTemplate()->render([ + 'archive' => $archive, + ]); + } + /** * Formats a string containing the fully-qualified path to represent * a archived_book resource. @@ -2720,6 +2746,7 @@ class LibraryServiceGapicClient * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - archive: archives/{archive} * - archivedBook: archives/{archive}/books/{book} * - book: shelves/{shelf}/books/{book} * - bookFromArchive: archives/{archive}/books/{book} diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/python_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/python_library.baseline index c463402137..8332fe0437 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/python_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/python_library.baseline @@ -1155,6 +1155,14 @@ class LibraryServiceClient(object): from_service_account_json = from_service_account_file + @classmethod + def archive_path(cls, archive): + """Return a fully-qualified archive string.""" + return google.api_core.path_template.expand( + 'archives/{archive}', + archive=archive, + ) + @classmethod def archived_book_path(cls, archive, book): """Return a fully-qualified archived_book string.""" diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library.baseline index 3c648232e3..1268995251 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library.baseline @@ -3021,6 +3021,12 @@ module Library self::GRPC_INTERCEPTORS = LibraryServiceClient::GRPC_INTERCEPTORS end + ARCHIVE_PATH_TEMPLATE = Google::Gax::PathTemplate.new( + "archives/{archive}" + ) + + private_constant :ARCHIVE_PATH_TEMPLATE + ARCHIVED_BOOK_PATH_TEMPLATE = Google::Gax::PathTemplate.new( "archives/{archive}/books/{book}" ) @@ -3075,6 +3081,15 @@ module Library private_constant :SHELF_PATH_TEMPLATE + # Returns a fully-qualified archive resource name string. + # @param archive [String] + # @return [String] + def self.archive_path archive + ARCHIVE_PATH_TEMPLATE.render( + :"archive" => archive + ) + end + # Returns a fully-qualified archived_book resource name string. # @param archive [String] # @param book [String] diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library_no_gapic_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library_no_gapic_config.baseline index e93a14f78d..682e29155d 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library_no_gapic_config.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/ruby_library_no_gapic_config.baseline @@ -2877,6 +2877,12 @@ module Library self::GRPC_INTERCEPTORS = LibraryServiceClient::GRPC_INTERCEPTORS end + ARCHIVE_PATH_TEMPLATE = Google::Gax::PathTemplate.new( + "archives/{archive}" + ) + + private_constant :ARCHIVE_PATH_TEMPLATE + ARCHIVED_BOOK_PATH_TEMPLATE = Google::Gax::PathTemplate.new( "archives/{archive}/books/{book}" ) @@ -2913,6 +2919,15 @@ module Library private_constant :SHELF_PATH_TEMPLATE + # Returns a fully-qualified archive resource name string. + # @param archive [String] + # @return [String] + def self.archive_path archive + ARCHIVE_PATH_TEMPLATE.render( + :"archive" => archive + ) + end + # Returns a fully-qualified archived_book resource name string. # @param archive [String] # @param book [String] From ae3a67a04e8a4c3dc2c6602959f4ec396b43233a Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Tue, 28 Jan 2020 12:14:16 -0800 Subject: [PATCH 16/36] more wip! --- .../api/codegen/config/FieldConfig.java | 7 +- .../api/codegen/config/FlatteningConfig.java | 49 +- .../testdata/csharp/csharp_library.baseline | 664 ++++++++++++------ ...amplegen_config_migration_library.baseline | 592 +++++++++++----- .../gapic/testdata/java/java_library.baseline | 173 ++++- ...amplegen_config_migration_library.baseline | 159 ++++- .../testdata/csharp_library.baseline | 564 +++++++-------- .../testdata/java_library.baseline | 178 +++-- .../java_library_no_gapic_config.baseline | 160 +++-- ..._library_with_grpc_service_config.baseline | 178 +++-- 10 files changed, 1838 insertions(+), 886 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index 14721cf3a5..2c12345c48 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -186,9 +186,6 @@ static FieldConfig createFieldConfig( .setResourceNameConfig(flattenedFieldResourceNameConfig) .setExampleResourceNameConfig(messageFieldResourceNameConfig) .build(); - if (config.getField().isRepeated()) { - config = config.withResourceNameInSampleOnly(); - } return config; } @@ -267,6 +264,10 @@ public FieldConfig getMessageFieldConfig() { getExampleResourceNameConfig()); } + public boolean isRepeatedResourceNameTypeField() { + return getField().isRepeated() && useResourceNameType(); + } + /* * Check that the provided resource name treatment and entityName are valid for the provided field. */ diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 0b325b8ddc..17dd3af839 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -286,7 +286,7 @@ private static List createFlatteningsFromProtoFile( protoParser.hasResourceReference(method.getInputField(parameter).getProtoField()) ? ResourceNameTreatment.STATIC_TYPES : ResourceNameTreatment.NONE); - collectFieldConfigs(flatteningConfigs, fieldConfigs, parameter); + flatteningConfigs = collectFieldConfigs(flatteningConfigs, fieldConfigs, parameter); } // We also generate an overload that all singular resource names are treated as strings, @@ -303,31 +303,42 @@ private static List createFlatteningsFromProtoFile( .collect(ImmutableList.toImmutableList()); } - /** Recursively find all the combinations of FieldConfigs for a method_signature. */ - private static void collectFieldConfigs( + /** + * Find all the combinations of FieldConfigs for a method_signature in a breadth-first search way. + */ + private static List> collectFieldConfigs( List> flatteningConfigs, List fieldConfigs, String parameter) { - int flatteningConfigsCount = flatteningConfigs.size(); + // We always make a deep copy in each round of BFS. This will make the code much cleaner; + // Performance-wise this is not ideal but should be fine because there won't be too + // many flatteningConfigs (should be almost always fewer than 5): + // + // O(method_signatures * resource_name_fields_in_message * resources_per_field) + List> newFlatteningConfigs = new ArrayList<>(); + + // Inserts a dumb element to kick of the search + if (flatteningConfigs.size() == 0) { + flatteningConfigs.add(new LinkedHashMap<>()); + } - if (flatteningConfigsCount == 0) { - for (int j = 0; j < fieldConfigs.size(); j++) { - LinkedHashMap newFlattening = new LinkedHashMap<>(); - newFlattening.put(parameter, fieldConfigs.get(j)); - flatteningConfigs.add(newFlattening); - } - } else { - // Perform a cartesian product between flatteningConfigs and fieldConfigs - for (int i = 0; i < flatteningConfigsCount; i++) { - for (int j = 0; j < fieldConfigs.size() - 1; j++) { - LinkedHashMap newFlattening = - new LinkedHashMap<>(flatteningConfigs.get(i)); - newFlattening.put(parameter, fieldConfigs.get(j)); - flatteningConfigs.add(newFlattening); + for (Map flattening : flatteningConfigs) { + for (FieldConfig fieldConfig : fieldConfigs) { + Map newFlattening = new LinkedHashMap<>(flattening); + + // Types like List will have the same erasure as List, + // so we ignore resource name types on repeated field from API surfaces in Java and + // treat them as normal strings + if (fieldConfig.isRepeatedResourceNameTypeField()) { + newFlattening.put(parameter, fieldConfig.withResourceNameInSampleOnly()); + newFlatteningConfigs.add(newFlattening); + break; } - flatteningConfigs.get(i).put(parameter, fieldConfigs.get(fieldConfigs.size() - 1)); + newFlattening.put(parameter, fieldConfig); + newFlatteningConfigs.add(newFlattening); } } + return newFlatteningConfigs; } private static List createFieldConfigsForParameter( diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 516cba061e..4ee0e0e4b4 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -519,9 +519,9 @@ namespace Google.Example.Library.V1.Samples }; PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over pages (of server-defined size), performing one RPC per page - await response.ForEachAsync((string item) => + await response.ForEachAsync((BookName item) => { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); }); } @@ -593,9 +593,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => { - foreach (string item in page) + foreach (BookName item in page) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } }); @@ -666,10 +666,10 @@ namespace Google.Example.Library.V1.Samples PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - foreach (string item in response) + Page singlePage = await response.ReadPageAsync(pageSize); + foreach (BookName item in response) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -733,20 +733,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = + ShelvesAsShelfNames = { new ShelfName("[SHELF]"), }, }; PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over pages (of server-defined size), performing one RPC per page - await response.ForEachAsync((string item) => + await response.ForEachAsync((BookName item) => { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); }); } @@ -808,11 +808,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = + ShelvesAsShelfNames = { new ShelfName("[SHELF]"), }, @@ -821,9 +821,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => { - foreach (string item in page) + foreach (BookName item in page) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } }); @@ -885,11 +885,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = + ShelvesAsShelfNames = { new ShelfName("[SHELF]"), }, @@ -897,10 +897,10 @@ namespace Google.Example.Library.V1.Samples PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - foreach (string item in response) + Page singlePage = await response.ReadPageAsync(pageSize); + foreach (BookName item in response) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -971,9 +971,9 @@ namespace Google.Example.Library.V1.Samples }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (string item in response) + foreach (BookName item in response) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1044,9 +1044,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required foreach (FindRelatedBooksResponse page in response.asRawResponses()) { - foreach (string item in page) + foreach (BookName item in page) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1117,10 +1117,10 @@ namespace Google.Example.Library.V1.Samples PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - foreach (string item in response) + Page singlePage = response.ReadPage(pageSize); + foreach (BookName item in response) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -1183,20 +1183,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = + ShelvesAsShelfNames = { new ShelfName("[SHELF]"), }, }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (string item in response) + foreach (BookName item in response) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1257,11 +1257,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = + ShelvesAsShelfNames = { new ShelfName("[SHELF]"), }, @@ -1270,9 +1270,9 @@ namespace Google.Example.Library.V1.Samples // Iterate over all response items, lazily performing RPCs as required foreach (FindRelatedBooksResponse page in response.asRawResponses()) { - foreach (string item in page) + foreach (BookName item in page) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1334,11 +1334,11 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = + ShelvesAsShelfNames = { new ShelfName("[SHELF]"), }, @@ -1346,10 +1346,10 @@ namespace Google.Example.Library.V1.Samples PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - foreach (string item in response) + Page singlePage = response.ReadPage(pageSize); + foreach (BookName item in response) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } // Store the pageToken, for when the next page is required. @@ -4182,9 +4182,9 @@ namespace Google.Example.Library.V1.Samples RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -6363,7 +6363,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -6374,7 +6374,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6382,10 +6382,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -6405,7 +6405,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -6416,7 +6416,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6424,10 +6424,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -6449,7 +6449,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -6460,7 +6460,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6468,10 +6468,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -6493,7 +6493,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -6504,7 +6504,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6512,10 +6512,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -6537,7 +6537,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -6548,7 +6548,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6556,10 +6556,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -6581,7 +6581,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -6592,7 +6592,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6600,10 +6600,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -6625,7 +6625,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(request); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -6636,7 +6636,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6644,10 +6644,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -6669,7 +6669,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(request); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -6680,7 +6680,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -6688,10 +6688,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -7340,7 +7340,103 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for FindRelatedBooksAsync - public async Task FindRelatedBooksAsync() + public async Task FindRelatedBooksAsync1() + { + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.FindRelatedBooksAsync(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((BookName item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for FindRelatedBooks + public void FindRelatedBooks1() + { + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedEnumerable response = + libraryServiceClient.FindRelatedBooks(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + foreach (BookName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (FindRelatedBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for FindRelatedBooksAsync + public async Task FindRelatedBooksAsync2() { // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client @@ -7356,7 +7452,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((BookName item) => { // Do something with each item Console.WriteLine(item); @@ -7367,7 +7463,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -7375,10 +7471,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -7388,7 +7484,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for FindRelatedBooks - public void FindRelatedBooks() + public void FindRelatedBooks2() { // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client @@ -7404,7 +7500,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (BookName item in response) { // Do something with each item Console.WriteLine(item); @@ -7415,7 +7511,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -7423,10 +7519,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -7444,18 +7540,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = { }, + ShelvesAsShelfNames = { }, }; // Make the request PagedAsyncEnumerable response = libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((BookName item) => { // Do something with each item Console.WriteLine(item); @@ -7466,7 +7562,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -7474,10 +7570,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -7495,18 +7591,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = { }, + ShelvesAsShelfNames = { }, }; // Make the request PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (BookName item in response) { // Do something with each item Console.WriteLine(item); @@ -7517,7 +7613,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -7525,10 +7621,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -8015,8 +8111,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync2() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -8150,7 +8246,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParams public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -8312,9 +8408,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -8373,9 +8469,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -8412,7 +8508,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -8446,9 +8542,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -8507,9 +8603,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -8546,7 +8642,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -8583,9 +8679,9 @@ namespace Google.Example.Library.V1.Snippets RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -8659,9 +8755,9 @@ namespace Google.Example.Library.V1.Snippets RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -11889,9 +11985,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -11950,9 +12046,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -12153,9 +12249,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -12214,9 +12310,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -12544,9 +12640,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -12605,9 +12701,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -12643,7 +12739,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -12808,9 +12904,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -12869,9 +12965,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -12907,7 +13003,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -12945,9 +13041,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -13026,9 +13122,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -18216,7 +18312,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( @@ -18244,7 +18340,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStrings( @@ -18275,7 +18371,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( IResourceName name, string pageToken = null, int? pageSize = null, @@ -18308,7 +18404,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( IResourceName name, string pageToken = null, int? pageSize = null, @@ -18341,7 +18437,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string name, string pageToken = null, int? pageSize = null, @@ -18374,7 +18470,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string name, string pageToken = null, int? pageSize = null, @@ -18407,7 +18503,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string name, string pageToken = null, int? pageSize = null, @@ -18440,7 +18536,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string name, string pageToken = null, int? pageSize = null, @@ -18465,7 +18561,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -18484,7 +18580,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -20162,7 +20258,159 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( scg::IEnumerable names, scg::IEnumerable shelves, string pageToken = null, @@ -20200,7 +20448,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable FindRelatedBooks( + public virtual gax::PagedEnumerable FindRelatedBooks( scg::IEnumerable names, scg::IEnumerable shelves, string pageToken = null, @@ -20227,7 +20475,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -20246,7 +20494,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable FindRelatedBooks( + public virtual gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -21335,9 +21583,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -21396,9 +21644,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -21460,9 +21708,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -21521,9 +21769,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -21961,9 +22209,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -22022,9 +22270,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -22584,9 +22832,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -22645,9 +22893,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -22709,9 +22957,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -22770,9 +23018,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -27647,12 +27895,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable ListStringsAsync( + public override gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); } /// @@ -27667,12 +27915,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable ListStrings( + public override gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); } /// @@ -28046,12 +28294,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -28066,12 +28314,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable FindRelatedBooks( + public override gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -28524,24 +28772,24 @@ namespace Google.Example.Library.V1 } public partial class ListStringsRequest : gaxgrpc::IPageRequest { } - public partial class ListStringsResponse : gaxgrpc::IPageResponse + public partial class ListStringsResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => Strings.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => StringsAsResourceNames.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } public partial class FindRelatedBooksRequest : gaxgrpc::IPageRequest { } - public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse + public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => Names.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => BookNames.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 8324766509..391644a2d8 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -282,20 +282,20 @@ namespace Google.Example.Library.V1.Samples LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = + ShelvesAsShelfNames = { new ShelfName("[SHELF]"), }, }; PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over pages (of server-defined size), performing one RPC per page - foreach (string item in response) + foreach (BookName item in response) { - string book = item; + BookName book = item; Console.WriteLine($"Here's a related book: {book}"); } } @@ -1079,9 +1079,9 @@ namespace Google.Example.Library.V1.Samples RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -3200,7 +3200,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -3211,7 +3211,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3219,10 +3219,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -3242,7 +3242,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -3253,7 +3253,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3261,10 +3261,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -3286,7 +3286,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -3297,7 +3297,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3305,10 +3305,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -3330,7 +3330,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -3341,7 +3341,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3349,10 +3349,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -3374,7 +3374,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -3385,7 +3385,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3393,10 +3393,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -3418,7 +3418,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -3429,7 +3429,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3437,10 +3437,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -3462,7 +3462,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStringsAsync(request); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((IResourceName item) => { // Do something with each item Console.WriteLine(item); @@ -3473,7 +3473,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3481,10 +3481,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -3506,7 +3506,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.ListStrings(request); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (IResourceName item in response) { // Do something with each item Console.WriteLine(item); @@ -3517,7 +3517,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (IResourceName item in page) { Console.WriteLine(item); } @@ -3525,10 +3525,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (IResourceName item in singlePage) { Console.WriteLine(item); } @@ -4159,7 +4159,103 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for FindRelatedBooksAsync - public async Task FindRelatedBooksAsync() + public async Task FindRelatedBooksAsync1() + { + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.FindRelatedBooksAsync(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((BookName item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for FindRelatedBooks + public void FindRelatedBooks1() + { + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedEnumerable response = + libraryServiceClient.FindRelatedBooks(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + foreach (BookName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (FindRelatedBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for FindRelatedBooksAsync + public async Task FindRelatedBooksAsync2() { // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client @@ -4175,7 +4271,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooksAsync(names, shelves); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((BookName item) => { // Do something with each item Console.WriteLine(item); @@ -4186,7 +4282,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -4194,10 +4290,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -4207,7 +4303,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for FindRelatedBooks - public void FindRelatedBooks() + public void FindRelatedBooks2() { // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client @@ -4223,7 +4319,7 @@ namespace Google.Example.Library.V1.Snippets libraryServiceClient.FindRelatedBooks(names, shelves); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (BookName item in response) { // Do something with each item Console.WriteLine(item); @@ -4234,7 +4330,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -4242,10 +4338,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -4263,18 +4359,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = { }, + ShelvesAsShelfNames = { }, }; // Make the request PagedAsyncEnumerable response = libraryServiceClient.FindRelatedBooksAsync(request); // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((string item) => + await response.ForEachAsync((BookName item) => { // Do something with each item Console.WriteLine(item); @@ -4285,7 +4381,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -4293,10 +4389,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); + Page singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -4314,18 +4410,18 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) FindRelatedBooksRequest request = new FindRelatedBooksRequest { - Names = + BookNames = { new BookName("[SHELF]", "[BOOK]"), }, - Shelves = { }, + ShelvesAsShelfNames = { }, }; // Make the request PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request); // Iterate over all response items, lazily performing RPCs as required - foreach (string item in response) + foreach (BookName item in response) { // Do something with each item Console.WriteLine(item); @@ -4336,7 +4432,7 @@ namespace Google.Example.Library.V1.Snippets { // Do something with each page of items Console.WriteLine("A page of results:"); - foreach (string item in page) + foreach (BookName item in page) { Console.WriteLine(item); } @@ -4344,10 +4440,10 @@ namespace Google.Example.Library.V1.Snippets // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); + Page singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (string item in singlePage) + foreach (BookName item in singlePage) { Console.WriteLine(item); } @@ -4834,8 +4930,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync2() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4937,7 +5033,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for TestOptionalRequiredFlatteningParams public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5067,9 +5163,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -5096,9 +5192,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -5135,7 +5231,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -5169,9 +5265,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -5198,9 +5294,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -5237,7 +5333,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -5274,9 +5370,9 @@ namespace Google.Example.Library.V1.Snippets RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -5318,9 +5414,9 @@ namespace Google.Example.Library.V1.Snippets RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -8486,9 +8582,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -8515,9 +8611,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -8686,9 +8782,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -8715,9 +8811,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -8981,9 +9077,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -9010,9 +9106,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -9048,7 +9144,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -9181,9 +9277,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -9210,9 +9306,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -9248,7 +9344,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -9286,9 +9382,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -9335,9 +9431,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -14493,7 +14589,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( @@ -14521,7 +14617,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => ListStrings( @@ -14552,7 +14648,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( IResourceName name, string pageToken = null, int? pageSize = null, @@ -14585,7 +14681,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( IResourceName name, string pageToken = null, int? pageSize = null, @@ -14618,7 +14714,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string name, string pageToken = null, int? pageSize = null, @@ -14651,7 +14747,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string name, string pageToken = null, int? pageSize = null, @@ -14684,7 +14780,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( string name, string pageToken = null, int? pageSize = null, @@ -14717,7 +14813,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( string name, string pageToken = null, int? pageSize = null, @@ -14742,7 +14838,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( + public virtual gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -14761,7 +14857,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable ListStrings( + public virtual gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -16304,7 +16400,159 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( scg::IEnumerable names, scg::IEnumerable shelves, string pageToken = null, @@ -16342,7 +16590,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable FindRelatedBooks( + public virtual gax::PagedEnumerable FindRelatedBooks( scg::IEnumerable names, scg::IEnumerable shelves, string pageToken = null, @@ -16369,7 +16617,7 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -16388,7 +16636,7 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public virtual gax::PagedEnumerable FindRelatedBooks( + public virtual gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { @@ -17381,9 +17629,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -17410,9 +17658,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -17474,9 +17722,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -17503,9 +17751,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -17847,9 +18095,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -17876,9 +18124,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -18310,9 +18558,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -18339,9 +18587,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -18403,9 +18651,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -18432,9 +18680,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -22349,12 +22597,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable ListStringsAsync( + public override gax::PagedAsyncEnumerable ListStringsAsync( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings); } /// @@ -22369,12 +22617,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable ListStrings( + public override gax::PagedEnumerable ListStrings( ListStringsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListStringsRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings); } /// @@ -22748,12 +22996,12 @@ namespace Google.Example.Library.V1 /// /// A pageable asynchronous sequence of resources. /// - public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( + public override gax::PagedAsyncEnumerable FindRelatedBooksAsync( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -22768,12 +23016,12 @@ namespace Google.Example.Library.V1 /// /// A pageable sequence of resources. /// - public override gax::PagedEnumerable FindRelatedBooks( + public override gax::PagedEnumerable FindRelatedBooks( FindRelatedBooksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FindRelatedBooksRequest(ref request, ref callSettings); - return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); + return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings); } /// @@ -23226,24 +23474,24 @@ namespace Google.Example.Library.V1 } public partial class ListStringsRequest : gaxgrpc::IPageRequest { } - public partial class ListStringsResponse : gaxgrpc::IPageResponse + public partial class ListStringsResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => Strings.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => StringsAsResourceNames.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } public partial class FindRelatedBooksRequest : gaxgrpc::IPageRequest { } - public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse + public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse { /// /// Returns an enumerator that iterates through the resources in this response. /// - public scg::IEnumerator GetEnumerator() => Names.GetEnumerator(); + public scg::IEnumerator GetEnumerator() => BookNames.GetEnumerator(); /// sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline index 4c9aae8059..80c64c5669 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline @@ -731,8 +731,8 @@ public class FindRelatedBooksCallableCallableListOdyssey { .build(); while (true) { FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request); - for (String responseItem : response.getNamesList()) { - String book = responseItem; + for (ShelfBookName responseItem : ShelfBookName.parseList(response.getNamesList())) { + ShelfBookName book = responseItem; System.out.printf("Here's a related book: %s\n", book); } String nextPageToken = response.getNextPageToken(); @@ -779,6 +779,7 @@ package com.google.example.examples.library.v1; import com.google.api.core.ApiFuture; import com.google.example.library.v1.FindRelatedBooksResponse; import com.google.example.library.v1.LibraryClient; +import com.google.example.library.v1.ShelfBookName; import java.util.Arrays; import java.util.List; @@ -790,6 +791,7 @@ public class FindRelatedBooksFlattenedPagedOdyssey { * import com.google.api.core.ApiFuture; * import com.google.example.library.v1.FindRelatedBooksResponse; * import com.google.example.library.v1.LibraryClient; + * import com.google.example.library.v1.ShelfBookName; * import java.util.Arrays; * import java.util.List; */ @@ -805,8 +807,8 @@ public class FindRelatedBooksFlattenedPagedOdyssey { // Do something - for (String responseItem : future.get().iterateAll()) { - String book = responseItem; + for (ShelfBookName responseItem : future.get().iterateAllAsShelfBookName()) { + ShelfBookName book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -882,8 +884,8 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey { // Do something - for (String responseItem : future.get().iterateAll()) { - String book = responseItem; + for (ShelfBookName responseItem : future.get().iterateAllAsShelfBookName()) { + ShelfBookName book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -951,8 +953,8 @@ public class FindRelatedBooksRequestPagedOdyssey { .addAllNames(ShelfBookName.toStringList(names)) .addAllShelves(ShelfName.toStringList(shelves)) .build(); - for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) { - String book = responseItem; + for (ShelfBookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) { + ShelfBookName book = responseItem; System.out.printf("Here's a related book: %s\n", book); } } catch (Exception exception) { @@ -6038,7 +6040,7 @@ public class LibraryClient implements BackgroundResource { *
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (String element : libraryClient.listStrings().iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6059,7 +6061,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6084,7 +6086,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6109,7 +6111,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6133,7 +6135,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6153,7 +6155,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (String element : response.getStringsList()) {
    +   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -6886,7 +6888,36 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
    +   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
    +   *     // doThingsWith(element);
    +   *   }
    +   * }
    +   * 
    + * + * @param names + * @param shelves + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { + FindRelatedBooksRequest request = + FindRelatedBooksRequest.newBuilder() + .addAllNames(names == null ? null : ShelfBookName.toStringList(names)) + .addAllShelves(shelves == null ? null : ShelfName.toStringList(shelves)) + .build(); + return findRelatedBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   String namesElement = "";
    +   *   List<String> names = Arrays.asList(namesElement);
    +   *   List<String> formattedShelves = new ArrayList<>();
    +   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6919,7 +6950,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(ShelfBookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
    +   *   for (ShelfBookName element : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6949,7 +6980,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (ShelfBookName element : future.get().iterateAllAsShelfBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6975,7 +7006,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (String element : response.getNamesList()) {
    +   *     for (ShelfBookName element : ShelfBookName.parseList(response.getNamesList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7573,7 +7604,7 @@ public class LibraryClient implements BackgroundResource {
        * @param repeatedBytesValue
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) {
    +  public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) {
         TestOptionalRequiredFlatteningParamsRequest request =
             TestOptionalRequiredFlatteningParamsRequest.newBuilder()
                 .setRequiredSingularInt32(requiredSingularInt32)
    @@ -7599,9 +7630,9 @@ public class LibraryClient implements BackgroundResource {
                 .addAllRequiredRepeatedString(requiredRepeatedString)
                 .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
                 .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
    -            .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName)
    -            .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof)
    -            .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
    +            .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : ShelfBookName.toStringList(requiredRepeatedResourceName))
    +            .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof))
    +            .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(requiredRepeatedResourceNameCommon))
                 .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
                 .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
                 .putAllRequiredMap(requiredMap)
    @@ -7660,9 +7691,9 @@ public class LibraryClient implements BackgroundResource {
                 .addAllOptionalRepeatedString(optionalRepeatedString)
                 .addAllOptionalRepeatedBytes(optionalRepeatedBytes)
                 .addAllOptionalRepeatedMessage(optionalRepeatedMessage)
    -            .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName)
    -            .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof)
    -            .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon)
    +            .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : ShelfBookName.toStringList(optionalRepeatedResourceName))
    +            .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof))
    +            .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(optionalRepeatedResourceNameCommon))
                 .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32)
                 .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64)
                 .putAllOptionalMap(optionalMap)
    @@ -8773,7 +8804,15 @@ public class LibraryClient implements BackgroundResource {
         private ListStringsPagedResponse(ListStringsPage page) {
           super(page, ListStringsFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -8806,9 +8845,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -8832,7 +8887,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new ListStringsFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
       public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse<
    @@ -8861,7 +8924,15 @@ public class LibraryClient implements BackgroundResource {
         private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) {
           super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsShelfBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -8894,9 +8965,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsShelfBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsShelfBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -8920,7 +9007,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new FindRelatedBooksFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsShelfBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     }
    @@ -14783,6 +14878,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -14827,6 +14926,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -15301,6 +15404,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsShelfBookName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(ShelfBookName.parse(expectedResponse.getNamesList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline
    index 8c7bed4080..448e2f1aeb 100644
    --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline
    +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline
    @@ -630,8 +630,8 @@ public class FindRelatedBooksOdyssey {
             .addAllNames(ShelfBookName.toStringList(names))
             .addAllShelves(ShelfName.toStringList(shelves))
             .build();
    -      for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) {
    -        String book = responseItem;
    +      for (ShelfBookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) {
    +        ShelfBookName book = responseItem;
             System.out.printf("Here's a related book: %s\n", book);
           }
         } catch (Exception exception) {
    @@ -3887,7 +3887,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (String element : libraryClient.listStrings().iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3908,7 +3908,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3933,7 +3933,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchivedBookName.of("[ARCHIVE_PATH]", "[BOOK]");
    -   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3958,7 +3958,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -3982,7 +3982,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4002,7 +4002,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (String element : response.getStringsList()) {
    +   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -4705,7 +4705,36 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
    +   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
    +   *     // doThingsWith(element);
    +   *   }
    +   * }
    +   * 
    + * + * @param names + * @param shelves + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { + FindRelatedBooksRequest request = + FindRelatedBooksRequest.newBuilder() + .addAllNames(names == null ? null : ShelfBookName.toStringList(names)) + .addAllShelves(shelves == null ? null : ShelfName.toStringList(shelves)) + .build(); + return findRelatedBooks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * + * + * Sample code: + *
    
    +   * try (LibraryClient libraryClient = LibraryClient.create()) {
    +   *   String namesElement = "";
    +   *   List<String> names = Arrays.asList(namesElement);
    +   *   List<String> formattedShelves = new ArrayList<>();
    +   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4738,7 +4767,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(ShelfBookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
    +   *   for (ShelfBookName element : libraryClient.findRelatedBooks(request).iterateAllAsShelfBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4768,7 +4797,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (ShelfBookName element : future.get().iterateAllAsShelfBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -4794,7 +4823,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (String element : response.getNamesList()) {
    +   *     for (ShelfBookName element : ShelfBookName.parseList(response.getNamesList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -5328,7 +5357,7 @@ public class LibraryClient implements BackgroundResource {
        * @param repeatedBytesValue
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) {
    +  public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) {
         TestOptionalRequiredFlatteningParamsRequest request =
             TestOptionalRequiredFlatteningParamsRequest.newBuilder()
                 .setRequiredSingularInt32(requiredSingularInt32)
    @@ -5354,9 +5383,9 @@ public class LibraryClient implements BackgroundResource {
                 .addAllRequiredRepeatedString(requiredRepeatedString)
                 .addAllRequiredRepeatedBytes(requiredRepeatedBytes)
                 .addAllRequiredRepeatedMessage(requiredRepeatedMessage)
    -            .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName)
    -            .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof)
    -            .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon)
    +            .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : ShelfBookName.toStringList(requiredRepeatedResourceName))
    +            .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof))
    +            .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(requiredRepeatedResourceNameCommon))
                 .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32)
                 .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64)
                 .putAllRequiredMap(requiredMap)
    @@ -5383,9 +5412,9 @@ public class LibraryClient implements BackgroundResource {
                 .addAllOptionalRepeatedString(optionalRepeatedString)
                 .addAllOptionalRepeatedBytes(optionalRepeatedBytes)
                 .addAllOptionalRepeatedMessage(optionalRepeatedMessage)
    -            .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName)
    -            .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof)
    -            .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon)
    +            .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : ShelfBookName.toStringList(optionalRepeatedResourceName))
    +            .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof))
    +            .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(optionalRepeatedResourceNameCommon))
                 .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32)
                 .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64)
                 .putAllOptionalMap(optionalMap)
    @@ -6272,7 +6301,15 @@ public class LibraryClient implements BackgroundResource {
         private ListStringsPagedResponse(ListStringsPage page) {
           super(page, ListStringsFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -6305,9 +6342,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -6331,7 +6384,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new ListStringsFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
       public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse<
    @@ -6360,7 +6421,15 @@ public class LibraryClient implements BackgroundResource {
         private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) {
           super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsShelfBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -6393,9 +6462,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsShelfBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsShelfBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -6419,7 +6504,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new FindRelatedBooksFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsShelfBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ShelfBookName apply(String arg0) {
    +            return ShelfBookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     }
    @@ -12273,6 +12366,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -12317,6 +12414,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -12782,6 +12883,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsShelfBookName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(ShelfBookName.parse(expectedResponse.getNamesList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline
    index ecd0cd4b77..904893d927 100644
    --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline
    +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline
    @@ -716,9 +716,9 @@ namespace Google.Example.Library.V1.Samples
                 };
                 PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves);
                 // Iterate over pages (of server-defined size), performing one RPC per page
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((BookNameOneof item) =>
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 });
             }
    @@ -790,9 +790,9 @@ namespace Google.Example.Library.V1.Samples
                 // Iterate over all response items, lazily performing RPCs as required
                 await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) =>
                 {
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
    -                    string book = item;
    +                    BookNameOneof book = item;
                         Console.WriteLine($"Here's a related book: {book}");
                     }
                 });
    @@ -863,10 +863,10 @@ namespace Google.Example.Library.V1.Samples
                 PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(names, shelves);
                 // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    -            foreach (string item in response)
    +            Page singlePage = await response.ReadPageAsync(pageSize);
    +            foreach (BookNameOneof item in response)
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 }
                 // Store the pageToken, for when the next page is required.
    @@ -930,20 +930,20 @@ namespace Google.Example.Library.V1.Samples
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves =
    +                ShelvesAsShelfNames =
                     {
                         new ShelfName("[SHELF]"),
                     },
                 };
                 PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request);
                 // Iterate over pages (of server-defined size), performing one RPC per page
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((BookNameOneof item) =>
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 });
             }
    @@ -1005,11 +1005,11 @@ namespace Google.Example.Library.V1.Samples
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves =
    +                ShelvesAsShelfNames =
                     {
                         new ShelfName("[SHELF]"),
                     },
    @@ -1018,9 +1018,9 @@ namespace Google.Example.Library.V1.Samples
                 // Iterate over all response items, lazily performing RPCs as required
                 await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) =>
                 {
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
    -                    string book = item;
    +                    BookNameOneof book = item;
                         Console.WriteLine($"Here's a related book: {book}");
                     }
                 });
    @@ -1082,11 +1082,11 @@ namespace Google.Example.Library.V1.Samples
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves =
    +                ShelvesAsShelfNames =
                     {
                         new ShelfName("[SHELF]"),
                     },
    @@ -1094,10 +1094,10 @@ namespace Google.Example.Library.V1.Samples
                 PagedAsyncEnumerable response = await libraryServiceClient.FindRelatedBooksAsync(request);
                 // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    -            foreach (string item in response)
    +            Page singlePage = await response.ReadPageAsync(pageSize);
    +            foreach (BookNameOneof item in response)
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 }
                 // Store the pageToken, for when the next page is required.
    @@ -1168,9 +1168,9 @@ namespace Google.Example.Library.V1.Samples
                 };
                 PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves);
                 // Iterate over pages (of server-defined size), performing one RPC per page
    -            foreach (string item in response)
    +            foreach (BookNameOneof item in response)
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 }
             }
    @@ -1241,9 +1241,9 @@ namespace Google.Example.Library.V1.Samples
                 // Iterate over all response items, lazily performing RPCs as required
                 foreach (FindRelatedBooksResponse page in response.asRawResponses())
                 {
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
    -                    string book = item;
    +                    BookNameOneof book = item;
                         Console.WriteLine($"Here's a related book: {book}");
                     }
                 }
    @@ -1314,10 +1314,10 @@ namespace Google.Example.Library.V1.Samples
                 PagedEnumerable response = libraryServiceClient.FindRelatedBooks(names, shelves);
                 // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    -            foreach (string item in response)
    +            Page singlePage = response.ReadPage(pageSize);
    +            foreach (BookNameOneof item in response)
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 }
                 // Store the pageToken, for when the next page is required.
    @@ -1380,20 +1380,20 @@ namespace Google.Example.Library.V1.Samples
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves =
    +                ShelvesAsShelfNames =
                     {
                         new ShelfName("[SHELF]"),
                     },
                 };
                 PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request);
                 // Iterate over pages (of server-defined size), performing one RPC per page
    -            foreach (string item in response)
    +            foreach (BookNameOneof item in response)
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 }
             }
    @@ -1454,11 +1454,11 @@ namespace Google.Example.Library.V1.Samples
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves =
    +                ShelvesAsShelfNames =
                     {
                         new ShelfName("[SHELF]"),
                     },
    @@ -1467,9 +1467,9 @@ namespace Google.Example.Library.V1.Samples
                 // Iterate over all response items, lazily performing RPCs as required
                 foreach (FindRelatedBooksResponse page in response.asRawResponses())
                 {
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
    -                    string book = item;
    +                    BookNameOneof book = item;
                         Console.WriteLine($"Here's a related book: {book}");
                     }
                 }
    @@ -1531,11 +1531,11 @@ namespace Google.Example.Library.V1.Samples
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves =
    +                ShelvesAsShelfNames =
                     {
                         new ShelfName("[SHELF]"),
                     },
    @@ -1543,10 +1543,10 @@ namespace Google.Example.Library.V1.Samples
                 PagedEnumerable response = libraryServiceClient.FindRelatedBooks(request);
                 // Retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    -            foreach (string item in response)
    +            Page singlePage = response.ReadPage(pageSize);
    +            foreach (BookNameOneof item in response)
                 {
    -                string book = item;
    +                BookNameOneof book = item;
                     Console.WriteLine($"Here's a related book: {book}");
                 }
                 // Store the pageToken, for when the next page is required.
    @@ -4224,8 +4224,8 @@ namespace Google.Example.Library.V1.Samples
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceName = { },
    -                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameAsBookNameOneofs = { },
    +                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
                     RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
    @@ -6447,7 +6447,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStringsAsync();
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((IResourceName item) =>
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6458,7 +6458,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6466,10 +6466,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    +            Page singlePage = await response.ReadPageAsync(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -6489,7 +6489,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStrings();
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            foreach (string item in response)
    +            foreach (IResourceName item in response)
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6500,7 +6500,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6508,10 +6508,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    +            Page singlePage = response.ReadPage(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -6533,7 +6533,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStringsAsync(name);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((IResourceName item) =>
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6544,7 +6544,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6552,10 +6552,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    +            Page singlePage = await response.ReadPageAsync(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -6577,7 +6577,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStrings(name);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            foreach (string item in response)
    +            foreach (IResourceName item in response)
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6588,7 +6588,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6596,10 +6596,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    +            Page singlePage = response.ReadPage(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -6621,7 +6621,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStringsAsync(name);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((IResourceName item) =>
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6632,7 +6632,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6640,10 +6640,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    +            Page singlePage = await response.ReadPageAsync(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -6665,7 +6665,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStrings(name);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            foreach (string item in response)
    +            foreach (IResourceName item in response)
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6676,7 +6676,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6684,10 +6684,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    +            Page singlePage = response.ReadPage(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -6709,7 +6709,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStringsAsync(request);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((IResourceName item) =>
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6720,7 +6720,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6728,10 +6728,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    +            Page singlePage = await response.ReadPageAsync(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -6753,7 +6753,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.ListStrings(request);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            foreach (string item in response)
    +            foreach (IResourceName item in response)
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -6764,7 +6764,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (IResourceName item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -6772,10 +6772,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    +            Page singlePage = response.ReadPage(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (IResourceName item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -7440,7 +7440,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.FindRelatedBooksAsync(names, shelves);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((BookNameOneof item) =>
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -7451,7 +7451,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -7459,10 +7459,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    +            Page singlePage = await response.ReadPageAsync(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (BookNameOneof item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -7488,7 +7488,7 @@ namespace Google.Example.Library.V1.Snippets
                     libraryServiceClient.FindRelatedBooks(names, shelves);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            foreach (string item in response)
    +            foreach (BookNameOneof item in response)
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -7499,7 +7499,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -7507,10 +7507,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    +            Page singlePage = response.ReadPage(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (BookNameOneof item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -7528,18 +7528,18 @@ namespace Google.Example.Library.V1.Snippets
                 // Initialize request argument(s)
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves = { },
    +                ShelvesAsShelfNames = { },
                 };
                 // Make the request
                 PagedAsyncEnumerable response =
                     libraryServiceClient.FindRelatedBooksAsync(request);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((string item) =>
    +            await response.ForEachAsync((BookNameOneof item) =>
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -7550,7 +7550,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -7558,10 +7558,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    +            Page singlePage = await response.ReadPageAsync(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (BookNameOneof item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -7579,18 +7579,18 @@ namespace Google.Example.Library.V1.Snippets
                 // Initialize request argument(s)
                 FindRelatedBooksRequest request = new FindRelatedBooksRequest
                 {
    -                Names =
    +                BookNameOneofs =
                     {
                         BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")),
                     },
    -                Shelves = { },
    +                ShelvesAsShelfNames = { },
                 };
                 // Make the request
                 PagedEnumerable response =
                     libraryServiceClient.FindRelatedBooks(request);
     
                 // Iterate over all response items, lazily performing RPCs as required
    -            foreach (string item in response)
    +            foreach (BookNameOneof item in response)
                 {
                     // Do something with each item
                     Console.WriteLine(item);
    @@ -7601,7 +7601,7 @@ namespace Google.Example.Library.V1.Snippets
                 {
                     // Do something with each page of items
                     Console.WriteLine("A page of results:");
    -                foreach (string item in page)
    +                foreach (BookNameOneof item in page)
                     {
                         Console.WriteLine(item);
                     }
    @@ -7609,10 +7609,10 @@ namespace Google.Example.Library.V1.Snippets
     
                 // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
                 int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    +            Page singlePage = response.ReadPage(pageSize);
                 // Do something with the page of items
                 Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (string item in singlePage)
    +            foreach (BookNameOneof item in singlePage)
                 {
                     Console.WriteLine(item);
                 }
    @@ -8638,8 +8638,8 @@ namespace Google.Example.Library.V1.Snippets
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceName = { },
    -                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameAsBookNameOneofs = { },
    +                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
                     RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
    @@ -8714,8 +8714,8 @@ namespace Google.Example.Library.V1.Snippets
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceName = { },
    -                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameAsBookNameOneofs = { },
    +                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
                     RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
    @@ -8761,13 +8761,13 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync1()
             {
    -            // Snippet: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8778,12 +8778,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks1()
             {
    -            // Snippet: MoveBooks(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8794,13 +8794,13 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync2()
             {
    -            // Snippet: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8811,12 +8811,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks2()
             {
    -            // Snippet: MoveBooks(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8827,12 +8827,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync3()
             {
    -            // Snippet: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
    -            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
                 ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -8844,11 +8844,11 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks3()
             {
    -            // Snippet: MoveBooks(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
    -            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
                 ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -8860,12 +8860,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync4()
             {
    -            // Snippet: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -8877,11 +8877,11 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks4()
             {
    -            // Snippet: MoveBooks(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -8893,12 +8893,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync5()
             {
    -            // Snippet: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -8910,11 +8910,11 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks5()
             {
    -            // Snippet: MoveBooks(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -8926,13 +8926,13 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync6()
             {
    -            // Snippet: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
                 ShelfName source = new ShelfName("[SHELF]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8943,12 +8943,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks6()
             {
    -            // Snippet: MoveBooks(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
                 ShelfName source = new ShelfName("[SHELF]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8959,13 +8959,13 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync7()
             {
    -            // Snippet: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8976,12 +8976,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks7()
             {
    -            // Snippet: MoveBooks(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -8992,13 +8992,13 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync8()
             {
    -            // Snippet: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -9009,12 +9009,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks8()
             {
    -            // Snippet: MoveBooks(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -9025,13 +9025,13 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooksAsync
             public async Task MoveBooksAsync9()
             {
    -            // Snippet: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings)
    -            // Additional: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CancellationToken)
    +            // Snippet: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings)
    +            // Additional: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -9042,12 +9042,12 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for MoveBooks
             public void MoveBooks9()
             {
    -            // Snippet: MoveBooks(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings)
    +            // Snippet: MoveBooks(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -9064,7 +9064,7 @@ namespace Google.Example.Library.V1.Snippets
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable formattedPublishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -9080,7 +9080,7 @@ namespace Google.Example.Library.V1.Snippets
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable formattedPublishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 // Make the request
    @@ -13861,8 +13861,8 @@ namespace Google.Example.Library.V1.Tests
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceName = { },
    -                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameAsBookNameOneofs = { },
    +                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
                     RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
    @@ -13942,8 +13942,8 @@ namespace Google.Example.Library.V1.Tests
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceName = { },
    -                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameAsBookNameOneofs = { },
    +                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
                     RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
    @@ -14001,7 +14001,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    -                DestinationAsProjectName = new ProjectName("[PROJECT]"),
    +                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14013,7 +14013,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project);
    @@ -14032,7 +14032,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    -                DestinationAsProjectName = new ProjectName("[PROJECT]"),
    +                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14044,7 +14044,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project);
    @@ -14062,8 +14062,8 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsShelfName = new ShelfName("[SHELF]"),
    -                DestinationAsProjectName = new ProjectName("[PROJECT]"),
    +                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                DestinationAsShelfName = new ShelfName("[SHELF]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14074,8 +14074,8 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny()))
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project);
    @@ -14093,8 +14093,8 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsShelfName = new ShelfName("[SHELF]"),
    -                DestinationAsProjectName = new ProjectName("[PROJECT]"),
    +                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                DestinationAsShelfName = new ShelfName("[SHELF]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14105,8 +14105,8 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny()))
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project);
    @@ -14124,7 +14124,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsProjectName = new ProjectName("[PROJECT]"),
    +                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     DestinationAsProjectName = new ProjectName("[PROJECT]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
    @@ -14136,7 +14136,7 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny()))
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
                 ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -14155,7 +14155,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsProjectName = new ProjectName("[PROJECT]"),
    +                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     DestinationAsProjectName = new ProjectName("[PROJECT]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
    @@ -14167,7 +14167,7 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny()))
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName source = new ArchiveName("[ARCHIVE]");
                 ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -14186,7 +14186,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                SourceAsShelfName = new ShelfName("[SHELF]"),
                     DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
    @@ -14198,7 +14198,7 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny()))
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -14217,7 +14217,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                SourceAsShelfName = new ShelfName("[SHELF]"),
                     DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
    @@ -14229,7 +14229,7 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny()))
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -14248,7 +14248,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                SourceAsShelfName = new ShelfName("[SHELF]"),
                     DestinationAsShelfName = new ShelfName("[SHELF]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
    @@ -14260,7 +14260,7 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny()))
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -14279,7 +14279,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                SourceAsShelfName = new ShelfName("[SHELF]"),
                     DestinationAsShelfName = new ShelfName("[SHELF]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
    @@ -14291,7 +14291,7 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny()))
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ArchiveName source = new ArchiveName("[ARCHIVE]");
    +            ShelfName source = new ShelfName("[SHELF]");
                 ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
    @@ -14311,7 +14311,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsShelfName = new ShelfName("[SHELF]"),
    -                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                DestinationAsProjectName = new ProjectName("[PROJECT]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14323,7 +14323,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ShelfName source = new ShelfName("[SHELF]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project);
    @@ -14342,7 +14342,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsShelfName = new ShelfName("[SHELF]"),
    -                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                DestinationAsProjectName = new ProjectName("[PROJECT]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14354,7 +14354,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ShelfName source = new ShelfName("[SHELF]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project);
    @@ -14372,8 +14372,8 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsShelfName = new ShelfName("[SHELF]"),
    -                DestinationAsShelfName = new ShelfName("[SHELF]"),
    +                SourceAsProjectName = new ProjectName("[PROJECT]"),
    +                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14384,8 +14384,8 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny()))
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project);
    @@ -14403,8 +14403,8 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Mock().Object);
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
    -                SourceAsShelfName = new ShelfName("[SHELF]"),
    -                DestinationAsShelfName = new ShelfName("[SHELF]"),
    +                SourceAsProjectName = new ProjectName("[PROJECT]"),
    +                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14415,8 +14415,8 @@ namespace Google.Example.Library.V1.Tests
                 mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny()))
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
    -            ShelfName source = new ShelfName("[SHELF]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName source = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project);
    @@ -14435,7 +14435,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsProjectName = new ProjectName("[PROJECT]"),
    -                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                DestinationAsShelfName = new ShelfName("[SHELF]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14447,7 +14447,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project);
    @@ -14466,7 +14466,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsProjectName = new ProjectName("[PROJECT]"),
    -                DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"),
    +                DestinationAsShelfName = new ShelfName("[SHELF]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14478,7 +14478,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ArchiveName destination = new ArchiveName("[ARCHIVE]");
    +            ShelfName destination = new ShelfName("[SHELF]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project);
    @@ -14497,7 +14497,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsProjectName = new ProjectName("[PROJECT]"),
    -                DestinationAsShelfName = new ShelfName("[SHELF]"),
    +                DestinationAsProjectName = new ProjectName("[PROJECT]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14509,7 +14509,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project);
    @@ -14528,7 +14528,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     SourceAsProjectName = new ProjectName("[PROJECT]"),
    -                DestinationAsShelfName = new ShelfName("[SHELF]"),
    +                DestinationAsProjectName = new ProjectName("[PROJECT]"),
                     Publishers = { },
                     ProjectAsProjectName = new ProjectName("[PROJECT]"),
                 };
    @@ -14540,7 +14540,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ProjectName source = new ProjectName("[PROJECT]");
    -            ShelfName destination = new ShelfName("[SHELF]");
    +            ProjectName destination = new ProjectName("[PROJECT]");
                 IEnumerable publishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project);
    @@ -14559,7 +14559,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     Source = new ArchiveName("[ARCHIVE]"),
    -                Destination = new ProjectName("[PROJECT]"),
    +                Destination = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     Project = new ProjectName("[PROJECT]"),
                 };
    @@ -14571,7 +14571,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(expectedResponse);
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable formattedPublishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = client.MoveBooks(source, destination, formattedPublishers, project);
    @@ -14590,7 +14590,7 @@ namespace Google.Example.Library.V1.Tests
                 MoveBooksRequest expectedRequest = new MoveBooksRequest
                 {
                     Source = new ArchiveName("[ARCHIVE]"),
    -                Destination = new ProjectName("[PROJECT]"),
    +                Destination = new ArchiveName("[ARCHIVE]"),
                     Publishers = { },
                     Project = new ProjectName("[PROJECT]"),
                 };
    @@ -14602,7 +14602,7 @@ namespace Google.Example.Library.V1.Tests
                     .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null));
                 LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null);
                 ArchiveName source = new ArchiveName("[ARCHIVE]");
    -            ProjectName destination = new ProjectName("[PROJECT]");
    +            ArchiveName destination = new ArchiveName("[ARCHIVE]");
                 IEnumerable formattedPublishers = new List();
                 ProjectName project = new ProjectName("[PROJECT]");
                 MoveBooksResponse response = await client.MoveBooksAsync(source, destination, formattedPublishers, project);
    @@ -20250,7 +20250,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
    +        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
                 string pageToken = null,
                 int? pageSize = null,
                 gaxgrpc::CallSettings callSettings = null) => ListStringsAsync(
    @@ -20278,7 +20278,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public virtual gax::PagedEnumerable ListStrings(
    +        public virtual gax::PagedEnumerable ListStrings(
                 string pageToken = null,
                 int? pageSize = null,
                 gaxgrpc::CallSettings callSettings = null) => ListStrings(
    @@ -20309,7 +20309,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
    +        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
                 IResourceName name,
                 string pageToken = null,
                 int? pageSize = null,
    @@ -20342,7 +20342,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public virtual gax::PagedEnumerable ListStrings(
    +        public virtual gax::PagedEnumerable ListStrings(
                 IResourceName name,
                 string pageToken = null,
                 int? pageSize = null,
    @@ -20375,7 +20375,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
    +        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
                 string name,
                 string pageToken = null,
                 int? pageSize = null,
    @@ -20408,7 +20408,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public virtual gax::PagedEnumerable ListStrings(
    +        public virtual gax::PagedEnumerable ListStrings(
                 string name,
                 string pageToken = null,
                 int? pageSize = null,
    @@ -20441,7 +20441,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
    +        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
                 string name,
                 string pageToken = null,
                 int? pageSize = null,
    @@ -20474,7 +20474,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public virtual gax::PagedEnumerable ListStrings(
    +        public virtual gax::PagedEnumerable ListStrings(
                 string name,
                 string pageToken = null,
                 int? pageSize = null,
    @@ -20499,7 +20499,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
    +        public virtual gax::PagedAsyncEnumerable ListStringsAsync(
                 ListStringsRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
    @@ -20518,7 +20518,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public virtual gax::PagedEnumerable ListStrings(
    +        public virtual gax::PagedEnumerable ListStrings(
                 ListStringsRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
    @@ -22163,7 +22163,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
    +        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
                 scg::IEnumerable names,
                 scg::IEnumerable shelves,
                 string pageToken = null,
    @@ -22201,7 +22201,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public virtual gax::PagedEnumerable FindRelatedBooks(
    +        public virtual gax::PagedEnumerable FindRelatedBooks(
                 scg::IEnumerable names,
                 scg::IEnumerable shelves,
                 string pageToken = null,
    @@ -22228,7 +22228,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
    +        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
                 FindRelatedBooksRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
    @@ -22247,7 +22247,7 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public virtual gax::PagedEnumerable FindRelatedBooks(
    +        public virtual gax::PagedEnumerable FindRelatedBooks(
                 FindRelatedBooksRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
    @@ -28563,14 +28563,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ArchiveName source,
    -            ProjectName destination,
    +            ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
                         SourceAsArchiveName = source, // Optional
    -                    DestinationAsProjectName = destination, // Optional
    +                    DestinationAsArchiveName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -28599,7 +28599,7 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ArchiveName source,
    -            ProjectName destination,
    +            ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 st::CancellationToken cancellationToken) => MoveBooksAsync(
    @@ -28632,14 +28632,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual MoveBooksResponse MoveBooks(
                 ArchiveName source,
    -            ProjectName destination,
    +            ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
                         SourceAsArchiveName = source, // Optional
    -                    DestinationAsProjectName = destination, // Optional
    +                    DestinationAsArchiveName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -28772,15 +28772,15 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ShelfName source,
    -            ProjectName destination,
    +            ArchiveName source,
    +            ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
    -                    SourceAsShelfName = source, // Optional
    -                    DestinationAsProjectName = destination, // Optional
    +                    SourceAsArchiveName = source, // Optional
    +                    DestinationAsShelfName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -28808,8 +28808,8 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ShelfName source,
    -            ProjectName destination,
    +            ArchiveName source,
    +            ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 st::CancellationToken cancellationToken) => MoveBooksAsync(
    @@ -28841,15 +28841,15 @@ namespace Google.Example.Library.V1
             /// The RPC response.
             /// 
             public virtual MoveBooksResponse MoveBooks(
    -            ShelfName source,
    -            ProjectName destination,
    +            ArchiveName source,
    +            ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
    -                    SourceAsShelfName = source, // Optional
    -                    DestinationAsProjectName = destination, // Optional
    +                    SourceAsArchiveName = source, // Optional
    +                    DestinationAsShelfName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -28982,14 +28982,14 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ProjectName source,
    +            ArchiveName source,
                 ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
    -                    SourceAsProjectName = source, // Optional
    +                    SourceAsArchiveName = source, // Optional
                         DestinationAsProjectName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
    @@ -29018,7 +29018,7 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ProjectName source,
    +            ArchiveName source,
                 ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
    @@ -29051,14 +29051,14 @@ namespace Google.Example.Library.V1
             /// The RPC response.
             /// 
             public virtual MoveBooksResponse MoveBooks(
    -            ProjectName source,
    +            ArchiveName source,
                 ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
    -                    SourceAsProjectName = source, // Optional
    +                    SourceAsArchiveName = source, // Optional
                         DestinationAsProjectName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
    @@ -29192,14 +29192,14 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ArchiveName source,
    +            ShelfName source,
                 ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
    -                    SourceAsArchiveName = source, // Optional
    +                    SourceAsShelfName = source, // Optional
                         DestinationAsArchiveName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
    @@ -29228,7 +29228,7 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ArchiveName source,
    +            ShelfName source,
                 ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
    @@ -29261,14 +29261,14 @@ namespace Google.Example.Library.V1
             /// The RPC response.
             /// 
             public virtual MoveBooksResponse MoveBooks(
    -            ArchiveName source,
    +            ShelfName source,
                 ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
    -                    SourceAsArchiveName = source, // Optional
    +                    SourceAsShelfName = source, // Optional
                         DestinationAsArchiveName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
    @@ -29402,14 +29402,14 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ArchiveName source,
    +            ShelfName source,
                 ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
    -                    SourceAsArchiveName = source, // Optional
    +                    SourceAsShelfName = source, // Optional
                         DestinationAsShelfName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
    @@ -29438,7 +29438,7 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ArchiveName source,
    +            ShelfName source,
                 ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
    @@ -29471,14 +29471,14 @@ namespace Google.Example.Library.V1
             /// The RPC response.
             /// 
             public virtual MoveBooksResponse MoveBooks(
    -            ArchiveName source,
    +            ShelfName source,
                 ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
    -                    SourceAsArchiveName = source, // Optional
    +                    SourceAsShelfName = source, // Optional
                         DestinationAsShelfName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
    @@ -29613,14 +29613,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ShelfName source,
    -            ArchiveName destination,
    +            ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
                         SourceAsShelfName = source, // Optional
    -                    DestinationAsArchiveName = destination, // Optional
    +                    DestinationAsProjectName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -29649,7 +29649,7 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ShelfName source,
    -            ArchiveName destination,
    +            ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 st::CancellationToken cancellationToken) => MoveBooksAsync(
    @@ -29682,14 +29682,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual MoveBooksResponse MoveBooks(
                 ShelfName source,
    -            ArchiveName destination,
    +            ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
                         SourceAsShelfName = source, // Optional
    -                    DestinationAsArchiveName = destination, // Optional
    +                    DestinationAsProjectName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -29822,15 +29822,15 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ShelfName source,
    -            ShelfName destination,
    +            ProjectName source,
    +            ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
    -                    SourceAsShelfName = source, // Optional
    -                    DestinationAsShelfName = destination, // Optional
    +                    SourceAsProjectName = source, // Optional
    +                    DestinationAsArchiveName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -29858,8 +29858,8 @@ namespace Google.Example.Library.V1
             /// A Task containing the RPC response.
             /// 
             public virtual stt::Task MoveBooksAsync(
    -            ShelfName source,
    -            ShelfName destination,
    +            ProjectName source,
    +            ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 st::CancellationToken cancellationToken) => MoveBooksAsync(
    @@ -29891,15 +29891,15 @@ namespace Google.Example.Library.V1
             /// The RPC response.
             /// 
             public virtual MoveBooksResponse MoveBooks(
    -            ShelfName source,
    -            ShelfName destination,
    +            ProjectName source,
    +            ArchiveName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
    -                    SourceAsShelfName = source, // Optional
    -                    DestinationAsShelfName = destination, // Optional
    +                    SourceAsProjectName = source, // Optional
    +                    DestinationAsArchiveName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -30033,14 +30033,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ProjectName source,
    -            ArchiveName destination,
    +            ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
                         SourceAsProjectName = source, // Optional
    -                    DestinationAsArchiveName = destination, // Optional
    +                    DestinationAsShelfName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -30069,7 +30069,7 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ProjectName source,
    -            ArchiveName destination,
    +            ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 st::CancellationToken cancellationToken) => MoveBooksAsync(
    @@ -30102,14 +30102,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual MoveBooksResponse MoveBooks(
                 ProjectName source,
    -            ArchiveName destination,
    +            ShelfName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
                         SourceAsProjectName = source, // Optional
    -                    DestinationAsArchiveName = destination, // Optional
    +                    DestinationAsShelfName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -30243,14 +30243,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ProjectName source,
    -            ShelfName destination,
    +            ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync(
                     new MoveBooksRequest
                     {
                         SourceAsProjectName = source, // Optional
    -                    DestinationAsShelfName = destination, // Optional
    +                    DestinationAsProjectName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -30279,7 +30279,7 @@ namespace Google.Example.Library.V1
             /// 
             public virtual stt::Task MoveBooksAsync(
                 ProjectName source,
    -            ShelfName destination,
    +            ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 st::CancellationToken cancellationToken) => MoveBooksAsync(
    @@ -30312,14 +30312,14 @@ namespace Google.Example.Library.V1
             /// 
             public virtual MoveBooksResponse MoveBooks(
                 ProjectName source,
    -            ShelfName destination,
    +            ProjectName destination,
                 scg::IEnumerable publishers,
                 ProjectName project,
                 gaxgrpc::CallSettings callSettings = null) => MoveBooks(
                     new MoveBooksRequest
                     {
                         SourceAsProjectName = source, // Optional
    -                    DestinationAsShelfName = destination, // Optional
    +                    DestinationAsProjectName = destination, // Optional
                         Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional
                         ProjectAsProjectName = project, // Optional
                     },
    @@ -32755,12 +32755,12 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public override gax::PagedAsyncEnumerable ListStringsAsync(
    +        public override gax::PagedAsyncEnumerable ListStringsAsync(
                 ListStringsRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
                 Modify_ListStringsRequest(ref request, ref callSettings);
    -            return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings);
    +            return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListStrings, request, callSettings);
             }
     
             /// 
    @@ -32775,12 +32775,12 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public override gax::PagedEnumerable ListStrings(
    +        public override gax::PagedEnumerable ListStrings(
                 ListStringsRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
                 Modify_ListStringsRequest(ref request, ref callSettings);
    -            return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings);
    +            return new gaxgrpc::GrpcPagedEnumerable(_callListStrings, request, callSettings);
             }
     
             /// 
    @@ -33154,12 +33154,12 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable asynchronous sequence of  resources.
             /// 
    -        public override gax::PagedAsyncEnumerable FindRelatedBooksAsync(
    +        public override gax::PagedAsyncEnumerable FindRelatedBooksAsync(
                 FindRelatedBooksRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
                 Modify_FindRelatedBooksRequest(ref request, ref callSettings);
    -            return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings);
    +            return new gaxgrpc::GrpcPagedAsyncEnumerable(_callFindRelatedBooks, request, callSettings);
             }
     
             /// 
    @@ -33174,12 +33174,12 @@ namespace Google.Example.Library.V1
             /// 
             /// A pageable sequence of  resources.
             /// 
    -        public override gax::PagedEnumerable FindRelatedBooks(
    +        public override gax::PagedEnumerable FindRelatedBooks(
                 FindRelatedBooksRequest request,
                 gaxgrpc::CallSettings callSettings = null)
             {
                 Modify_FindRelatedBooksRequest(ref request, ref callSettings);
    -            return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings);
    +            return new gaxgrpc::GrpcPagedEnumerable(_callFindRelatedBooks, request, callSettings);
             }
     
             /// 
    @@ -33639,24 +33639,24 @@ namespace Google.Example.Library.V1
         }
     
         public partial class ListStringsRequest : gaxgrpc::IPageRequest { }
    -    public partial class ListStringsResponse : gaxgrpc::IPageResponse
    +    public partial class ListStringsResponse : gaxgrpc::IPageResponse
         {
             /// 
             /// Returns an enumerator that iterates through the resources in this response.
             /// 
    -        public scg::IEnumerator GetEnumerator() => Strings.GetEnumerator();
    +        public scg::IEnumerator GetEnumerator() => StringsAsResourceNames.GetEnumerator();
     
             /// 
             sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator();
         }
     
         public partial class FindRelatedBooksRequest : gaxgrpc::IPageRequest { }
    -    public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse
    +    public partial class FindRelatedBooksResponse : gaxgrpc::IPageResponse
         {
             /// 
             /// Returns an enumerator that iterates through the resources in this response.
             /// 
    -        public scg::IEnumerator GetEnumerator() => Names.GetEnumerator();
    +        public scg::IEnumerator GetEnumerator() => BookNameOneofs.GetEnumerator();
     
             /// 
             sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator();
    diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline
    index 89968cb658..031dd67044 100644
    --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline
    +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline
    @@ -748,8 +748,8 @@ public class FindRelatedBooksCallableCallableListOdyssey {
             .build();
           while (true) {
             FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -        for (String responseItem : response.getNamesList()) {
    -          String book = responseItem;
    +        for (BookName responseItem : BookName.parseList(response.getNamesList())) {
    +          BookName book = responseItem;
               System.out.printf("Here's a related book: %s\n", book);
             }
             String nextPageToken = response.getNextPageToken();
    @@ -794,6 +794,7 @@ public class FindRelatedBooksCallableCallableListOdyssey {
     package com.google.example.examples.library.v1;
     
     import com.google.api.core.ApiFuture;
    +import com.google.example.library.v1.BookName;
     import com.google.example.library.v1.FindRelatedBooksResponse;
     import com.google.example.library.v1.LibraryClient;
     import java.util.Arrays;
    @@ -805,6 +806,7 @@ public class FindRelatedBooksFlattenedPagedOdyssey {
        * Please include the following imports to run this sample.
        *
        * import com.google.api.core.ApiFuture;
    +   * import com.google.example.library.v1.BookName;
        * import com.google.example.library.v1.FindRelatedBooksResponse;
        * import com.google.example.library.v1.LibraryClient;
        * import java.util.Arrays;
    @@ -822,8 +824,8 @@ public class FindRelatedBooksFlattenedPagedOdyssey {
     
           // Do something
     
    -      for (String responseItem : future.get().iterateAll()) {
    -        String book = responseItem;
    +      for (BookName responseItem : future.get().iterateAllAsBookName()) {
    +        BookName book = responseItem;
             System.out.printf("Here's a related book: %s\n", book);
           }
         } catch (Exception exception) {
    @@ -901,8 +903,8 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey {
     
           // Do something
     
    -      for (String responseItem : future.get().iterateAll()) {
    -        String book = responseItem;
    +      for (BookName responseItem : future.get().iterateAllAsBookName()) {
    +        BookName book = responseItem;
             System.out.printf("Here's a related book: %s\n", book);
           }
         } catch (Exception exception) {
    @@ -972,8 +974,8 @@ public class FindRelatedBooksRequestPagedOdyssey {
             .addAllNames(BookName.toStringList(names))
             .addAllShelves(ShelfName.toStringList(shelves))
             .build();
    -      for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) {
    -        String book = responseItem;
    +      for (BookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
    +        BookName book = responseItem;
             System.out.printf("Here's a related book: %s\n", book);
           }
         } catch (Exception exception) {
    @@ -6257,7 +6259,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (String element : libraryClient.listStrings().iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6278,7 +6280,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6303,7 +6305,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6328,7 +6330,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6352,7 +6354,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6372,7 +6374,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (String element : response.getStringsList()) {
    +   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7108,7 +7110,7 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
    +   *   for (BookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7141,7 +7143,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(BookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
    +   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7171,7 +7173,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (BookName element : future.get().iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7197,7 +7199,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (String element : response.getNamesList()) {
    +   *     for (BookName element : BookName.parseList(response.getNamesList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -8573,7 +8575,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8586,7 +8588,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8604,8 +8606,8 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8618,7 +8620,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8636,7 +8638,7 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
        *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -8650,7 +8652,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8668,7 +8670,7 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName source = ShelfName.of("[SHELF]");
        *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -8682,7 +8684,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8700,7 +8702,7 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName source = ShelfName.of("[SHELF]");
        *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -8714,7 +8716,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8733,7 +8735,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8746,7 +8748,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8764,8 +8766,8 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8778,7 +8780,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8797,7 +8799,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ProjectName source = ProjectName.of("[PROJECT]");
    -   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8810,7 +8812,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8829,7 +8831,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ProjectName source = ProjectName.of("[PROJECT]");
    -   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8842,7 +8844,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8861,7 +8863,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source.toString(), destination.toString(), formattedPublishers, project.toString());
    @@ -9538,7 +9540,15 @@ public class LibraryClient implements BackgroundResource {
         private ListStringsPagedResponse(ListStringsPage page) {
           super(page, ListStringsFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9571,9 +9581,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9597,7 +9623,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new ListStringsFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
       public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse<
    @@ -9626,7 +9660,15 @@ public class LibraryClient implements BackgroundResource {
         private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) {
           super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9659,9 +9701,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9685,7 +9743,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new FindRelatedBooksFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     }
    @@ -15575,6 +15641,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -15619,6 +15689,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -16093,6 +16167,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -16675,7 +16753,7 @@ public class LibraryClientTest {
         mockLibraryService.addResponse(expectedResponse);
     
         ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -    ProjectName destination = ProjectName.of("[PROJECT]");
    +    ArchiveName destination = ArchiveName.of("[ARCHIVE]");
         List formattedPublishers = new ArrayList<>();
         ProjectName project = ProjectName.of("[PROJECT]");
     
    @@ -16688,7 +16766,7 @@ public class LibraryClientTest {
         MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0);
     
         Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource()));
    -    Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination()));
    +    Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination()));
         Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList());
         Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject()));
         Assert.assertTrue(
    @@ -16705,7 +16783,7 @@ public class LibraryClientTest {
     
         try {
           ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -      ProjectName destination = ProjectName.of("[PROJECT]");
    +      ArchiveName destination = ArchiveName.of("[ARCHIVE]");
           List formattedPublishers = new ArrayList<>();
           ProjectName project = ProjectName.of("[PROJECT]");
     
    diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline
    index 9f092d4559..ff3b4a1445 100644
    --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline
    +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline
    @@ -1633,7 +1633,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *
    -   *   for (String element : libraryServiceClient.listStrings().iterateAll()) {
    +   *   for (ResourceName element : libraryServiceClient.listStrings().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1654,7 +1654,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (String element : libraryServiceClient.listStrings(name).iterateAll()) {
    +   *   for (ResourceName element : libraryServiceClient.listStrings(name).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1679,7 +1679,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (String element : libraryServiceClient.listStrings(name.toString()).iterateAll()) {
    +   *   for (ResourceName element : libraryServiceClient.listStrings(name.toString()).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1704,7 +1704,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (String element : libraryServiceClient.listStrings(request).iterateAll()) {
    +   *   for (ResourceName element : libraryServiceClient.listStrings(request).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1728,7 +1728,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryServiceClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -1748,7 +1748,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryServiceClient.listStringsCallable().call(request);
    -   *     for (String element : response.getStringsList()) {
    +   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -2443,7 +2443,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   List<String> names = new ArrayList<>();
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (String element : libraryServiceClient.findRelatedBooks(names, formattedShelves).iterateAll()) {
    +   *   for (BookName element : libraryServiceClient.findRelatedBooks(names, formattedShelves).iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -2475,7 +2475,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *     .addAllNames(BookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (String element : libraryServiceClient.findRelatedBooks(request).iterateAll()) {
    +   *   for (BookName element : libraryServiceClient.findRelatedBooks(request).iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -2504,7 +2504,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryServiceClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (BookName element : future.get().iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -2529,7 +2529,7 @@ public class LibraryServiceClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryServiceClient.findRelatedBooksCallable().call(request);
    -   *     for (String element : response.getNamesList()) {
    +   *     for (BookName element : BookName.parseList(response.getNamesList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -2883,7 +2883,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -2896,7 +2896,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -2914,8 +2914,8 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -2928,7 +2928,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -2946,7 +2946,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
        *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -2960,7 +2960,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -2978,7 +2978,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName source = ShelfName.of("[SHELF]");
        *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -2992,7 +2992,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -3010,7 +3010,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName source = ShelfName.of("[SHELF]");
        *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -3024,7 +3024,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -3043,7 +3043,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -3056,7 +3056,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -3074,8 +3074,8 @@ public class LibraryServiceClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
    -   *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -3088,7 +3088,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -3107,7 +3107,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ProjectName source = ProjectName.of("[PROJECT]");
    -   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -3120,7 +3120,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -3139,7 +3139,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ProjectName source = ProjectName.of("[PROJECT]");
    -   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryServiceClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -3152,7 +3152,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -3171,7 +3171,7 @@ public class LibraryServiceClient implements BackgroundResource {
        * 
    
        * try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryServiceClient.moveBooks(source.toString(), destination.toString(), formattedPublishers, project.toString());
    @@ -4834,7 +4834,15 @@ public class LibraryServiceClient implements BackgroundResource {
         private ListStringsPagedResponse(ListStringsPage page) {
           super(page, ListStringsFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -4867,9 +4875,25 @@ public class LibraryServiceClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -4893,7 +4917,15 @@ public class LibraryServiceClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new ListStringsFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
       public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse<
    @@ -4922,7 +4954,15 @@ public class LibraryServiceClient implements BackgroundResource {
         private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) {
           super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -4955,9 +4995,25 @@ public class LibraryServiceClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -4981,7 +5037,15 @@ public class LibraryServiceClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new FindRelatedBooksFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     }
    @@ -10623,6 +10687,10 @@ public class LibraryServiceClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -10667,6 +10735,10 @@ public class LibraryServiceClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -11116,6 +11188,10 @@ public class LibraryServiceClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -11303,7 +11379,7 @@ public class LibraryServiceClientTest {
         mockLibraryService.addResponse(expectedResponse);
     
         ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -    ProjectName destination = ProjectName.of("[PROJECT]");
    +    ArchiveName destination = ArchiveName.of("[ARCHIVE]");
         List formattedPublishers = new ArrayList<>();
         ProjectName project = ProjectName.of("[PROJECT]");
     
    @@ -11316,7 +11392,7 @@ public class LibraryServiceClientTest {
         MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0);
     
         Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource()));
    -    Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination()));
    +    Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination()));
         Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList());
         Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject()));
         Assert.assertTrue(
    @@ -11333,7 +11409,7 @@ public class LibraryServiceClientTest {
     
         try {
           ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -      ProjectName destination = ProjectName.of("[PROJECT]");
    +      ArchiveName destination = ArchiveName.of("[ARCHIVE]");
           List formattedPublishers = new ArrayList<>();
           ProjectName project = ProjectName.of("[PROJECT]");
     
    diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline
    index e61cf6e34a..6d4dfc9df6 100644
    --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline
    +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline
    @@ -748,8 +748,8 @@ public class FindRelatedBooksCallableCallableListOdyssey {
             .build();
           while (true) {
             FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -        for (String responseItem : response.getNamesList()) {
    -          String book = responseItem;
    +        for (BookName responseItem : BookName.parseList(response.getNamesList())) {
    +          BookName book = responseItem;
               System.out.printf("Here's a related book: %s\n", book);
             }
             String nextPageToken = response.getNextPageToken();
    @@ -794,6 +794,7 @@ public class FindRelatedBooksCallableCallableListOdyssey {
     package com.google.example.examples.library.v1;
     
     import com.google.api.core.ApiFuture;
    +import com.google.example.library.v1.BookName;
     import com.google.example.library.v1.FindRelatedBooksResponse;
     import com.google.example.library.v1.LibraryClient;
     import java.util.Arrays;
    @@ -805,6 +806,7 @@ public class FindRelatedBooksFlattenedPagedOdyssey {
        * Please include the following imports to run this sample.
        *
        * import com.google.api.core.ApiFuture;
    +   * import com.google.example.library.v1.BookName;
        * import com.google.example.library.v1.FindRelatedBooksResponse;
        * import com.google.example.library.v1.LibraryClient;
        * import java.util.Arrays;
    @@ -822,8 +824,8 @@ public class FindRelatedBooksFlattenedPagedOdyssey {
     
           // Do something
     
    -      for (String responseItem : future.get().iterateAll()) {
    -        String book = responseItem;
    +      for (BookName responseItem : future.get().iterateAllAsBookName()) {
    +        BookName book = responseItem;
             System.out.printf("Here's a related book: %s\n", book);
           }
         } catch (Exception exception) {
    @@ -901,8 +903,8 @@ public class FindRelatedBooksPagedCallableCallablePagedOdyssey {
     
           // Do something
     
    -      for (String responseItem : future.get().iterateAll()) {
    -        String book = responseItem;
    +      for (BookName responseItem : future.get().iterateAllAsBookName()) {
    +        BookName book = responseItem;
             System.out.printf("Here's a related book: %s\n", book);
           }
         } catch (Exception exception) {
    @@ -972,8 +974,8 @@ public class FindRelatedBooksRequestPagedOdyssey {
             .addAllNames(BookName.toStringList(names))
             .addAllShelves(ShelfName.toStringList(shelves))
             .build();
    -      for (String responseItem : libraryClient.findRelatedBooks(request).iterateAll()) {
    -        String book = responseItem;
    +      for (BookName responseItem : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
    +        BookName book = responseItem;
             System.out.printf("Here's a related book: %s\n", book);
           }
         } catch (Exception exception) {
    @@ -6257,7 +6259,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *
    -   *   for (String element : libraryClient.listStrings().iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6278,7 +6280,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (String element : libraryClient.listStrings(name).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6303,7 +6305,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ResourceName name = ArchiveName.of("[ARCHIVE]");
    -   *   for (String element : libraryClient.listStrings(name.toString()).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(name.toString()).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6328,7 +6330,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
    -   *   for (String element : libraryClient.listStrings(request).iterateAll()) {
    +   *   for (ResourceName element : libraryClient.listStrings(request).iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6352,7 +6354,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   ApiFuture<ListStringsPagedResponse> future = libraryClient.listStringsPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (ResourceName element : future.get().iterateAllAsResourceName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -6372,7 +6374,7 @@ public class LibraryClient implements BackgroundResource {
        *   ListStringsRequest request = ListStringsRequest.newBuilder().build();
        *   while (true) {
        *     ListStringsResponse response = libraryClient.listStringsCallable().call(request);
    -   *     for (String element : response.getStringsList()) {
    +   *     for (ResourceName element : UntypedResourceName.parseList(response.getStringsList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -7108,7 +7110,7 @@ public class LibraryClient implements BackgroundResource {
        *   String namesElement = "";
        *   List<String> names = Arrays.asList(namesElement);
        *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (String element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAll()) {
    +   *   for (BookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7141,7 +7143,7 @@ public class LibraryClient implements BackgroundResource {
        *     .addAllNames(BookName.toStringList(names))
        *     .addAllShelves(ShelfName.toStringList(shelves))
        *     .build();
    -   *   for (String element : libraryClient.findRelatedBooks(request).iterateAll()) {
    +   *   for (BookName element : libraryClient.findRelatedBooks(request).iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7171,7 +7173,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   ApiFuture<FindRelatedBooksPagedResponse> future = libraryClient.findRelatedBooksPagedCallable().futureCall(request);
        *   // Do something
    -   *   for (String element : future.get().iterateAll()) {
    +   *   for (BookName element : future.get().iterateAllAsBookName()) {
        *     // doThingsWith(element);
        *   }
        * }
    @@ -7197,7 +7199,7 @@ public class LibraryClient implements BackgroundResource {
        *     .build();
        *   while (true) {
        *     FindRelatedBooksResponse response = libraryClient.findRelatedBooksCallable().call(request);
    -   *     for (String element : response.getNamesList()) {
    +   *     for (BookName element : BookName.parseList(response.getNamesList())) {
        *       // doThingsWith(element);
        *     }
        *     String nextPageToken = response.getNextPageToken();
    @@ -8573,7 +8575,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8586,7 +8588,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8604,8 +8606,8 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8618,7 +8620,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8636,7 +8638,7 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
        *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -8650,7 +8652,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ArchiveName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8668,7 +8670,7 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName source = ShelfName.of("[SHELF]");
        *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -8682,7 +8684,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8700,7 +8702,7 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName source = ShelfName.of("[SHELF]");
        *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
    @@ -8714,7 +8716,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ArchiveName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8733,7 +8735,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8746,7 +8748,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ShelfName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8764,8 +8766,8 @@ public class LibraryClient implements BackgroundResource {
        * Sample code:
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   ShelfName source = ShelfName.of("[SHELF]");
    -   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   ProjectName source = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8778,7 +8780,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ShelfName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8797,7 +8799,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ProjectName source = ProjectName.of("[PROJECT]");
    -   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
    +   *   ShelfName destination = ShelfName.of("[SHELF]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8810,7 +8812,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ArchiveName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8829,7 +8831,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ProjectName source = ProjectName.of("[PROJECT]");
    -   *   ShelfName destination = ShelfName.of("[SHELF]");
    +   *   ProjectName destination = ProjectName.of("[PROJECT]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source, destination, formattedPublishers, project);
    @@ -8842,7 +8844,7 @@ public class LibraryClient implements BackgroundResource {
        * @param project
        * @throws com.google.api.gax.rpc.ApiException if the remote call fails
        */
    -  public final MoveBooksResponse moveBooks(ProjectName source, ShelfName destination, List publishers, ProjectName project) {
    +  public final MoveBooksResponse moveBooks(ProjectName source, ProjectName destination, List publishers, ProjectName project) {
         MoveBooksRequest request =
             MoveBooksRequest.newBuilder()
                 .setSource(source == null ? null : source.toString())
    @@ -8861,7 +8863,7 @@ public class LibraryClient implements BackgroundResource {
        * 
    
        * try (LibraryClient libraryClient = LibraryClient.create()) {
        *   ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -   *   ProjectName destination = ProjectName.of("[PROJECT]");
    +   *   ArchiveName destination = ArchiveName.of("[ARCHIVE]");
        *   List<String> formattedPublishers = new ArrayList<>();
        *   ProjectName project = ProjectName.of("[PROJECT]");
        *   MoveBooksResponse response = libraryClient.moveBooks(source.toString(), destination.toString(), formattedPublishers, project.toString());
    @@ -9538,7 +9540,15 @@ public class LibraryClient implements BackgroundResource {
         private ListStringsPagedResponse(ListStringsPage page) {
           super(page, ListStringsFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9571,9 +9581,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsResourceName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9597,7 +9623,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new ListStringsFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsResourceName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public ResourceName apply(String arg0) {
    +            return UntypedResourceName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
       public static class FindRelatedBooksPagedResponse extends AbstractPagedListResponse<
    @@ -9626,7 +9660,15 @@ public class LibraryClient implements BackgroundResource {
         private FindRelatedBooksPagedResponse(FindRelatedBooksPage page) {
           super(page, FindRelatedBooksFixedSizeCollection.createEmptyCollection());
         }
    -
    +    public Iterable iterateAllAsBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9659,9 +9701,25 @@ public class LibraryClient implements BackgroundResource {
             ApiFuture futureResponse) {
           return super.createPageAsync(context, futureResponse);
         }
    +    public Iterable iterateAllAsBookName() {
    +      return Iterables.transform(iterateAll(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
    -
    -
    +    public Iterable getValuesAsBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     
    @@ -9685,7 +9743,15 @@ public class LibraryClient implements BackgroundResource {
             List pages, int collectionSize) {
           return new FindRelatedBooksFixedSizeCollection(pages, collectionSize);
         }
    -
    +    public Iterable getValuesAsBookName() {
    +      return Iterables.transform(getValues(), new Function() {
    +          @Override
    +          public BookName apply(String arg0) {
    +            return BookName.parse(arg0);
    +          }
    +        }
    +      );
    +    }
     
       }
     }
    @@ -15579,6 +15645,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -15623,6 +15693,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getStringsList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsResourceName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(UntypedResourceName.parse(expectedResponse.getStringsList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -16097,6 +16171,10 @@ public class LibraryClientTest {
         List resources = Lists.newArrayList(pagedListResponse.iterateAll());
         Assert.assertEquals(1, resources.size());
         Assert.assertEquals(expectedResponse.getNamesList().get(0), resources.get(0));
    +    List resourceNames = Lists.newArrayList(pagedListResponse.iterateAllAsBookName());
    +    Assert.assertEquals(1, resourceNames.size());
    +    Assert.assertEquals(BookName.parse(expectedResponse.getNamesList().get(0)),
    +        resourceNames.get(0));
     
         List actualRequests = mockLibraryService.getRequests();
         Assert.assertEquals(1, actualRequests.size());
    @@ -16679,7 +16757,7 @@ public class LibraryClientTest {
         mockLibraryService.addResponse(expectedResponse);
     
         ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -    ProjectName destination = ProjectName.of("[PROJECT]");
    +    ArchiveName destination = ArchiveName.of("[ARCHIVE]");
         List formattedPublishers = new ArrayList<>();
         ProjectName project = ProjectName.of("[PROJECT]");
     
    @@ -16692,7 +16770,7 @@ public class LibraryClientTest {
         MoveBooksRequest actualRequest = (MoveBooksRequest)actualRequests.get(0);
     
         Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource()));
    -    Assert.assertEquals(destination, ProjectName.parse(actualRequest.getDestination()));
    +    Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination()));
         Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList());
         Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject()));
         Assert.assertTrue(
    @@ -16709,7 +16787,7 @@ public class LibraryClientTest {
     
         try {
           ArchiveName source = ArchiveName.of("[ARCHIVE]");
    -      ProjectName destination = ProjectName.of("[PROJECT]");
    +      ArchiveName destination = ArchiveName.of("[ARCHIVE]");
           List formattedPublishers = new ArrayList<>();
           ProjectName project = ProjectName.of("[PROJECT]");
     
    
    From d753992b3e132c3ac24d48d715d0d80d51ed4374 Mon Sep 17 00:00:00 2001
    From: Hanzhen Yi 
    Date: Tue, 28 Jan 2020 12:51:43 -0800
    Subject: [PATCH 17/36] omg
    
    ---
     .../api/codegen/config/FlatteningConfig.java  |  14 +-
     .../testdata/csharp/csharp_library.baseline   | 398 ++++--------------
     ...amplegen_config_migration_library.baseline | 398 ++++--------------
     .../gapic/testdata/java/java_library.baseline |  43 +-
     ...amplegen_config_migration_library.baseline |  43 +-
     5 files changed, 176 insertions(+), 720 deletions(-)
    
    diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java
    index 17dd3af839..1a8a13b8c9 100644
    --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java
    +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java
    @@ -245,6 +245,9 @@ private static FlatteningConfig createFlatteningFromConfigProto(
           if (fieldConfig == null) {
             missing = true;
           } else {
    +        if (fieldConfig.isRepeatedResourceNameTypeField()) {
    +          fieldConfig = fieldConfig.withResourceNameInSampleOnly();
    +        }
             flattenedFieldConfigBuilder.put(parameter, fieldConfig);
           }
         }
    @@ -290,12 +293,19 @@ private static List createFlatteningsFromProtoFile(
         }
     
         // We also generate an overload that all singular resource names are treated as strings,
    -    // if there is at least one resource name field in the method surface. Note repeated
    +    // if there is at least one singular resource name field in the method surface. Note repeated
         // resource name fields are always treated as strings.
         if (hasSingularResourceNameParameters(flatteningConfigs)) {
           flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0)));
         }
    -
    +    if (method.getFullName().contains("OptionalRequired")) {
    +      System.out.println(
    +          flatteningConfigs
    +              .stream()
    +              .map(ImmutableMap::copyOf)
    +              .map(map -> new AutoValue_FlatteningConfig(map))
    +              .collect(ImmutableList.toImmutableList()));
    +    }
         return flatteningConfigs
             .stream()
             .map(ImmutableMap::copyOf)
    diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline
    index 4ee0e0e4b4..4a64d6688c 100644
    --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline
    +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline
    @@ -7340,103 +7340,7 @@ namespace Google.Example.Library.V1.Snippets
             }
     
             /// Snippet for FindRelatedBooksAsync
    -        public async Task FindRelatedBooksAsync1()
    -        {
    -            // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings)
    -            // Create client
    -            LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
    -            // Initialize request argument(s)
    -            IEnumerable names = new[]
    -            {
    -                new BookName("[SHELF]", "[BOOK]"),
    -            };
    -            IEnumerable shelves = new List();
    -            // Make the request
    -            PagedAsyncEnumerable response =
    -                libraryServiceClient.FindRelatedBooksAsync(names, shelves);
    -
    -            // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((BookName item) =>
    -            {
    -                // Do something with each item
    -                Console.WriteLine(item);
    -            });
    -
    -            // Or iterate over pages (of server-defined size), performing one RPC per page
    -            await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) =>
    -            {
    -                // Do something with each page of items
    -                Console.WriteLine("A page of results:");
    -                foreach (BookName item in page)
    -                {
    -                    Console.WriteLine(item);
    -                }
    -            });
    -
    -            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    -            int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    -            // Do something with the page of items
    -            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (BookName item in singlePage)
    -            {
    -                Console.WriteLine(item);
    -            }
    -            // Store the pageToken, for when the next page is required.
    -            string nextPageToken = singlePage.NextPageToken;
    -            // End snippet
    -        }
    -
    -        /// Snippet for FindRelatedBooks
    -        public void FindRelatedBooks1()
    -        {
    -            // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings)
    -            // Create client
    -            LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
    -            // Initialize request argument(s)
    -            IEnumerable names = new[]
    -            {
    -                new BookName("[SHELF]", "[BOOK]"),
    -            };
    -            IEnumerable shelves = new List();
    -            // Make the request
    -            PagedEnumerable response =
    -                libraryServiceClient.FindRelatedBooks(names, shelves);
    -
    -            // Iterate over all response items, lazily performing RPCs as required
    -            foreach (BookName item in response)
    -            {
    -                // Do something with each item
    -                Console.WriteLine(item);
    -            }
    -
    -            // Or iterate over pages (of server-defined size), performing one RPC per page
    -            foreach (FindRelatedBooksResponse page in response.AsRawResponses())
    -            {
    -                // Do something with each page of items
    -                Console.WriteLine("A page of results:");
    -                foreach (BookName item in page)
    -                {
    -                    Console.WriteLine(item);
    -                }
    -            }
    -
    -            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    -            int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    -            // Do something with the page of items
    -            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (BookName item in singlePage)
    -            {
    -                Console.WriteLine(item);
    -            }
    -            // Store the pageToken, for when the next page is required.
    -            string nextPageToken = singlePage.NextPageToken;
    -            // End snippet
    -        }
    -
    -        /// Snippet for FindRelatedBooksAsync
    -        public async Task FindRelatedBooksAsync2()
    +        public async Task FindRelatedBooksAsync()
             {
                 // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings)
                 // Create client
    @@ -7484,7 +7388,7 @@ namespace Google.Example.Library.V1.Snippets
             }
     
             /// Snippet for FindRelatedBooks
    -        public void FindRelatedBooks2()
    +        public void FindRelatedBooks()
             {
                 // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings)
                 // Create client
    @@ -8111,8 +8015,8 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for TestOptionalRequiredFlatteningParamsAsync
             public async Task TestOptionalRequiredFlatteningParamsAsync2()
             {
    -            // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
    -            // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken)
    +            // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
    +            // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
    @@ -8246,7 +8150,7 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for TestOptionalRequiredFlatteningParams
             public void TestOptionalRequiredFlatteningParams2()
             {
    -            // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
    +            // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
    @@ -8408,9 +8312,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -8469,9 +8373,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -8508,7 +8412,7 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
                 // Make the request
    -            TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 // End snippet
             }
     
    @@ -8542,9 +8446,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -8603,9 +8507,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -8642,7 +8546,7 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
                 // Make the request
    -            TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 // End snippet
             }
     
    @@ -11985,9 +11889,9 @@ namespace Google.Example.Library.V1.Tests
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceNameAsBookNames = { },
    -                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                RequiredRepeatedResourceNameCommonAsProjectNames = { },
    +                RequiredRepeatedResourceName = { },
    +                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
                     RequiredMap = { },
    @@ -12046,9 +11950,9 @@ namespace Google.Example.Library.V1.Tests
                     OptionalRepeatedString = { },
                     OptionalRepeatedBytes = { },
                     OptionalRepeatedMessage = { },
    -                OptionalRepeatedResourceNameAsBookNames = { },
    -                OptionalRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                OptionalRepeatedResourceNameCommonAsProjectNames = { },
    +                OptionalRepeatedResourceName = { },
    +                OptionalRepeatedResourceNameOneof = { },
    +                OptionalRepeatedResourceNameCommon = { },
                     OptionalRepeatedFixed32 = { },
                     OptionalRepeatedFixed64 = { },
                     OptionalMap = { },
    @@ -12249,9 +12153,9 @@ namespace Google.Example.Library.V1.Tests
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceNameAsBookNames = { },
    -                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                RequiredRepeatedResourceNameCommonAsProjectNames = { },
    +                RequiredRepeatedResourceName = { },
    +                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
                     RequiredMap = { },
    @@ -12310,9 +12214,9 @@ namespace Google.Example.Library.V1.Tests
                     OptionalRepeatedString = { },
                     OptionalRepeatedBytes = { },
                     OptionalRepeatedMessage = { },
    -                OptionalRepeatedResourceNameAsBookNames = { },
    -                OptionalRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                OptionalRepeatedResourceNameCommonAsProjectNames = { },
    +                OptionalRepeatedResourceName = { },
    +                OptionalRepeatedResourceNameOneof = { },
    +                OptionalRepeatedResourceNameCommon = { },
                     OptionalRepeatedFixed32 = { },
                     OptionalRepeatedFixed64 = { },
                     OptionalMap = { },
    @@ -12640,9 +12544,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -12701,9 +12605,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -12739,7 +12643,7 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable repeatedStringValue = new List();
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
    -            TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 Assert.Same(expectedResponse, response);
                 mockGrpcClient.VerifyAll();
             }
    @@ -12904,9 +12808,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -12965,9 +12869,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -13003,7 +12907,7 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable repeatedStringValue = new List();
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
    -            TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 Assert.Same(expectedResponse, response);
                 mockGrpcClient.VerifyAll();
             }
    @@ -20235,158 +20139,6 @@ namespace Google.Example.Library.V1
             {
             }
     
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable asynchronous sequence of  resources.
    -        /// 
    -        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync(
    -                new FindRelatedBooksRequest
    -                {
    -                    BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable sequence of  resources.
    -        /// 
    -        public virtual gax::PagedEnumerable FindRelatedBooks(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks(
    -                new FindRelatedBooksRequest
    -                {
    -                    BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable asynchronous sequence of  resources.
    -        /// 
    -        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync(
    -                new FindRelatedBooksRequest
    -                {
    -                    Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable sequence of  resources.
    -        /// 
    -        public virtual gax::PagedEnumerable FindRelatedBooks(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks(
    -                new FindRelatedBooksRequest
    -                {
    -                    Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
             /// 
             ///
             /// 
    @@ -21583,9 +21335,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable requiredRepeatedString,
                 scg::IEnumerable requiredRepeatedBytes,
                 scg::IEnumerable requiredRepeatedMessage,
    -            scg::IEnumerable requiredRepeatedResourceName,
    -            scg::IEnumerable requiredRepeatedResourceNameOneof,
    -            scg::IEnumerable requiredRepeatedResourceNameCommon,
    +            scg::IEnumerable requiredRepeatedResourceName,
    +            scg::IEnumerable requiredRepeatedResourceNameOneof,
    +            scg::IEnumerable requiredRepeatedResourceNameCommon,
                 scg::IEnumerable requiredRepeatedFixed32,
                 scg::IEnumerable requiredRepeatedFixed64,
                 scg::IDictionary requiredMap,
    @@ -21644,9 +21396,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable optionalRepeatedString,
                 scg::IEnumerable optionalRepeatedBytes,
                 scg::IEnumerable optionalRepeatedMessage,
    -            scg::IEnumerable optionalRepeatedResourceName,
    -            scg::IEnumerable optionalRepeatedResourceNameOneof,
    -            scg::IEnumerable optionalRepeatedResourceNameCommon,
    +            scg::IEnumerable optionalRepeatedResourceName,
    +            scg::IEnumerable optionalRepeatedResourceNameOneof,
    +            scg::IEnumerable optionalRepeatedResourceNameCommon,
                 scg::IEnumerable optionalRepeatedFixed32,
                 scg::IEnumerable optionalRepeatedFixed64,
                 scg::IDictionary optionalMap,
    @@ -21708,9 +21460,9 @@ namespace Google.Example.Library.V1
                         RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) },
                         RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) },
                         RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) },
    -                    RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    -                    RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    -                    RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
    +                    RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    +                    RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    +                    RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
                         RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) },
                         RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) },
                         RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) },
    @@ -21769,9 +21521,9 @@ namespace Google.Example.Library.V1
                         OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional
    @@ -22209,9 +21961,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable requiredRepeatedString,
                 scg::IEnumerable requiredRepeatedBytes,
                 scg::IEnumerable requiredRepeatedMessage,
    -            scg::IEnumerable requiredRepeatedResourceName,
    -            scg::IEnumerable requiredRepeatedResourceNameOneof,
    -            scg::IEnumerable requiredRepeatedResourceNameCommon,
    +            scg::IEnumerable requiredRepeatedResourceName,
    +            scg::IEnumerable requiredRepeatedResourceNameOneof,
    +            scg::IEnumerable requiredRepeatedResourceNameCommon,
                 scg::IEnumerable requiredRepeatedFixed32,
                 scg::IEnumerable requiredRepeatedFixed64,
                 scg::IDictionary requiredMap,
    @@ -22270,9 +22022,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable optionalRepeatedString,
                 scg::IEnumerable optionalRepeatedBytes,
                 scg::IEnumerable optionalRepeatedMessage,
    -            scg::IEnumerable optionalRepeatedResourceName,
    -            scg::IEnumerable optionalRepeatedResourceNameOneof,
    -            scg::IEnumerable optionalRepeatedResourceNameCommon,
    +            scg::IEnumerable optionalRepeatedResourceName,
    +            scg::IEnumerable optionalRepeatedResourceNameOneof,
    +            scg::IEnumerable optionalRepeatedResourceNameCommon,
                 scg::IEnumerable optionalRepeatedFixed32,
                 scg::IEnumerable optionalRepeatedFixed64,
                 scg::IDictionary optionalMap,
    @@ -22832,9 +22584,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable requiredRepeatedString,
                 scg::IEnumerable requiredRepeatedBytes,
                 scg::IEnumerable requiredRepeatedMessage,
    -            scg::IEnumerable requiredRepeatedResourceName,
    -            scg::IEnumerable requiredRepeatedResourceNameOneof,
    -            scg::IEnumerable requiredRepeatedResourceNameCommon,
    +            scg::IEnumerable requiredRepeatedResourceName,
    +            scg::IEnumerable requiredRepeatedResourceNameOneof,
    +            scg::IEnumerable requiredRepeatedResourceNameCommon,
                 scg::IEnumerable requiredRepeatedFixed32,
                 scg::IEnumerable requiredRepeatedFixed64,
                 scg::IDictionary requiredMap,
    @@ -22893,9 +22645,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable optionalRepeatedString,
                 scg::IEnumerable optionalRepeatedBytes,
                 scg::IEnumerable optionalRepeatedMessage,
    -            scg::IEnumerable optionalRepeatedResourceName,
    -            scg::IEnumerable optionalRepeatedResourceNameOneof,
    -            scg::IEnumerable optionalRepeatedResourceNameCommon,
    +            scg::IEnumerable optionalRepeatedResourceName,
    +            scg::IEnumerable optionalRepeatedResourceNameOneof,
    +            scg::IEnumerable optionalRepeatedResourceNameCommon,
                 scg::IEnumerable optionalRepeatedFixed32,
                 scg::IEnumerable optionalRepeatedFixed64,
                 scg::IDictionary optionalMap,
    @@ -22957,9 +22709,9 @@ namespace Google.Example.Library.V1
                         RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) },
                         RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) },
                         RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) },
    -                    RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    -                    RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    -                    RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
    +                    RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    +                    RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    +                    RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
                         RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) },
                         RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) },
                         RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) },
    @@ -23018,9 +22770,9 @@ namespace Google.Example.Library.V1
                         OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional
    diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline
    index 391644a2d8..2cc7d3de7a 100644
    --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline
    +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline
    @@ -4159,103 +4159,7 @@ namespace Google.Example.Library.V1.Snippets
             }
     
             /// Snippet for FindRelatedBooksAsync
    -        public async Task FindRelatedBooksAsync1()
    -        {
    -            // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings)
    -            // Create client
    -            LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
    -            // Initialize request argument(s)
    -            IEnumerable names = new[]
    -            {
    -                new BookName("[SHELF]", "[BOOK]"),
    -            };
    -            IEnumerable shelves = new List();
    -            // Make the request
    -            PagedAsyncEnumerable response =
    -                libraryServiceClient.FindRelatedBooksAsync(names, shelves);
    -
    -            // Iterate over all response items, lazily performing RPCs as required
    -            await response.ForEachAsync((BookName item) =>
    -            {
    -                // Do something with each item
    -                Console.WriteLine(item);
    -            });
    -
    -            // Or iterate over pages (of server-defined size), performing one RPC per page
    -            await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) =>
    -            {
    -                // Do something with each page of items
    -                Console.WriteLine("A page of results:");
    -                foreach (BookName item in page)
    -                {
    -                    Console.WriteLine(item);
    -                }
    -            });
    -
    -            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    -            int pageSize = 10;
    -            Page singlePage = await response.ReadPageAsync(pageSize);
    -            // Do something with the page of items
    -            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (BookName item in singlePage)
    -            {
    -                Console.WriteLine(item);
    -            }
    -            // Store the pageToken, for when the next page is required.
    -            string nextPageToken = singlePage.NextPageToken;
    -            // End snippet
    -        }
    -
    -        /// Snippet for FindRelatedBooks
    -        public void FindRelatedBooks1()
    -        {
    -            // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings)
    -            // Create client
    -            LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
    -            // Initialize request argument(s)
    -            IEnumerable names = new[]
    -            {
    -                new BookName("[SHELF]", "[BOOK]"),
    -            };
    -            IEnumerable shelves = new List();
    -            // Make the request
    -            PagedEnumerable response =
    -                libraryServiceClient.FindRelatedBooks(names, shelves);
    -
    -            // Iterate over all response items, lazily performing RPCs as required
    -            foreach (BookName item in response)
    -            {
    -                // Do something with each item
    -                Console.WriteLine(item);
    -            }
    -
    -            // Or iterate over pages (of server-defined size), performing one RPC per page
    -            foreach (FindRelatedBooksResponse page in response.AsRawResponses())
    -            {
    -                // Do something with each page of items
    -                Console.WriteLine("A page of results:");
    -                foreach (BookName item in page)
    -                {
    -                    Console.WriteLine(item);
    -                }
    -            }
    -
    -            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    -            int pageSize = 10;
    -            Page singlePage = response.ReadPage(pageSize);
    -            // Do something with the page of items
    -            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    -            foreach (BookName item in singlePage)
    -            {
    -                Console.WriteLine(item);
    -            }
    -            // Store the pageToken, for when the next page is required.
    -            string nextPageToken = singlePage.NextPageToken;
    -            // End snippet
    -        }
    -
    -        /// Snippet for FindRelatedBooksAsync
    -        public async Task FindRelatedBooksAsync2()
    +        public async Task FindRelatedBooksAsync()
             {
                 // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings)
                 // Create client
    @@ -4303,7 +4207,7 @@ namespace Google.Example.Library.V1.Snippets
             }
     
             /// Snippet for FindRelatedBooks
    -        public void FindRelatedBooks2()
    +        public void FindRelatedBooks()
             {
                 // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings)
                 // Create client
    @@ -4930,8 +4834,8 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for TestOptionalRequiredFlatteningParamsAsync
             public async Task TestOptionalRequiredFlatteningParamsAsync2()
             {
    -            // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
    -            // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken)
    +            // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
    +            // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken)
                 // Create client
                 LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync();
                 // Initialize request argument(s)
    @@ -5033,7 +4937,7 @@ namespace Google.Example.Library.V1.Snippets
             /// Snippet for TestOptionalRequiredFlatteningParams
             public void TestOptionalRequiredFlatteningParams2()
             {
    -            // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
    +            // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings)
                 // Create client
                 LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create();
                 // Initialize request argument(s)
    @@ -5163,9 +5067,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -5192,9 +5096,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -5231,7 +5135,7 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
                 // Make the request
    -            TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 // End snippet
             }
     
    @@ -5265,9 +5169,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -5294,9 +5198,9 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -5333,7 +5237,7 @@ namespace Google.Example.Library.V1.Snippets
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
                 // Make the request
    -            TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 // End snippet
             }
     
    @@ -8582,9 +8486,9 @@ namespace Google.Example.Library.V1.Tests
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceNameAsBookNames = { },
    -                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                RequiredRepeatedResourceNameCommonAsProjectNames = { },
    +                RequiredRepeatedResourceName = { },
    +                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
                     RequiredMap = { },
    @@ -8611,9 +8515,9 @@ namespace Google.Example.Library.V1.Tests
                     OptionalRepeatedString = { },
                     OptionalRepeatedBytes = { },
                     OptionalRepeatedMessage = { },
    -                OptionalRepeatedResourceNameAsBookNames = { },
    -                OptionalRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                OptionalRepeatedResourceNameCommonAsProjectNames = { },
    +                OptionalRepeatedResourceName = { },
    +                OptionalRepeatedResourceNameOneof = { },
    +                OptionalRepeatedResourceNameCommon = { },
                     OptionalRepeatedFixed32 = { },
                     OptionalRepeatedFixed64 = { },
                     OptionalMap = { },
    @@ -8782,9 +8686,9 @@ namespace Google.Example.Library.V1.Tests
                     RequiredRepeatedString = { },
                     RequiredRepeatedBytes = { },
                     RequiredRepeatedMessage = { },
    -                RequiredRepeatedResourceNameAsBookNames = { },
    -                RequiredRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                RequiredRepeatedResourceNameCommonAsProjectNames = { },
    +                RequiredRepeatedResourceName = { },
    +                RequiredRepeatedResourceNameOneof = { },
    +                RequiredRepeatedResourceNameCommon = { },
                     RequiredRepeatedFixed32 = { },
                     RequiredRepeatedFixed64 = { },
                     RequiredMap = { },
    @@ -8811,9 +8715,9 @@ namespace Google.Example.Library.V1.Tests
                     OptionalRepeatedString = { },
                     OptionalRepeatedBytes = { },
                     OptionalRepeatedMessage = { },
    -                OptionalRepeatedResourceNameAsBookNames = { },
    -                OptionalRepeatedResourceNameOneofAsBookNameOneofs = { },
    -                OptionalRepeatedResourceNameCommonAsProjectNames = { },
    +                OptionalRepeatedResourceName = { },
    +                OptionalRepeatedResourceNameOneof = { },
    +                OptionalRepeatedResourceNameCommon = { },
                     OptionalRepeatedFixed32 = { },
                     OptionalRepeatedFixed64 = { },
                     OptionalMap = { },
    @@ -9077,9 +8981,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -9106,9 +9010,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -9144,7 +9048,7 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable repeatedStringValue = new List();
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
    -            TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 Assert.Same(expectedResponse, response);
                 mockGrpcClient.VerifyAll();
             }
    @@ -9277,9 +9181,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable requiredRepeatedString = new List();
                 IEnumerable requiredRepeatedBytes = new List();
                 IEnumerable requiredRepeatedMessage = new List();
    -            IEnumerable requiredRepeatedResourceName = new List();
    -            IEnumerable requiredRepeatedResourceNameOneof = new List();
    -            IEnumerable requiredRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedRequiredRepeatedResourceName = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedRequiredRepeatedResourceNameCommon = new List();
                 IEnumerable requiredRepeatedFixed32 = new List();
                 IEnumerable requiredRepeatedFixed64 = new List();
                 IDictionary requiredMap = new Dictionary();
    @@ -9306,9 +9210,9 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable optionalRepeatedString = new List();
                 IEnumerable optionalRepeatedBytes = new List();
                 IEnumerable optionalRepeatedMessage = new List();
    -            IEnumerable optionalRepeatedResourceName = new List();
    -            IEnumerable optionalRepeatedResourceNameOneof = new List();
    -            IEnumerable optionalRepeatedResourceNameCommon = new List();
    +            IEnumerable formattedOptionalRepeatedResourceName = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameOneof = new List();
    +            IEnumerable formattedOptionalRepeatedResourceNameCommon = new List();
                 IEnumerable optionalRepeatedFixed32 = new List();
                 IEnumerable optionalRepeatedFixed64 = new List();
                 IDictionary optionalMap = new Dictionary();
    @@ -9344,7 +9248,7 @@ namespace Google.Example.Library.V1.Tests
                 IEnumerable repeatedStringValue = new List();
                 IEnumerable repeatedBoolValue = new List();
                 IEnumerable repeatedBytesValue = new List();
    -            TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
    +            TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue);
                 Assert.Same(expectedResponse, response);
                 mockGrpcClient.VerifyAll();
             }
    @@ -16377,158 +16281,6 @@ namespace Google.Example.Library.V1
             {
             }
     
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable asynchronous sequence of  resources.
    -        /// 
    -        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync(
    -                new FindRelatedBooksRequest
    -                {
    -                    BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable sequence of  resources.
    -        /// 
    -        public virtual gax::PagedEnumerable FindRelatedBooks(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks(
    -                new FindRelatedBooksRequest
    -                {
    -                    BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable asynchronous sequence of  resources.
    -        /// 
    -        public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync(
    -                new FindRelatedBooksRequest
    -                {
    -                    Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        ///
    -        /// 
    -        /// 
    -        /// The token returned from the previous request.
    -        /// A value of null or an empty string retrieves the first page.
    -        /// 
    -        /// 
    -        /// The size of page to request. The response will not be larger than this, but may be smaller.
    -        /// A value of null or 0 uses a server-defined page size.
    -        /// 
    -        /// 
    -        /// If not null, applies overrides to this RPC call.
    -        /// 
    -        /// 
    -        /// A pageable sequence of  resources.
    -        /// 
    -        public virtual gax::PagedEnumerable FindRelatedBooks(
    -            scg::IEnumerable names,
    -            scg::IEnumerable shelves,
    -            string pageToken = null,
    -            int? pageSize = null,
    -            gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks(
    -                new FindRelatedBooksRequest
    -                {
    -                    Names = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) },
    -                    Shelves = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) },
    -                    PageToken = pageToken ?? "",
    -                    PageSize = pageSize ?? 0,
    -                },
    -                callSettings);
    -
             /// 
             ///
             /// 
    @@ -17629,9 +17381,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable requiredRepeatedString,
                 scg::IEnumerable requiredRepeatedBytes,
                 scg::IEnumerable requiredRepeatedMessage,
    -            scg::IEnumerable requiredRepeatedResourceName,
    -            scg::IEnumerable requiredRepeatedResourceNameOneof,
    -            scg::IEnumerable requiredRepeatedResourceNameCommon,
    +            scg::IEnumerable requiredRepeatedResourceName,
    +            scg::IEnumerable requiredRepeatedResourceNameOneof,
    +            scg::IEnumerable requiredRepeatedResourceNameCommon,
                 scg::IEnumerable requiredRepeatedFixed32,
                 scg::IEnumerable requiredRepeatedFixed64,
                 scg::IDictionary requiredMap,
    @@ -17658,9 +17410,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable optionalRepeatedString,
                 scg::IEnumerable optionalRepeatedBytes,
                 scg::IEnumerable optionalRepeatedMessage,
    -            scg::IEnumerable optionalRepeatedResourceName,
    -            scg::IEnumerable optionalRepeatedResourceNameOneof,
    -            scg::IEnumerable optionalRepeatedResourceNameCommon,
    +            scg::IEnumerable optionalRepeatedResourceName,
    +            scg::IEnumerable optionalRepeatedResourceNameOneof,
    +            scg::IEnumerable optionalRepeatedResourceNameCommon,
                 scg::IEnumerable optionalRepeatedFixed32,
                 scg::IEnumerable optionalRepeatedFixed64,
                 scg::IDictionary optionalMap,
    @@ -17722,9 +17474,9 @@ namespace Google.Example.Library.V1
                         RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) },
                         RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) },
                         RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) },
    -                    RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    -                    RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    -                    RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
    +                    RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    +                    RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    +                    RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
                         RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) },
                         RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) },
                         RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) },
    @@ -17751,9 +17503,9 @@ namespace Google.Example.Library.V1
                         OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional
    @@ -18095,9 +17847,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable requiredRepeatedString,
                 scg::IEnumerable requiredRepeatedBytes,
                 scg::IEnumerable requiredRepeatedMessage,
    -            scg::IEnumerable requiredRepeatedResourceName,
    -            scg::IEnumerable requiredRepeatedResourceNameOneof,
    -            scg::IEnumerable requiredRepeatedResourceNameCommon,
    +            scg::IEnumerable requiredRepeatedResourceName,
    +            scg::IEnumerable requiredRepeatedResourceNameOneof,
    +            scg::IEnumerable requiredRepeatedResourceNameCommon,
                 scg::IEnumerable requiredRepeatedFixed32,
                 scg::IEnumerable requiredRepeatedFixed64,
                 scg::IDictionary requiredMap,
    @@ -18124,9 +17876,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable optionalRepeatedString,
                 scg::IEnumerable optionalRepeatedBytes,
                 scg::IEnumerable optionalRepeatedMessage,
    -            scg::IEnumerable optionalRepeatedResourceName,
    -            scg::IEnumerable optionalRepeatedResourceNameOneof,
    -            scg::IEnumerable optionalRepeatedResourceNameCommon,
    +            scg::IEnumerable optionalRepeatedResourceName,
    +            scg::IEnumerable optionalRepeatedResourceNameOneof,
    +            scg::IEnumerable optionalRepeatedResourceNameCommon,
                 scg::IEnumerable optionalRepeatedFixed32,
                 scg::IEnumerable optionalRepeatedFixed64,
                 scg::IDictionary optionalMap,
    @@ -18558,9 +18310,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable requiredRepeatedString,
                 scg::IEnumerable requiredRepeatedBytes,
                 scg::IEnumerable requiredRepeatedMessage,
    -            scg::IEnumerable requiredRepeatedResourceName,
    -            scg::IEnumerable requiredRepeatedResourceNameOneof,
    -            scg::IEnumerable requiredRepeatedResourceNameCommon,
    +            scg::IEnumerable requiredRepeatedResourceName,
    +            scg::IEnumerable requiredRepeatedResourceNameOneof,
    +            scg::IEnumerable requiredRepeatedResourceNameCommon,
                 scg::IEnumerable requiredRepeatedFixed32,
                 scg::IEnumerable requiredRepeatedFixed64,
                 scg::IDictionary requiredMap,
    @@ -18587,9 +18339,9 @@ namespace Google.Example.Library.V1
                 scg::IEnumerable optionalRepeatedString,
                 scg::IEnumerable optionalRepeatedBytes,
                 scg::IEnumerable optionalRepeatedMessage,
    -            scg::IEnumerable optionalRepeatedResourceName,
    -            scg::IEnumerable optionalRepeatedResourceNameOneof,
    -            scg::IEnumerable optionalRepeatedResourceNameCommon,
    +            scg::IEnumerable optionalRepeatedResourceName,
    +            scg::IEnumerable optionalRepeatedResourceNameOneof,
    +            scg::IEnumerable optionalRepeatedResourceNameCommon,
                 scg::IEnumerable optionalRepeatedFixed32,
                 scg::IEnumerable optionalRepeatedFixed64,
                 scg::IDictionary optionalMap,
    @@ -18651,9 +18403,9 @@ namespace Google.Example.Library.V1
                         RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) },
                         RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) },
                         RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) },
    -                    RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    -                    RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    -                    RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
    +                    RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) },
    +                    RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) },
    +                    RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) },
                         RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) },
                         RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) },
                         RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) },
    @@ -18680,9 +18432,9 @@ namespace Google.Example.Library.V1
                         OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    -                    OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional
    +                    OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional
                         OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional
    diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline
    index 80c64c5669..c83570549c 100644
    --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline
    +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline
    @@ -6878,35 +6878,6 @@ public class LibraryClient implements BackgroundResource {
         return stub.babbleAboutBookCallable();
       }
     
    -  // AUTO-GENERATED DOCUMENTATION AND METHOD
    -  /**
    -   *
    -   *
    -   * Sample code:
    -   * 
    
    -   * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   String namesElement = "";
    -   *   List<String> names = Arrays.asList(namesElement);
    -   *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
    -   *     // doThingsWith(element);
    -   *   }
    -   * }
    -   * 
    - * - * @param names - * @param shelves - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { - FindRelatedBooksRequest request = - FindRelatedBooksRequest.newBuilder() - .addAllNames(names == null ? null : ShelfBookName.toStringList(names)) - .addAllShelves(shelves == null ? null : ShelfName.toStringList(shelves)) - .build(); - return findRelatedBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -7604,7 +7575,7 @@ public class LibraryClient implements BackgroundResource { * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, Any requiredAnyValue, Struct requiredStructValue, Value requiredValueValue, ListValue requiredListValueValue, Timestamp requiredTimeValue, Duration requiredDurationValue, FieldMask requiredFieldMaskValue, Int32Value requiredInt32Value, UInt32Value requiredUint32Value, Int64Value requiredInt64Value, UInt64Value requiredUint64Value, FloatValue requiredFloatValue, DoubleValue requiredDoubleValue, StringValue requiredStringValue, BoolValue requiredBoolValue, BytesValue requiredBytesValue, List requiredRepeatedAnyValue, List requiredRepeatedStructValue, List requiredRepeatedValueValue, List requiredRepeatedListValueValue, List requiredRepeatedTimeValue, List requiredRepeatedDurationValue, List requiredRepeatedFieldMaskValue, List requiredRepeatedInt32Value, List requiredRepeatedUint32Value, List requiredRepeatedInt64Value, List requiredRepeatedUint64Value, List requiredRepeatedFloatValue, List requiredRepeatedDoubleValue, List requiredRepeatedStringValue, List requiredRepeatedBoolValue, List requiredRepeatedBytesValue, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder() .setRequiredSingularInt32(requiredSingularInt32) @@ -7630,9 +7601,9 @@ public class LibraryClient implements BackgroundResource { .addAllRequiredRepeatedString(requiredRepeatedString) .addAllRequiredRepeatedBytes(requiredRepeatedBytes) .addAllRequiredRepeatedMessage(requiredRepeatedMessage) - .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : ShelfBookName.toStringList(requiredRepeatedResourceName)) - .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof)) - .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(requiredRepeatedResourceNameCommon)) + .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName) + .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof) + .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) .putAllRequiredMap(requiredMap) @@ -7691,9 +7662,9 @@ public class LibraryClient implements BackgroundResource { .addAllOptionalRepeatedString(optionalRepeatedString) .addAllOptionalRepeatedBytes(optionalRepeatedBytes) .addAllOptionalRepeatedMessage(optionalRepeatedMessage) - .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : ShelfBookName.toStringList(optionalRepeatedResourceName)) - .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof)) - .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(optionalRepeatedResourceNameCommon)) + .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName) + .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof) + .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) .putAllOptionalMap(optionalMap) diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline index 448e2f1aeb..7b40d31fd9 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline @@ -4695,35 +4695,6 @@ public class LibraryClient implements BackgroundResource { return stub.babbleAboutBookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * - * - * Sample code: - *
    
    -   * try (LibraryClient libraryClient = LibraryClient.create()) {
    -   *   String namesElement = "";
    -   *   List<String> names = Arrays.asList(namesElement);
    -   *   List<String> formattedShelves = new ArrayList<>();
    -   *   for (ShelfBookName element : libraryClient.findRelatedBooks(formattedNames, formattedShelves).iterateAllAsShelfBookName()) {
    -   *     // doThingsWith(element);
    -   *   }
    -   * }
    -   * 
    - * - * @param names - * @param shelves - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final FindRelatedBooksPagedResponse findRelatedBooks(List names, List shelves) { - FindRelatedBooksRequest request = - FindRelatedBooksRequest.newBuilder() - .addAllNames(names == null ? null : ShelfBookName.toStringList(names)) - .addAllShelves(shelves == null ? null : ShelfName.toStringList(shelves)) - .build(); - return findRelatedBooks(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * @@ -5357,7 +5328,7 @@ public class LibraryClient implements BackgroundResource { * @param repeatedBytesValue * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { + public final TestOptionalRequiredFlatteningParamsResponse testOptionalRequiredFlatteningParams(int requiredSingularInt32, long requiredSingularInt64, float requiredSingularFloat, double requiredSingularDouble, boolean requiredSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum requiredSingularEnum, String requiredSingularString, ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage requiredSingularMessage, ShelfBookName requiredSingularResourceName, BookName requiredSingularResourceNameOneof, ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, List requiredRepeatedInt32, List requiredRepeatedInt64, List requiredRepeatedFloat, List requiredRepeatedDouble, List requiredRepeatedBool, List requiredRepeatedEnum, List requiredRepeatedString, List requiredRepeatedBytes, List requiredRepeatedMessage, List requiredRepeatedResourceName, List requiredRepeatedResourceNameOneof, List requiredRepeatedResourceNameCommon, List requiredRepeatedFixed32, List requiredRepeatedFixed64, Map requiredMap, int optionalSingularInt32, long optionalSingularInt64, float optionalSingularFloat, double optionalSingularDouble, boolean optionalSingularBool, TestOptionalRequiredFlatteningParamsRequest.InnerEnum optionalSingularEnum, String optionalSingularString, ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.InnerMessage optionalSingularMessage, ShelfBookName optionalSingularResourceName, BookName optionalSingularResourceNameOneof, ProjectName optionalSingularResourceNameCommon, int optionalSingularFixed32, long optionalSingularFixed64, List optionalRepeatedInt32, List optionalRepeatedInt64, List optionalRepeatedFloat, List optionalRepeatedDouble, List optionalRepeatedBool, List optionalRepeatedEnum, List optionalRepeatedString, List optionalRepeatedBytes, List optionalRepeatedMessage, List optionalRepeatedResourceName, List optionalRepeatedResourceNameOneof, List optionalRepeatedResourceNameCommon, List optionalRepeatedFixed32, List optionalRepeatedFixed64, Map optionalMap, Any anyValue, Struct structValue, Value valueValue, ListValue listValueValue, Timestamp timeValue, Duration durationValue, FieldMask fieldMaskValue, Int32Value int32Value, UInt32Value uint32Value, Int64Value int64Value, UInt64Value uint64Value, FloatValue floatValue, DoubleValue doubleValue, StringValue stringValue, BoolValue boolValue, BytesValue bytesValue, List repeatedAnyValue, List repeatedStructValue, List repeatedValueValue, List repeatedListValueValue, List repeatedTimeValue, List repeatedDurationValue, List repeatedFieldMaskValue, List repeatedInt32Value, List repeatedUint32Value, List repeatedInt64Value, List repeatedUint64Value, List repeatedFloatValue, List repeatedDoubleValue, List repeatedStringValue, List repeatedBoolValue, List repeatedBytesValue) { TestOptionalRequiredFlatteningParamsRequest request = TestOptionalRequiredFlatteningParamsRequest.newBuilder() .setRequiredSingularInt32(requiredSingularInt32) @@ -5383,9 +5354,9 @@ public class LibraryClient implements BackgroundResource { .addAllRequiredRepeatedString(requiredRepeatedString) .addAllRequiredRepeatedBytes(requiredRepeatedBytes) .addAllRequiredRepeatedMessage(requiredRepeatedMessage) - .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName == null ? null : ShelfBookName.toStringList(requiredRepeatedResourceName)) - .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof == null ? null : BookName.toStringList(requiredRepeatedResourceNameOneof)) - .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(requiredRepeatedResourceNameCommon)) + .addAllRequiredRepeatedResourceName(requiredRepeatedResourceName) + .addAllRequiredRepeatedResourceNameOneof(requiredRepeatedResourceNameOneof) + .addAllRequiredRepeatedResourceNameCommon(requiredRepeatedResourceNameCommon) .addAllRequiredRepeatedFixed32(requiredRepeatedFixed32) .addAllRequiredRepeatedFixed64(requiredRepeatedFixed64) .putAllRequiredMap(requiredMap) @@ -5412,9 +5383,9 @@ public class LibraryClient implements BackgroundResource { .addAllOptionalRepeatedString(optionalRepeatedString) .addAllOptionalRepeatedBytes(optionalRepeatedBytes) .addAllOptionalRepeatedMessage(optionalRepeatedMessage) - .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName == null ? null : ShelfBookName.toStringList(optionalRepeatedResourceName)) - .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof == null ? null : BookName.toStringList(optionalRepeatedResourceNameOneof)) - .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon == null ? null : ProjectName.toStringList(optionalRepeatedResourceNameCommon)) + .addAllOptionalRepeatedResourceName(optionalRepeatedResourceName) + .addAllOptionalRepeatedResourceNameOneof(optionalRepeatedResourceNameOneof) + .addAllOptionalRepeatedResourceNameCommon(optionalRepeatedResourceNameCommon) .addAllOptionalRepeatedFixed32(optionalRepeatedFixed32) .addAllOptionalRepeatedFixed64(optionalRepeatedFixed64) .putAllOptionalMap(optionalMap) From d6753320aa2ad6b839d7888d297474fb4bb8549f Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Tue, 28 Jan 2020 17:15:24 -0800 Subject: [PATCH 18/36] wip --- .../api/codegen/config/FieldConfig.java | 1 + .../api/codegen/config/FlatteningConfig.java | 8 - .../codegen/config/GapicProductConfig.java | 13 +- .../config/ResourceDescriptorConfig.java | 29 + .../transformer/InitCodeTransformer.java | 5 - .../CSharpGapicUnitTestTransformer.java | 3 + .../config/FieldConfigFactoryTest.java | 135 + .../codegen/config/FlatteningConfigTest.java | 0 .../config/ResourceDescriptorConfigTest.java | 204 ++ .../ResourceNameMessageConfigsTest.java | 2 +- .../testdata/csharp/csharp_library.baseline | 1652 +--------- ...amplegen_config_migration_library.baseline | 1634 +--------- .../testdata/csharp_library.baseline | 2686 ++--------------- 13 files changed, 815 insertions(+), 5557 deletions(-) create mode 100644 src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java create mode 100644 src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index 2c12345c48..b0d5c337cd 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -344,6 +344,7 @@ public String toString() { : getExampleResourceNameConfig().getEntityId(); return MoreObjects.toStringHelper(this) + .add("fieldName", getField().getSimpleName()) .add("resourceNameEntityId", resourceNameEntityId) .add("exampleResourceNameEntityId", exampleResourceNameEntityId) .add("resourceTreatment", getResourceNameTreatment()) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 1a8a13b8c9..e65b83e737 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -298,14 +298,6 @@ private static List createFlatteningsFromProtoFile( if (hasSingularResourceNameParameters(flatteningConfigs)) { flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0))); } - if (method.getFullName().contains("OptionalRequired")) { - System.out.println( - flatteningConfigs - .stream() - .map(ImmutableMap::copyOf) - .map(map -> new AutoValue_FlatteningConfig(map)) - .collect(ImmutableList.toImmutableList())); - } return flatteningConfigs .stream() .map(ImmutableMap::copyOf) diff --git a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java index 02aae2b746..1ea1236fe3 100644 --- a/src/main/java/com/google/api/codegen/config/GapicProductConfig.java +++ b/src/main/java/com/google/api/codegen/config/GapicProductConfig.java @@ -256,17 +256,8 @@ public static GapicProductConfig create( DeprecatedCollectionConfigProto::getNamePattern, c -> c)); // Create a pattern-to-resource map to make looking up parent resources easier. - Map> patternResourceDescriptorMap = new HashMap<>(); - for (ResourceDescriptorConfig resourceDescriptor : descriptorConfigMap.values()) { - for (String pattern : resourceDescriptor.getPatterns()) { - List resources = patternResourceDescriptorMap.get(pattern); - if (resources == null) { - resources = new ArrayList<>(); - patternResourceDescriptorMap.put(pattern, resources); - } - resources.add(resourceDescriptor); - } - } + Map> patternResourceDescriptorMap = + ResourceDescriptorConfig.getPatternResourceMap(descriptorConfigMap.values()); // Create a child-to-parent map to make resolving child_type easier. Map> childParentResourceMap = diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index 2b5f5ab8d6..7905125c60 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -164,6 +165,33 @@ Map buildResourceNameConfigs( return resourceNameConfigs.build(); } + /** + * Returns a map from resource name patterns to resources. + * + *

    Package private for use in GapicProductConfig. + */ + static Map> getPatternResourceMap( + Collection resourceDescriptors) { + // Create a pattern-to-resource map to make looking up parent resources easier. + Map> patternResourceDescriptorMap = new HashMap<>(); + for (ResourceDescriptorConfig resourceDescriptor : resourceDescriptors) { + for (String pattern : resourceDescriptor.getPatterns()) { + List resources = patternResourceDescriptorMap.get(pattern); + if (resources == null) { + resources = new ArrayList<>(); + patternResourceDescriptorMap.put(pattern, resources); + } + resources.add(resourceDescriptor); + } + } + return patternResourceDescriptorMap + .entrySet() + .stream() + .collect( + ImmutableMap.toImmutableMap( + entry -> entry.getKey(), entry -> ImmutableList.copyOf(entry.getValue()))); + } + /** * Returns a map from unified resource types to parent resources. * @@ -255,6 +283,7 @@ static Map getParentPatternsMap(ResourceDescriptorConfig resour .getPatterns() .stream() .map(ResourceDescriptorConfig::getParentPattern) + .filter(p -> !p.isEmpty()) .collect(ImmutableMap.toImmutableMap(p -> p, p -> false)); } diff --git a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java index ccd33e468a..16df4aefd7 100644 --- a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java @@ -510,11 +510,6 @@ private InitCodeLineView generateSimpleInitCodeLine( fieldConfig = fieldConfig.getMessageFieldConfig(); } if (item.getType().isRepeated()) { - if (fieldConfig == null) { - System.out.println("fieldConfig is null"); - } else if (fieldConfig.getResourceNameConfig() == null) { - System.out.println("resourcenameconfig is null"); - } surfaceLine.typeName(namer.getAndSaveResourceTypeName(typeTable, fieldConfig)); } else { surfaceLine.typeName(namer.getAndSaveElementResourceTypeName(typeTable, fieldConfig)); diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java index 5aaeffd06f..c528a509f7 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java @@ -179,6 +179,9 @@ private List createTestCaseViews(GapicInterfaceContext context) { } GapicMethodContext requestContext = context.asRequestMethodContext(method); for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { + if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { + continue; + } GapicMethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); testCaseViews.add( diff --git a/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java b/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java new file mode 100644 index 0000000000..44f42d80ac --- /dev/null +++ b/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java @@ -0,0 +1,135 @@ +/* Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.codegen.config; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.when; + +import com.google.api.codegen.ResourceNameTreatment; +import com.google.api.codegen.util.Name; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; +import java.util.List; +import java.util.Map; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class FieldConfigFactoryTest { + + @Mock private FieldModel parent; + @Mock private FieldModel moreParents; + + private ResourceNameMessageConfig messageConfig; + private ResourceNameMessageConfigs messageConfigs; + private Map resourceNameConfigs; + private ResourceNameConfig archive; + private ResourceNameConfig shelf; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + when(parent.getSimpleName()).thenReturn("parent"); + when(parent.getParentFullName()).thenReturn("google.cloud.library.ListBooksRequest"); + when(parent.isRepeated()).thenReturn(false); + when(moreParents.getSimpleName()).thenReturn("more_parents"); + when(moreParents.isRepeated()).thenReturn(true); + when(moreParents.getParentFullName()).thenReturn("google.cloud.library.ListBooksRequest"); + + messageConfig = + new AutoValue_ResourceNameMessageConfig( + "google.cloud.library.ListBooksRequest", + ImmutableListMultimap.of( + "parent", + "Shelf", + "parent", + "Archive", + "more_parents", + "Shelf", + "more_parents", + "Archive")); + + messageConfigs = + new AutoValue_ResourceNameMessageConfigs( + ImmutableMap.of("google.cloud.library.ListBooksRequest", messageConfig), + ImmutableListMultimap.of( + "google.cloud.library.ListBooksRequest", + parent, + "google.cloud.library.ListBooksRequest", + moreParents)); + + archive = + SingleResourceNameConfig.newBuilder() + .setNamePattern("") + .setEntityId("Archive") + .setEntityName(Name.from("archive")) + .build(); + + shelf = + SingleResourceNameConfig.newBuilder() + .setNamePattern("") + .setEntityId("Shelf") + .setEntityName(Name.from("shelf")) + .build(); + + resourceNameConfigs = ImmutableMap.of("Archive", archive, "Shelf", shelf); + } + + @Test + public void testCreateFlattenedFieldConfigsForSingularMultiResourceField() { + + List fieldConfigs = + FieldConfigFactory.createFlattenedFieldConfigs( + messageConfigs, resourceNameConfigs, parent, ResourceNameTreatment.STATIC_TYPES); + FieldConfig parentConfig1 = + FieldConfig.newBuilder() + .setResourceNameConfig(archive) + .setExampleResourceNameConfig(archive) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(parent) + .build(); + FieldConfig parentConfig2 = + FieldConfig.newBuilder() + .setResourceNameConfig(shelf) + .setExampleResourceNameConfig(shelf) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(parent) + .build(); + assertThat(fieldConfigs).containsExactly(parentConfig1, parentConfig2); + } + + @Test + public void testCreateFlattenedFieldConfigsForRepeatedMultiResourceField() { + List fieldConfigs = + FieldConfigFactory.createFlattenedFieldConfigs( + messageConfigs, resourceNameConfigs, moreParents, ResourceNameTreatment.STATIC_TYPES); + FieldConfig moreParentConfig1 = + FieldConfig.newBuilder() + .setResourceNameConfig(archive) + .setExampleResourceNameConfig(archive) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(moreParents) + .build(); + FieldConfig moreParentConfig2 = + FieldConfig.newBuilder() + .setResourceNameConfig(shelf) + .setExampleResourceNameConfig(shelf) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(moreParents) + .build(); + assertThat(fieldConfigs).containsExactly(moreParentConfig1, moreParentConfig2); + } +} diff --git a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/java/com/google/api/codegen/config/ResourceDescriptorConfigTest.java b/src/test/java/com/google/api/codegen/config/ResourceDescriptorConfigTest.java index d16f6863b0..64173a66e9 100644 --- a/src/test/java/com/google/api/codegen/config/ResourceDescriptorConfigTest.java +++ b/src/test/java/com/google/api/codegen/config/ResourceDescriptorConfigTest.java @@ -18,6 +18,10 @@ import com.google.api.ResourceDescriptor; import com.google.api.tools.framework.model.ProtoFile; +import com.google.common.collect.ImmutableMap; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import org.junit.Test; import org.mockito.Mockito; @@ -97,4 +101,204 @@ public void testGetParentPattern() { .isEqualTo("foos/{foo}/bars/{bar}"); assertThat(ResourceDescriptorConfig.getParentPattern("foos/{foo}")).isEqualTo(""); } + + @Test + public void testGetChildParentResourceMapFail_ParentHasExtraPattern() { + ResourceDescriptorConfig childResource = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("myservice.google.com/Child") + .addPattern("projects/{project}/children/{child}") + .build(), + protoFile, + true); + + ResourceDescriptorConfig parentResource = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("myservice.google.com/Parent") + .addPattern("projects/{project}") + .addPattern("locations/{location}") + .build(), + protoFile, + true); + + Map descriptorConfigMap = + getDescriptorConfigMap(childResource, parentResource); + Map> patternResourceDescriptorMap = + ResourceDescriptorConfig.getPatternResourceMap( + Arrays.asList(childResource, parentResource)); + + Map> childParentResourceMap = + ResourceDescriptorConfig.getChildParentResourceMap( + descriptorConfigMap, patternResourceDescriptorMap); + + assertThat(childParentResourceMap).isEmpty(); + } + + @Test + public void testGetChildParentResourceMapFail_ChildHasExtraPattern() { + ResourceDescriptorConfig child = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("myservice.google.com/Child") + .addPattern("projects/{project}/children/{child}") + .addPattern("locations/{location}/children/{child}") + .build(), + protoFile, + true); + + ResourceDescriptorConfig parent = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("myservice.google.com/Parent") + .addPattern("projects/{project}") + .build(), + protoFile, + true); + + Map descriptorConfigMap = + getDescriptorConfigMap(child, parent); + Map> patternResourceDescriptorMap = + ResourceDescriptorConfig.getPatternResourceMap(Arrays.asList(child, parent)); + + Map> childParentResourceMap = + ResourceDescriptorConfig.getChildParentResourceMap( + descriptorConfigMap, patternResourceDescriptorMap); + + assertThat(childParentResourceMap).isEmpty(); + } + + @Test + public void testGetChildParentResourceMapFail_PatternsMismatch() { + ResourceDescriptorConfig child = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("myservice.google.com/Child") + .addPattern("projects/{project}/children/{child}") + .addPattern("locations/{location}/children/{child}") + .build(), + protoFile, + true); + + ResourceDescriptorConfig parent = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("myservice.google.com/Parent") + .addPattern("projects/{project}") + .addPattern("projects/{project}/locations/{location}") + .build(), + protoFile, + true); + + Map descriptorConfigMap = + getDescriptorConfigMap(child, parent); + Map> patternResourceDescriptorMap = + ResourceDescriptorConfig.getPatternResourceMap(Arrays.asList(child, parent)); + + Map> childParentResourceMap = + ResourceDescriptorConfig.getChildParentResourceMap( + descriptorConfigMap, patternResourceDescriptorMap); + + assertThat(childParentResourceMap).isEmpty(); + } + + @Test + public void testGetChildParentResourceMap_MultiParentsSinglePattern() { + ResourceDescriptorConfig sauce = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("food.google.com/Sauce") + .addPattern("pizzas/{pizza}/sauces/{sauce}") + .addPattern("pastas/{pasta}/sauces/{sauce}") + .build(), + protoFile, + true); + + ResourceDescriptorConfig pizza = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("foo.google.com/Pizza") + .addPattern("pizzas/{pizza}") + .build(), + protoFile, + true); + + ResourceDescriptorConfig pasta = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("food.google.com/Pasta") + .addPattern("pastas/{pasta}") + .build(), + protoFile, + true); + + Map descriptorConfigMap = + getDescriptorConfigMap(pizza, pasta, sauce); + Map> patternResourceDescriptorMap = + ResourceDescriptorConfig.getPatternResourceMap(Arrays.asList(pizza, pasta, sauce)); + + Map> childParentResourceMap = + ResourceDescriptorConfig.getChildParentResourceMap( + descriptorConfigMap, patternResourceDescriptorMap); + + assertThat(childParentResourceMap.size()).isEqualTo(1); + assertThat(childParentResourceMap.get("food.google.com/Sauce")).containsExactly(pizza, pasta); + } + + @Test + public void testGetChildParentResourceMap_MultiParentsMultiPatterns() { + ResourceDescriptorConfig sauce = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("food.google.com/Sauce") + .addPattern("steaks/{steak}/sauces/{sauce}") + .addPattern("barbeques/{barbeque}/sauces/{sauce}") + .addPattern("tofus/{tofu}/sauces/{sauce}") + .addPattern("salads/{salad}/sauces/{sauce}") + .build(), + protoFile, + true); + + ResourceDescriptorConfig meat = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("food.google.com/Meat") + .addPattern("steaks/{steak}") + .addPattern("barbeques/{barbeque}") + .build(), + protoFile, + true); + + ResourceDescriptorConfig veggie = + ResourceDescriptorConfig.from( + ResourceDescriptor.newBuilder() + .setType("food.google.com/Veggie") + .addPattern("tofus/{tofu}") + .addPattern("salads/{salad}") + .build(), + protoFile, + true); + + Map descriptorConfigMap = + getDescriptorConfigMap(sauce, meat, veggie); + Map> patternResourceDescriptorMap = + ResourceDescriptorConfig.getPatternResourceMap(Arrays.asList(sauce, meat, veggie)); + + Map> childParentResourceMap = + ResourceDescriptorConfig.getChildParentResourceMap( + descriptorConfigMap, patternResourceDescriptorMap); + + assertThat(childParentResourceMap.size()).isEqualTo(1); + assertThat(childParentResourceMap.get("food.google.com/Sauce")).containsExactly(veggie, meat); + } + + private static Map getDescriptorConfigMap( + ResourceDescriptorConfig... resources) { + ImmutableMap.Builder builder = ImmutableMap.builder(); + for (ResourceDescriptorConfig resource : resources) { + builder.put(resource.getUnifiedResourceType(), resource); + } + return builder.build(); + } } diff --git a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java index ca31c08ad2..35ad9f38f4 100644 --- a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java +++ b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java @@ -256,7 +256,7 @@ public void testCreateResourceNamesWithProtoFilesOnly() { protoParser, resourceDescriptorConfigMap, Collections.emptyMap()); - + System.out.println(messageConfigs.getResourceTypeConfigMap()); assertThat(messageConfigs.getResourceTypeConfigMap().size()).isEqualTo(2); ResourceNameMessageConfig bookMessageConfig = messageConfigs.getResourceTypeConfigMap().get("library.Book"); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 4a64d6688c..a1648542a2 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -9092,60 +9092,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetShelf() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = client.GetShelf(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = await client.GetShelfAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9172,7 +9118,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync2() + public async Task GetShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9199,65 +9145,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = client.GetShelf(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = await client.GetShelfAsync(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf4() + public void GetShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9286,7 +9174,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync4() + public async Task GetShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9315,69 +9203,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = client.GetShelf(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = await client.GetShelfAsync(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf6() + public void GetShelf3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9408,7 +9234,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync6() + public async Task GetShelfAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9439,7 +9265,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf7() + public void GetShelf4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9466,7 +9292,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync7() + public async Task GetShelfAsync4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9494,48 +9320,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteShelf() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - client.DeleteShelf(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task DeleteShelfAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - await client.DeleteShelfAsync(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void DeleteShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9556,7 +9340,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteShelfAsync2() + public async Task DeleteShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9577,7 +9361,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void DeleteShelf3() + public void DeleteShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9597,7 +9381,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteShelfAsync3() + public async Task DeleteShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9626,8 +9410,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -9655,8 +9439,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -9682,10 +9466,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest + MergeShelvesRequest request = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -9693,12 +9477,10 @@ namespace Google.Example.Library.V1.Tests Theme = "theme110327241", InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = client.MergeShelves(name, otherShelfName); + Shelf response = client.MergeShelves(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -9711,63 +9493,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest - { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = await client.MergeShelvesAsync(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MergeShelves3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest - { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.MergeShelves(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MergeShelvesAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest + MergeShelvesRequest request = new MergeShelvesRequest { ShelfName = new ShelfName("[SHELF]"), OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), @@ -9788,66 +9514,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void CreateBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = client.CreateBook(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task CreateBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = await client.CreateBookAsync(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void CreateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9877,7 +9543,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task CreateBookAsync2() + public async Task CreateBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9907,7 +9573,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void CreateBook3() + public void CreateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9935,7 +9601,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task CreateBookAsync3() + public async Task CreateBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10108,62 +9774,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book response = client.GetBook(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book response = await client.GetBookAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10191,7 +9801,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookAsync2() + public async Task GetBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10219,7 +9829,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBook3() + public void GetBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10246,7 +9856,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookAsync3() + public async Task GetBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10274,48 +9884,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - client.DeleteBook(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task DeleteBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - await client.DeleteBookAsync(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void DeleteBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10336,7 +9904,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteBookAsync2() + public async Task DeleteBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10357,7 +9925,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void DeleteBook3() + public void DeleteBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10377,7 +9945,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteBookAsync3() + public async Task DeleteBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10406,7 +9974,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -10436,7 +10004,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -10467,7 +10035,10 @@ namespace Google.Example.Library.V1.Tests UpdateBookRequest expectedRequest = new UpdateBookRequest { Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -10480,8 +10051,11 @@ namespace Google.Example.Library.V1.Tests .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - Book response = client.UpdateBook(name, book); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -10497,7 +10071,10 @@ namespace Google.Example.Library.V1.Tests UpdateBookRequest expectedRequest = new UpdateBookRequest { Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -10510,8 +10087,11 @@ namespace Google.Example.Library.V1.Tests .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - Book response = await client.UpdateBookAsync(name, book); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -10524,13 +10104,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest + UpdateBookRequest request = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -10539,157 +10116,16 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + Book response = client.UpdateBook(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] public async Task UpdateBookAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBook4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - Name = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookAsync4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - Name = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBook5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.UpdateBook(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookAsync5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10718,66 +10154,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void MoveBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = client.MoveBook(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = await client.MoveBookAsync(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10807,7 +10183,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MoveBookAsync2() + public async Task MoveBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10837,7 +10213,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void MoveBook3() + public void MoveBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10865,7 +10241,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MoveBookAsync3() + public async Task MoveBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10902,7 +10278,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -10941,7 +10317,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -10978,9 +10354,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + AddCommentsRequest request = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -10992,20 +10368,10 @@ namespace Google.Example.Library.V1.Tests }, }; Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.AddComments(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - client.AddComments(name, comments); + client.AddComments(request); mockGrpcClient.VerifyAll(); } @@ -11017,9 +10383,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + AddCommentsRequest request = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -11031,93 +10397,25 @@ namespace Google.Example.Library.V1.Tests }, }; Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.AddCommentsAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - await client.AddCommentsAsync(name, comments); + await client.AddCommentsAsync(request); mockGrpcClient.VerifyAll(); } [Fact] - public void AddComments3() + public void GetBookFromArchive() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest request = new AddCommentsRequest + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddComments(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.AddComments(request); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task AddCommentsAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - AddCommentsRequest request = new AddCommentsRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddCommentsAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - await client.AddCommentsAsync(request); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromArchive() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - ParentAsLocationParentNameOneof = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), + Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -11138,66 +10436,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public async Task GetBookFromArchiveAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - ParentAsLocationParentNameOneof = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), - }; - BookFromArchive expectedResponse = new BookFromArchive - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); - BookFromArchive response = await client.GetBookFromArchiveAsync(name, parent); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromArchive2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - Parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), - }; - BookFromArchive expectedResponse = new BookFromArchive - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); - BookFromArchive response = client.GetBookFromArchive(name, parent); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromArchiveAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11227,7 +10465,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromArchive3() + public void GetBookFromArchive2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11255,7 +10493,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromArchiveAsync3() + public async Task GetBookFromArchiveAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11284,74 +10522,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAnywhere() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName, place, folder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromAnywhereAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName, place, folder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11385,7 +10555,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAnywhereAsync2() + public async Task GetBookFromAnywhereAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11419,7 +10589,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromAnywhere3() + public void GetBookFromAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11449,7 +10619,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAnywhereAsync3() + public async Task GetBookFromAnywhereAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11480,62 +10650,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAbsolutelyAnywhere() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest - { - AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest - { - AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromAbsolutelyAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11563,7 +10677,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync2() + public async Task GetBookFromAbsolutelyAnywhereAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11591,7 +10705,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromAbsolutelyAnywhere3() + public void GetBookFromAbsolutelyAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11618,7 +10732,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync3() + public async Task GetBookFromAbsolutelyAnywhereAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11654,7 +10768,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -11685,7 +10799,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -11714,9 +10828,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest + UpdateBookIndexRequest request = new UpdateBookIndexRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -11724,69 +10838,7 @@ namespace Google.Example.Library.V1.Tests }, }; Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "indexMapItem1918721251" }, - }; - client.UpdateBookIndex(name, indexName, indexMap); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookIndexAsync2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest - { - Name = new BookName("[SHELF]", "[BOOK]"), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "indexMapItem1918721251" }, - }; - await client.UpdateBookIndexAsync(name, indexName, indexMap); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBookIndex3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest request = new UpdateBookIndexRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndex(request, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBookIndex(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); client.UpdateBookIndex(request); @@ -11794,7 +10846,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookIndexAsync3() + public async Task UpdateBookIndexAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11832,560 +10884,32 @@ namespace Google.Example.Library.V1.Tests .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void TestOptionalRequiredFlatteningParams2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync2() + public async Task TestOptionalRequiredFlatteningParamsAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, - }; + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void TestOptionalRequiredFlatteningParams3() + public void TestOptionalRequiredFlatteningParams2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12649,7 +11173,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync3() + public async Task TestOptionalRequiredFlatteningParamsAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12913,7 +11437,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void TestOptionalRequiredFlatteningParams4() + public void TestOptionalRequiredFlatteningParams3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12994,7 +11518,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync4() + public async Task TestOptionalRequiredFlatteningParamsAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 2cc7d3de7a..516a42fcc0 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -5719,60 +5719,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetShelf() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = client.GetShelf(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = await client.GetShelfAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5799,7 +5745,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync2() + public async Task GetShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5826,65 +5772,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = client.GetShelf(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = await client.GetShelfAsync(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf4() + public void GetShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5913,7 +5801,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync4() + public async Task GetShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -5942,69 +5830,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = client.GetShelf(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = await client.GetShelfAsync(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf6() + public void GetShelf3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6035,7 +5861,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync6() + public async Task GetShelfAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6066,7 +5892,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf7() + public void GetShelf4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6093,7 +5919,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync7() + public async Task GetShelfAsync4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6121,48 +5947,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteShelf() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - client.DeleteShelf(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task DeleteShelfAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - await client.DeleteShelfAsync(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void DeleteShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6183,7 +5967,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteShelfAsync2() + public async Task DeleteShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6204,7 +5988,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void DeleteShelf3() + public void DeleteShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6224,7 +6008,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteShelfAsync3() + public async Task DeleteShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6253,8 +6037,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -6282,8 +6066,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -6309,10 +6093,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest + MergeShelvesRequest request = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -6320,12 +6104,10 @@ namespace Google.Example.Library.V1.Tests Theme = "theme110327241", InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = client.MergeShelves(name, otherShelfName); + Shelf response = client.MergeShelves(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -6338,63 +6120,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest - { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = await client.MergeShelvesAsync(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MergeShelves3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest - { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.MergeShelves(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MergeShelvesAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest + MergeShelvesRequest request = new MergeShelvesRequest { ShelfName = new ShelfName("[SHELF]"), OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), @@ -6415,66 +6141,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void CreateBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = client.CreateBook(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task CreateBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = await client.CreateBookAsync(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void CreateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6504,7 +6170,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task CreateBookAsync2() + public async Task CreateBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6534,7 +6200,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void CreateBook3() + public void CreateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6562,7 +6228,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task CreateBookAsync3() + public async Task CreateBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6735,62 +6401,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book response = client.GetBook(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book response = await client.GetBookAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6818,7 +6428,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookAsync2() + public async Task GetBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6846,7 +6456,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBook3() + public void GetBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6873,7 +6483,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookAsync3() + public async Task GetBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6901,48 +6511,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - client.DeleteBook(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task DeleteBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - await client.DeleteBookAsync(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void DeleteBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6963,7 +6531,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteBookAsync2() + public async Task DeleteBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -6984,7 +6552,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void DeleteBook3() + public void DeleteBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7004,7 +6572,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteBookAsync3() + public async Task DeleteBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7033,7 +6601,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -7063,7 +6631,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -7094,7 +6662,10 @@ namespace Google.Example.Library.V1.Tests UpdateBookRequest expectedRequest = new UpdateBookRequest { Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -7107,8 +6678,11 @@ namespace Google.Example.Library.V1.Tests .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - Book response = client.UpdateBook(name, book); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -7124,7 +6698,10 @@ namespace Google.Example.Library.V1.Tests UpdateBookRequest expectedRequest = new UpdateBookRequest { Name = new BookName("[SHELF]", "[BOOK]"), + OptionalFoo = "optionalFoo1822578535", Book = new Book(), + UpdateMask = new FieldMask(), + PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -7137,8 +6714,11 @@ namespace Google.Example.Library.V1.Tests .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = "optionalFoo1822578535"; Book book = new Book(); - Book response = await client.UpdateBookAsync(name, book); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -7151,13 +6731,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest + UpdateBookRequest request = new UpdateBookRequest { BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), }; Book expectedResponse = new Book { @@ -7166,157 +6743,16 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + Book response = client.UpdateBook(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] public async Task UpdateBookAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBook4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - Name = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookAsync4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - Name = new BookName("[SHELF]", "[BOOK]"), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBook5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest request = new UpdateBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBook(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.UpdateBook(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookAsync5() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7345,66 +6781,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void MoveBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = client.MoveBook(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = await client.MoveBookAsync(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7434,7 +6810,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MoveBookAsync2() + public async Task MoveBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7464,7 +6840,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void MoveBook3() + public void MoveBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7492,7 +6868,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MoveBookAsync3() + public async Task MoveBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7529,7 +6905,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -7568,7 +6944,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -7605,9 +6981,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + AddCommentsRequest request = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -7619,20 +6995,10 @@ namespace Google.Example.Library.V1.Tests }, }; Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.AddComments(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - client.AddComments(name, comments); + client.AddComments(request); mockGrpcClient.VerifyAll(); } @@ -7644,9 +7010,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest + AddCommentsRequest request = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -7658,92 +7024,24 @@ namespace Google.Example.Library.V1.Tests }, }; Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.AddCommentsAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - await client.AddCommentsAsync(name, comments); + await client.AddCommentsAsync(request); mockGrpcClient.VerifyAll(); } [Fact] - public void AddComments3() + public void GetBookFromArchive() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - AddCommentsRequest request = new AddCommentsRequest + GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddComments(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.AddComments(request); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task AddCommentsAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - AddCommentsRequest request = new AddCommentsRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddCommentsAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - await client.AddCommentsAsync(request); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromArchive() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -7763,62 +7061,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public async Task GetBookFromArchiveAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - }; - BookFromArchive expectedResponse = new BookFromArchive - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - BookFromArchive response = await client.GetBookFromArchiveAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromArchive2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - }; - BookFromArchive expectedResponse = new BookFromArchive - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - BookFromArchive response = client.GetBookFromArchive(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromArchiveAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7846,7 +7088,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromArchive3() + public void GetBookFromArchive2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7873,7 +7115,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromArchiveAsync3() + public async Task GetBookFromArchiveAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7901,66 +7143,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAnywhere() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromAnywhereAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -7990,7 +7172,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAnywhereAsync2() + public async Task GetBookFromAnywhereAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8020,7 +7202,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromAnywhere3() + public void GetBookFromAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8048,7 +7230,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAnywhereAsync3() + public async Task GetBookFromAnywhereAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8077,62 +7259,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromAbsolutelyAnywhere() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest - { - AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest - { - AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromAbsolutelyAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8160,7 +7286,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync2() + public async Task GetBookFromAbsolutelyAnywhereAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8188,7 +7314,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromAbsolutelyAnywhere3() + public void GetBookFromAbsolutelyAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8215,7 +7341,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync3() + public async Task GetBookFromAbsolutelyAnywhereAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -8251,7 +7377,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -8282,7 +7408,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - BookName = new BookName("[SHELF]", "[BOOK]"), + Name = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -8304,557 +7430,95 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void UpdateBookIndex2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest - { - Name = new BookName("[SHELF]", "[BOOK]"), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "indexMapItem1918721251" }, - }; - client.UpdateBookIndex(name, indexName, indexMap); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookIndexAsync2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest - { - Name = new BookName("[SHELF]", "[BOOK]"), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "indexMapItem1918721251" }, - }; - await client.UpdateBookIndexAsync(name, indexName, indexMap); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBookIndex3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest request = new UpdateBookIndexRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndex(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - client.UpdateBookIndex(request); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookIndexAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest request = new UpdateBookIndexRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - await client.UpdateBookIndexAsync(request); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void TestOptionalRequiredFlatteningParams() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void TestOptionalRequiredFlatteningParams2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync2() + public void UpdateBookIndex2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + UpdateBookIndexRequest request = new UpdateBookIndexRequest { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, + BookName = new BookName("[SHELF]", "[BOOK]"), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, + }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndex(request, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + client.UpdateBookIndex(request); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task UpdateBookIndexAsync2() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + UpdateBookIndexRequest request = new UpdateBookIndexRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + IndexName = "default index", + IndexMap = + { + { "default_key", "indexMapItem1918721251" }, + }, }; + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + await client.UpdateBookIndexAsync(request); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public void TestOptionalRequiredFlatteningParams() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) + .Returns(expectedResponse); + LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); + + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(); + Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [Fact] + public async Task TestOptionalRequiredFlatteningParamsAsync() + { + Mock mockGrpcClient = new Mock(MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateLabelerClient()) + .Returns(new Mock().Object); + mockGrpcClient.Setup(x => x.CreateOperationsClient()) + .Returns(new Mock().Object); + TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest(); TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void TestOptionalRequiredFlatteningParams3() + public void TestOptionalRequiredFlatteningParams2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9054,7 +7718,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync3() + public async Task TestOptionalRequiredFlatteningParamsAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9254,7 +7918,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void TestOptionalRequiredFlatteningParams4() + public void TestOptionalRequiredFlatteningParams3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -9303,7 +7967,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync4() + public async Task TestOptionalRequiredFlatteningParamsAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index 904893d927..c5daf7e55b 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -9920,60 +9920,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetShelf() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = client.GetShelf(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Shelf response = await client.GetShelfAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10000,7 +9946,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync2() + public async Task GetShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10027,65 +9973,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = client.GetShelf(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - Shelf response = await client.GetShelfAsync(name, message); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf4() + public void GetShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10114,7 +10002,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync4() + public async Task GetShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10143,69 +10031,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = client.GetShelf(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetShelfAsync5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetShelfRequest expectedRequest = new GetShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - Message = new SomeMessage(), - StringBuilder = new StringBuilder(), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.GetShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - Shelf response = await client.GetShelfAsync(name, message, stringBuilder); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetShelf6() + public void GetShelf3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10236,7 +10062,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync6() + public async Task GetShelfAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10267,7 +10093,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetShelf7() + public void GetShelf4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10294,7 +10120,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetShelfAsync7() + public async Task GetShelfAsync4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10322,48 +10148,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteShelf() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - client.DeleteShelf(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task DeleteShelfAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteShelfRequest expectedRequest = new DeleteShelfRequest - { - ShelfName = new ShelfName("[SHELF]"), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - await client.DeleteShelfAsync(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void DeleteShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10384,7 +10168,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteShelfAsync2() + public async Task DeleteShelfAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10405,7 +10189,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void DeleteShelf3() + public void DeleteShelf2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10425,7 +10209,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteShelfAsync3() + public async Task DeleteShelfAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10454,8 +10238,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -10483,8 +10267,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = new ShelfName("[SHELF]"), + OtherShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -10510,10 +10294,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest + MergeShelvesRequest request = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -10521,12 +10305,10 @@ namespace Google.Example.Library.V1.Tests Theme = "theme110327241", InternalTheme = "internalTheme792518087", }; - mockGrpcClient.Setup(x => x.MergeShelves(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = client.MergeShelves(name, otherShelfName); + Shelf response = client.MergeShelves(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -10539,63 +10321,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MergeShelvesRequest expectedRequest = new MergeShelvesRequest - { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelvesAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Shelf response = await client.MergeShelvesAsync(name, otherShelfName); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MergeShelves3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest - { - ShelfName = new ShelfName("[SHELF]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Shelf expectedResponse = new Shelf - { - ShelfName = new ShelfName("[SHELF]"), - Theme = "theme110327241", - InternalTheme = "internalTheme792518087", - }; - mockGrpcClient.Setup(x => x.MergeShelves(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf response = client.MergeShelves(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MergeShelvesAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MergeShelvesRequest request = new MergeShelvesRequest + MergeShelvesRequest request = new MergeShelvesRequest { ShelfName = new ShelfName("[SHELF]"), OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), @@ -10616,66 +10342,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void CreateBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = client.CreateBook(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task CreateBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - CreateBookRequest expectedRequest = new CreateBookRequest - { - ShelfName = new ShelfName("[SHELF]"), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.CreateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - Book response = await client.CreateBookAsync(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void CreateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10705,7 +10371,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task CreateBookAsync2() + public async Task CreateBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10735,7 +10401,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void CreateBook3() + public void CreateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10763,7 +10429,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task CreateBookAsync3() + public async Task CreateBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10792,90 +10458,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void PublishSeries() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - PublishSeriesRequest expectedRequest = new PublishSeriesRequest - { - Shelf = new Shelf(), - Books = { }, - Edition = 1887963714, - SeriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }, - PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), - }; - PublishSeriesResponse expectedResponse = new PublishSeriesResponse - { - BookNames = - { - "bookNamesElement1491670575", - }, - }; - mockGrpcClient.Setup(x => x.PublishSeries(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 1887963714; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = client.PublishSeries(shelf, books, edition, seriesUuid, publisher); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task PublishSeriesAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - PublishSeriesRequest expectedRequest = new PublishSeriesRequest - { - Shelf = new Shelf(), - Books = { }, - Edition = 1887963714, - SeriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }, - PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), - }; - PublishSeriesResponse expectedResponse = new PublishSeriesResponse - { - BookNames = - { - "bookNamesElement1491670575", - }, - }; - mockGrpcClient.Setup(x => x.PublishSeriesAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 1887963714; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - PublishSeriesResponse response = await client.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void PublishSeries2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10917,7 +10499,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task PublishSeriesAsync2() + public async Task PublishSeriesAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10959,7 +10541,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void PublishSeries3() + public void PublishSeries2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -10991,7 +10573,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task PublishSeriesAsync3() + public async Task PublishSeriesAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11032,7 +10614,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Book expectedResponse = new Book { @@ -11060,7 +10642,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Book expectedResponse = new Book { @@ -11086,9 +10668,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest + GetBookRequest request = new GetBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Book expectedResponse = new Book { @@ -11097,11 +10679,10 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book response = client.GetBook(name); + Book response = client.GetBook(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -11114,9 +10695,9 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookRequest expectedRequest = new GetBookRequest + GetBookRequest request = new GetBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Book expectedResponse = new Book { @@ -11125,101 +10706,46 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBookAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetBookAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book response = await client.GetBookAsync(name); + Book response = await client.GetBookAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBook3() + public void DeleteBook() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookRequest request = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - Book expectedResponse = new Book + DeleteBookRequest expectedRequest = new DeleteBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; - mockGrpcClient.Setup(x => x.GetBook(request, It.IsAny())) + Empty expectedResponse = new Empty(); + mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.GetBook(request); - Assert.Same(expectedResponse, response); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + client.DeleteBook(name); mockGrpcClient.VerifyAll(); } [Fact] - public async Task GetBookAsync3() + public async Task DeleteBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookRequest request = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - Book expectedResponse = new Book + DeleteBookRequest expectedRequest = new DeleteBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.GetBookAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void DeleteBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - client.DeleteBook(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task DeleteBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) @@ -11232,48 +10758,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void DeleteBook2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - client.DeleteBook(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task DeleteBookAsync2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - DeleteBookRequest expectedRequest = new DeleteBookRequest - { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - await client.DeleteBookAsync(name); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void DeleteBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11293,7 +10777,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task DeleteBookAsync3() + public async Task DeleteBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11314,66 +10798,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void UpdateBook() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); - Book response = client.UpdateBook(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); - Book response = await client.UpdateBookAsync(name, book); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11403,7 +10827,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookAsync2() + public async Task UpdateBookAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11433,79 +10857,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void UpdateBook3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBook(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = client.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookRequest expectedRequest = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalFoo = "optionalFoo1822578535", - Book = new Book(), - UpdateMask = new FieldMask(), - PhysicalMask = new apis::FieldMask(), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.UpdateBookAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = "optionalFoo1822578535"; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - Book response = await client.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBook4() + public void UpdateBook2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11541,7 +10893,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookAsync4() + public async Task UpdateBookAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11577,7 +10929,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void UpdateBook5() + public void UpdateBook3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11605,7 +10957,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookAsync5() + public async Task UpdateBookAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11642,8 +10994,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -11672,8 +11024,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -11700,10 +11052,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + MoveBookRequest request = new MoveBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfName = new ShelfName("[SHELF]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -11712,12 +11064,10 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBook(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = client.MoveBook(name, otherShelfName); + Book response = client.MoveBook(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -11730,10 +11080,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBookRequest expectedRequest = new MoveBookRequest + MoveBookRequest request = new MoveBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfName = new ShelfName("[SHELF]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -11742,152 +11092,16 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.MoveBookAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - Book response = await client.MoveBookAsync(name, otherShelfName); + Book response = await client.MoveBookAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBook3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.MoveBook(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = client.MoveBook(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBookAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBookRequest request = new MoveBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - Book expectedResponse = new Book - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.MoveBookAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - Book response = await client.MoveBookAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void AddComments() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddComments(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - client.AddComments(name, comments); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task AddCommentsAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - AddCommentsRequest expectedRequest = new AddCommentsRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Comments = - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.AddCommentsAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.CopyFromUtf8("95"), - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - await client.AddCommentsAsync(name, comments); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void AddComments2() + public void AddComments() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11926,7 +11140,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task AddCommentsAsync2() + public async Task AddCommentsAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11965,7 +11179,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void AddComments3() + public void AddComments2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -11994,7 +11208,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task AddCommentsAsync3() + public async Task AddCommentsAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12024,66 +11238,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void GetBookFromArchive() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - ParentAsProjectName = new ProjectName("[PROJECT]"), - }; - BookFromArchive expectedResponse = new BookFromArchive - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromArchive(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - BookFromArchive response = client.GetBookFromArchive(name, parent); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromArchiveAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - ParentAsProjectName = new ProjectName("[PROJECT]"), - }; - BookFromArchive expectedResponse = new BookFromArchive - { - ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromArchiveAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - BookFromArchive response = await client.GetBookFromArchiveAsync(name, parent); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromArchive2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12113,7 +11267,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromArchiveAsync2() + public async Task GetBookFromArchiveAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12143,7 +11297,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromArchive3() + public void GetBookFromArchive2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12171,7 +11325,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromArchiveAsync3() + public async Task GetBookFromArchiveAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12208,10 +11362,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Place = new LocationName("[PROJECT]", "[LOCATION]"), + Folder = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -12242,10 +11396,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), + Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Place = new LocationName("[PROJECT]", "[LOCATION]"), + Folder = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -12274,12 +11428,12 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Place = new LocationName("[PROJECT]", "[LOCATION]"), - Folder = new FolderName("[FOLDER]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -12288,14 +11442,10 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhere(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetBookFromAnywhere(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - BookFromAnywhere response = client.GetBookFromAnywhere(name, altBookName, place, folder); + BookFromAnywhere response = client.GetBookFromAnywhere(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -12308,12 +11458,12 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest + GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Place = new LocationName("[PROJECT]", "[LOCATION]"), - Folder = new FolderName("[FOLDER]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -12322,143 +11472,23 @@ namespace Google.Example.Library.V1.Tests Title = "title110371416", Read = true, }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(expectedRequest, It.IsAny())) + mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(request, It.IsAny())) .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - BookFromAnywhere response = await client.GetBookFromAnywhereAsync(name, altBookName, place, folder); + BookFromAnywhere response = await client.GetBookFromAnywhereAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void GetBookFromAnywhere3() + public void GetBookFromAbsolutelyAnywhere() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhere(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromAnywhere response = client.GetBookFromAnywhere(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromAnywhereAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAnywhereAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookFromAnywhere response = await client.GetBookFromAnywhereAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromAbsolutelyAnywhere() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhere(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = client.GetBookFromAbsolutelyAnywhere(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - BookFromAnywhere expectedResponse = new BookFromAnywhere - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Author = "author-1406328437", - Title = "title110371416", - Read = true, - }; - mockGrpcClient.Setup(x => x.GetBookFromAbsolutelyAnywhereAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookFromAnywhere response = await client.GetBookFromAbsolutelyAnywhereAsync(name); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void GetBookFromAbsolutelyAnywhere2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest + GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest { Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; @@ -12479,7 +11509,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync2() + public async Task GetBookFromAbsolutelyAnywhereAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12507,7 +11537,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void GetBookFromAbsolutelyAnywhere3() + public void GetBookFromAbsolutelyAnywhere2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12534,7 +11564,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task GetBookFromAbsolutelyAnywhereAsync3() + public async Task GetBookFromAbsolutelyAnywhereAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12562,68 +11592,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void UpdateBookIndex() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndex(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "indexMapItem1918721251" }, - }; - client.UpdateBookIndex(name, indexName, indexMap); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task UpdateBookIndexAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - IndexName = "default index", - IndexMap = - { - { "default_key", "indexMapItem1918721251" }, - }, - }; - Empty expectedResponse = new Empty(); - mockGrpcClient.Setup(x => x.UpdateBookIndexAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "indexMapItem1918721251" }, - }; - await client.UpdateBookIndexAsync(name, indexName, indexMap); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void UpdateBookIndex2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12654,7 +11622,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookIndexAsync2() + public async Task UpdateBookIndexAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12685,7 +11653,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void UpdateBookIndex3() + public void UpdateBookIndex2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12710,7 +11678,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task UpdateBookIndexAsync3() + public async Task UpdateBookIndexAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -12791,8 +11759,8 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, @@ -12852,8 +11820,8 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, @@ -12932,8 +11900,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); @@ -12993,8 +11961,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); @@ -13031,7 +11999,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -13055,8 +12023,8 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, @@ -13116,8 +12084,8 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, @@ -13196,8 +12164,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable formattedRequiredRepeatedResourceName = new List(); + IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); @@ -13257,8 +12225,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable formattedOptionalRepeatedResourceName = new List(); + IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); @@ -13295,7 +12263,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -13308,7 +12276,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest { RequiredSingularInt32 = 72313594, RequiredSingularInt64 = 72313499L, @@ -13319,8 +12287,8 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, @@ -13333,8 +12301,8 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameAsBookNameOneofs = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, @@ -13371,1185 +12339,99 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedStringValue = { }, RequiredRepeatedBoolValue = { }, RequiredRepeatedBytesValue = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest expectedRequest = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - OptionalSingularInt32 = 1196565723, - OptionalSingularInt64 = 1196565628L, - OptionalSingularFloat = -1.19939918E8f, - OptionalSingularDouble = 1.41902287E8, - OptionalSingularBool = false, - OptionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - OptionalSingularString = "optionalSingularString1852995162", - OptionalSingularBytes = ByteString.CopyFromUtf8("2"), - OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", - OptionalSingularFixed32 = 1648847958, - OptionalSingularFixed64 = 1648847863, - OptionalRepeatedInt32 = { }, - OptionalRepeatedInt64 = { }, - OptionalRepeatedFloat = { }, - OptionalRepeatedDouble = { }, - OptionalRepeatedBool = { }, - OptionalRepeatedEnum = { }, - OptionalRepeatedString = { }, - OptionalRepeatedBytes = { }, - OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, - OptionalRepeatedFixed32 = { }, - OptionalRepeatedFixed64 = { }, - OptionalMap = { }, - AnyValue = new Any(), - StructValue = new Struct(), - ValueValue = new Value(), - ListValueValue = new ListValue(), - TimeValue = new Timestamp(), - DurationValue = new Duration(), - FieldMaskValue = new FieldMask(), - Int32Value = null, - Uint32Value = null, - Int64Value = null, - Uint64Value = null, - FloatValue = null, - DoubleValue = null, - StringValue = null, - BoolValue = null, - BytesValue = null, - RepeatedAnyValue = { }, - RepeatedStructValue = { }, - RepeatedValueValue = { }, - RepeatedListValueValue = { }, - RepeatedTimeValue = { }, - RepeatedDurationValue = { }, - RepeatedFieldMaskValue = { }, - RepeatedInt32Value = { }, - RepeatedUint32Value = { }, - RepeatedInt64Value = { }, - RepeatedUint64Value = { }, - RepeatedFloatValue = { }, - RepeatedDoubleValue = { }, - RepeatedStringValue = { }, - RepeatedBoolValue = { }, - RepeatedBytesValue = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - int requiredSingularInt32 = 72313594; - long requiredSingularInt64 = 72313499L; - float requiredSingularFloat = -7514705.0f; - double requiredSingularDouble = 1.9111005E8; - bool requiredSingularBool = true; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = "requiredSingularString-1949894503"; - ByteString requiredSingularBytes = ByteString.CopyFromUtf8("-29"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002"; - int requiredSingularFixed32 = 720656715; - long requiredSingularFixed64 = 720656810; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 1196565723; - long optionalSingularInt64 = 1196565628L; - float optionalSingularFloat = -1.19939918E8f; - double optionalSingularDouble = 1.41902287E8; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = "optionalSingularString1852995162"; - ByteString optionalSingularBytes = ByteString.CopyFromUtf8("2"); - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657"; - int optionalSingularFixed32 = 1648847958; - long optionalSingularFixed64 = 1648847863; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void TestOptionalRequiredFlatteningParams4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task TestOptionalRequiredFlatteningParamsAsync4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 72313594, - RequiredSingularInt64 = 72313499L, - RequiredSingularFloat = -7514705.0f, - RequiredSingularDouble = 1.9111005E8, - RequiredSingularBool = true, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "requiredSingularString-1949894503", - RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", - RequiredSingularFixed32 = 720656715, - RequiredSingularFixed64 = 720656810, - RequiredRepeatedInt32 = { }, - RequiredRepeatedInt64 = { }, - RequiredRepeatedFloat = { }, - RequiredRepeatedDouble = { }, - RequiredRepeatedBool = { }, - RequiredRepeatedEnum = { }, - RequiredRepeatedString = { }, - RequiredRepeatedBytes = { }, - RequiredRepeatedMessage = { }, - RequiredRepeatedResourceNameAsBookNameOneofs = { }, - RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, - RequiredRepeatedResourceNameCommon = { }, - RequiredRepeatedFixed32 = { }, - RequiredRepeatedFixed64 = { }, - RequiredMap = { }, - RequiredAnyValue = new Any(), - RequiredStructValue = new Struct(), - RequiredValueValue = new Value(), - RequiredListValueValue = new ListValue(), - RequiredTimeValue = new Timestamp(), - RequiredDurationValue = new Duration(), - RequiredFieldMaskValue = new FieldMask(), - RequiredInt32Value = null, - RequiredUint32Value = null, - RequiredInt64Value = null, - RequiredUint64Value = null, - RequiredFloatValue = null, - RequiredDoubleValue = null, - RequiredStringValue = null, - RequiredBoolValue = null, - RequiredBytesValue = null, - RequiredRepeatedAnyValue = { }, - RequiredRepeatedStructValue = { }, - RequiredRepeatedValueValue = { }, - RequiredRepeatedListValueValue = { }, - RequiredRepeatedTimeValue = { }, - RequiredRepeatedDurationValue = { }, - RequiredRepeatedFieldMaskValue = { }, - RequiredRepeatedInt32Value = { }, - RequiredRepeatedUint32Value = { }, - RequiredRepeatedInt64Value = { }, - RequiredRepeatedUint64Value = { }, - RequiredRepeatedFloatValue = { }, - RequiredRepeatedDoubleValue = { }, - RequiredRepeatedStringValue = { }, - RequiredRepeatedBoolValue = { }, - RequiredRepeatedBytesValue = { }, - }; - TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); - mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - DestinationAsShelfName = new ShelfName("[SHELF]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - DestinationAsShelfName = new ShelfName("[SHELF]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - DestinationAsProjectName = new ProjectName("[PROJECT]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - DestinationAsProjectName = new ProjectName("[PROJECT]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync4() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - DestinationAsShelfName = new ShelfName("[SHELF]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync5() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - DestinationAsShelfName = new ShelfName("[SHELF]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks6() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - DestinationAsProjectName = new ProjectName("[PROJECT]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync6() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - DestinationAsProjectName = new ProjectName("[PROJECT]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks7() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync7() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks8() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - DestinationAsShelfName = new ShelfName("[SHELF]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task MoveBooksAsync8() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - DestinationAsShelfName = new ShelfName("[SHELF]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void MoveBooks9() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - DestinationAsProjectName = new ProjectName("[PROJECT]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse - { - Success = false, }; - mockGrpcClient.Setup(x => x.MoveBooks(expectedRequest, It.IsAny())) + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParams(request, It.IsAny())) .Returns(expectedResponse); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public async Task MoveBooksAsync9() + public async Task TestOptionalRequiredFlatteningParamsAsync3() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) .Returns(new Mock().Object); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock().Object); - MoveBooksRequest expectedRequest = new MoveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - DestinationAsProjectName = new ProjectName("[PROJECT]"), - Publishers = { }, - ProjectAsProjectName = new ProjectName("[PROJECT]"), - }; - MoveBooksResponse expectedResponse = new MoveBooksResponse + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest { - Success = false, + RequiredSingularInt32 = 72313594, + RequiredSingularInt64 = 72313499L, + RequiredSingularFloat = -7514705.0f, + RequiredSingularDouble = 1.9111005E8, + RequiredSingularBool = true, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "requiredSingularString-1949894503", + RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", + RequiredSingularFixed32 = 720656715, + RequiredSingularFixed64 = 720656810, + RequiredRepeatedInt32 = { }, + RequiredRepeatedInt64 = { }, + RequiredRepeatedFloat = { }, + RequiredRepeatedDouble = { }, + RequiredRepeatedBool = { }, + RequiredRepeatedEnum = { }, + RequiredRepeatedString = { }, + RequiredRepeatedBytes = { }, + RequiredRepeatedMessage = { }, + RequiredRepeatedResourceNameAsBookNameOneofs = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedFixed32 = { }, + RequiredRepeatedFixed64 = { }, + RequiredMap = { }, + RequiredAnyValue = new Any(), + RequiredStructValue = new Struct(), + RequiredValueValue = new Value(), + RequiredListValueValue = new ListValue(), + RequiredTimeValue = new Timestamp(), + RequiredDurationValue = new Duration(), + RequiredFieldMaskValue = new FieldMask(), + RequiredInt32Value = null, + RequiredUint32Value = null, + RequiredInt64Value = null, + RequiredUint64Value = null, + RequiredFloatValue = null, + RequiredDoubleValue = null, + RequiredStringValue = null, + RequiredBoolValue = null, + RequiredBytesValue = null, + RequiredRepeatedAnyValue = { }, + RequiredRepeatedStructValue = { }, + RequiredRepeatedValueValue = { }, + RequiredRepeatedListValueValue = { }, + RequiredRepeatedTimeValue = { }, + RequiredRepeatedDurationValue = { }, + RequiredRepeatedFieldMaskValue = { }, + RequiredRepeatedInt32Value = { }, + RequiredRepeatedUint32Value = { }, + RequiredRepeatedInt64Value = { }, + RequiredRepeatedUint64Value = { }, + RequiredRepeatedFloatValue = { }, + RequiredRepeatedDoubleValue = { }, + RequiredRepeatedStringValue = { }, + RequiredRepeatedBoolValue = { }, + RequiredRepeatedBytesValue = { }, }; - mockGrpcClient.Setup(x => x.MoveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + TestOptionalRequiredFlatteningParamsResponse expectedResponse = new TestOptionalRequiredFlatteningParamsResponse(); + mockGrpcClient.Setup(x => x.TestOptionalRequiredFlatteningParamsAsync(request, It.IsAny())) + .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [Fact] - public void MoveBooks10() + public void MoveBooks() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -14580,7 +12462,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MoveBooksAsync10() + public async Task MoveBooksAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -14611,7 +12493,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void MoveBooks11() + public void MoveBooks2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -14632,7 +12514,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task MoveBooksAsync11() + public async Task MoveBooksAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -14654,168 +12536,6 @@ namespace Google.Example.Library.V1.Tests [Fact] public void ArchiveBooks() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - ArchiveBooksResponse response = client.ArchiveBooks(source, archive); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task ArchiveBooksAsync() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), - ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void ArchiveBooks2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - ArchiveBooksResponse response = client.ArchiveBooks(source, archive); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task ArchiveBooksAsync2() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - SourceAsShelfName = new ShelfName("[SHELF]"), - ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void ArchiveBooks3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.ArchiveBooks(expectedRequest, It.IsAny())) - .Returns(expectedResponse); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - ArchiveBooksResponse response = client.ArchiveBooks(source, archive); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public async Task ArchiveBooksAsync3() - { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - mockGrpcClient.Setup(x => x.CreateLabelerClient()) - .Returns(new Mock().Object); - mockGrpcClient.Setup(x => x.CreateOperationsClient()) - .Returns(new Mock().Object); - ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest - { - SourceAsProjectName = new ProjectName("[PROJECT]"), - ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), - }; - ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse - { - Success = false, - }; - mockGrpcClient.Setup(x => x.ArchiveBooksAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); - LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - ArchiveBooksResponse response = await client.ArchiveBooksAsync(source, archive); - Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [Fact] - public void ArchiveBooks4() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -14842,7 +12562,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task ArchiveBooksAsync4() + public async Task ArchiveBooksAsync() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -14869,7 +12589,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public void ArchiveBooks5() + public void ArchiveBooks2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) @@ -14890,7 +12610,7 @@ namespace Google.Example.Library.V1.Tests } [Fact] - public async Task ArchiveBooksAsync5() + public async Task ArchiveBooksAsync2() { Mock mockGrpcClient = new Mock(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateLabelerClient()) From f8f97a14e3295829c469951f851a45fe92fa10a4 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 05:33:34 +0800 Subject: [PATCH 19/36] wip --- .../api/codegen/config/FieldConfig.java | 3 +- .../api/codegen/config/FlatteningConfig.java | 3 +- .../api/codegen/config/ProtoMethodModel.java | 2 +- .../config/FieldConfigFactoryTest.java | 2 +- .../codegen/config/FlatteningConfigTest.java | 263 ++++++++++++++++++ 5 files changed, 269 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index b0d5c337cd..58521419c1 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -236,7 +236,8 @@ public FieldConfig withResourceNameConfig(ResourceNameConfig resourceNameConfig) public FieldConfig withResourceNameInSampleOnly() { ResourceNameTreatment newTreatment = ResourceNameTreatment.NONE; - if (ResourceNameTreatment.STATIC_TYPES.equals(getResourceNameTreatment())) { + if (ResourceNameTreatment.STATIC_TYPES.equals(getResourceNameTreatment()) + || ResourceNameTreatment.SAMPLE_ONLY.equals(getResourceNameTreatment())) { newTreatment = ResourceNameTreatment.SAMPLE_ONLY; } return FieldConfig.createFieldConfig( diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index e65b83e737..df5a95e8c4 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -263,7 +263,8 @@ private static FlatteningConfig createFlatteningFromConfigProto( * proto annotations, linking it up with the provided method. */ @Nullable - private static List createFlatteningsFromProtoFile( + @VisibleForTesting + static List createFlatteningsFromProtoFile( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, ImmutableMap resourceNameConfigs, diff --git a/src/main/java/com/google/api/codegen/config/ProtoMethodModel.java b/src/main/java/com/google/api/codegen/config/ProtoMethodModel.java index b61133239f..47797877d7 100644 --- a/src/main/java/com/google/api/codegen/config/ProtoMethodModel.java +++ b/src/main/java/com/google/api/codegen/config/ProtoMethodModel.java @@ -36,7 +36,7 @@ import java.util.Map; /** A wrapper around the model of a protobuf-defined Method. */ -public final class ProtoMethodModel implements MethodModel { +public class ProtoMethodModel implements MethodModel { private final Method method; private List inputFields; private List outputFields; diff --git a/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java b/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java index 44f42d80ac..0fd7f6cbb2 100644 --- a/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java +++ b/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java @@ -1,4 +1,4 @@ -/* Copyright 2018 Google LLC +/* Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java index e69de29bb2..2794df7523 100644 --- a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java +++ b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java @@ -0,0 +1,263 @@ +/* Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.codegen.config; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.when; + +import com.google.api.codegen.ResourceNameTreatment; +import com.google.api.codegen.util.Name; +import com.google.api.codegen.util.ProtoParser; +import com.google.api.tools.framework.model.Diag; +import com.google.api.tools.framework.model.DiagCollector; +import com.google.api.tools.framework.model.Field; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; +import java.util.List; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class FlatteningConfigTest { + + @Mock private ProtoParser protoParser; + @Mock private DiagCollector diagCollector; + // @Mock private Method createMigrationRoutesRpc; + // @Mock private TypeRef createMigrationRoutesRequestTypeRef; + // @Mock private MessageType createMigrationRoutesRequestMessage; + @Mock private Field dummyField; + // @Mock private TypeRef dummyTypeRef; + @Mock private ProtoField source; + @Mock private ProtoField destination; + @Mock private ProtoField animals; + + @Mock private ProtoMethodModel createMigrationRoutes; + private ResourceNameMessageConfig messageConfig; + private ResourceNameMessageConfigs messageConfigs; + private ImmutableMap resourceNameConfigs; + private ResourceNameConfig county; + private ResourceNameConfig state; + private ResourceNameConfig bird; + private ResourceNameConfig fish; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + when(protoParser.hasResourceReference(any(Field.class))).thenReturn(true); + doThrow(new IllegalStateException("expect no errors")) + .when(diagCollector) + .addDiag(any(Diag.class)); + + // when(createMigrationRoutesRpc.getInputType()).thenReturn(createMigrationRoutesRequestTypeRef); + // when(createMigrationRoutesRpc.getOutputType()).thenReturn(createMigrationRoutesRequestTypeRef); + // when(createMigrationRoutesRequestTypeRef.getMessageType()) + // .thenReturn(createMigrationRoutesRequestMessage); + // when(createMigrationRoutesRequestMessage.lookupField(anyString())).thenReturn(dummyField); + // when(dummyField.getType()).thenReturn(dummyTypeRef); + // createMigrationRoutes = new ProtoMethodModel(createMigrationRoutesRpc); + + when(createMigrationRoutes.getInputField("source")).thenReturn(source); + when(createMigrationRoutes.getInputField("destination")).thenReturn(destination); + when(createMigrationRoutes.getInputField("animals")).thenReturn(animals); + + when(source.getSimpleName()).thenReturn("source"); + when(source.getParentFullName()).thenReturn("google.animal.CreateMigrationRoutesRequest"); + when(source.getProtoField()).thenReturn(dummyField); + when(source.isRepeated()).thenReturn(false); + when(destination.getSimpleName()).thenReturn("destination"); + when(destination.isRepeated()).thenReturn(false); + when(destination.getProtoField()).thenReturn(dummyField); + when(destination.getParentFullName()).thenReturn("google.animal.CreateMigrationRoutesRequest"); + when(animals.getSimpleName()).thenReturn("animals"); + when(animals.isRepeated()).thenReturn(true); + when(animals.getProtoField()).thenReturn(dummyField); + when(animals.getParentFullName()).thenReturn("google.animal.CreateMigrationRoutesRequest"); + + messageConfig = + new AutoValue_ResourceNameMessageConfig( + "google.animal.CreateMigrationRoutesRequest", + ImmutableListMultimap.builder() + .put("source", "County") + .put("source", "State") + .put("destination", "County") + .put("destination", "State") + .put("animals", "Fish") + .put("animals", "Bird") + .build()); + + messageConfigs = + new AutoValue_ResourceNameMessageConfigs( + ImmutableMap.of("google.animal.CreateMigrationRoutesRequest", messageConfig), + ImmutableListMultimap.builder() + .put("google.animal.CreateMigrationRoutesRequest", source) + .put("google.animal.CreateMigrationRoutesRequest", destination) + .put("google.animal.CreateMigrationRoutesRequest", animals) + .build()); + + state = + SingleResourceNameConfig.newBuilder() + .setNamePattern("states/{state}") + .setEntityId("State") + .setEntityName(Name.from("state")) + .build(); + + county = + SingleResourceNameConfig.newBuilder() + .setNamePattern("states/{state}/counties/{county}") + .setEntityId("County") + .setEntityName(Name.from("county")) + .build(); + + bird = + SingleResourceNameConfig.newBuilder() + .setNamePattern("birds/{bird}") + .setEntityId("Bird") + .setEntityName(Name.from("bird")) + .build(); + + fish = + SingleResourceNameConfig.newBuilder() + .setNamePattern("fish/{fish}") + .setEntityId("Fish") + .setEntityName(Name.from("fish")) + .build(); + + resourceNameConfigs = + ImmutableMap.builder() + .put("State", state) + .put("County", county) + .put("Fish", fish) + .put("Bird", bird) + .build(); + } + + @Test + public void testCreateFlatteningConfigsWithResourceNameCombination() { + + List flatteningConfigs = + FlatteningConfig.createFlatteningsFromProtoFile( + diagCollector, + messageConfigs, + resourceNameConfigs, + ImmutableList.of("source", "destination", "animals"), + createMigrationRoutes, + protoParser); + + FieldConfig sourceFieldStateResource = + FieldConfig.newBuilder() + .setResourceNameConfig(state) + .setExampleResourceNameConfig(state) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(source) + .build(); + + FieldConfig sourceFieldCountyResource = + FieldConfig.newBuilder() + .setResourceNameConfig(county) + .setExampleResourceNameConfig(county) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(source) + .build(); + + FieldConfig sourceFieldSampleOnly = + FieldConfig.newBuilder() + .setResourceNameConfig(county) + .setExampleResourceNameConfig(county) + .setResourceNameTreatment(ResourceNameTreatment.SAMPLE_ONLY) + .setField(source) + .build(); + + FieldConfig destinationFieldStateResource = + FieldConfig.newBuilder() + .setResourceNameConfig(state) + .setExampleResourceNameConfig(state) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(destination) + .build(); + + FieldConfig destinationFieldCountyResource = + FieldConfig.newBuilder() + .setResourceNameConfig(county) + .setExampleResourceNameConfig(county) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(destination) + .build(); + + FieldConfig destinationFieldSampleOnly = + FieldConfig.newBuilder() + .setResourceNameConfig(county) + .setExampleResourceNameConfig(county) + .setResourceNameTreatment(ResourceNameTreatment.SAMPLE_ONLY) + .setField(destination) + .build(); + + FieldConfig animalsField = + FieldConfig.newBuilder() + .setResourceNameConfig(fish) + .setExampleResourceNameConfig(fish) + .setResourceNameTreatment(ResourceNameTreatment.SAMPLE_ONLY) + .setField(animals) + .build(); + + List expectedFlatteningConfigs = + ImmutableList.of( + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldStateResource, + "destination", + destinationFieldStateResource, + "animals", + animalsField)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldCountyResource, + "destination", + destinationFieldStateResource, + "animals", + animalsField)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldStateResource, + "destination", + destinationFieldCountyResource, + "animals", + animalsField)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldCountyResource, + "destination", + destinationFieldCountyResource, + "animals", + animalsField)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldSampleOnly, + "destination", + destinationFieldSampleOnly, + "animals", + animalsField))); + + assertThat(flatteningConfigs).containsExactlyElementsIn(expectedFlatteningConfigs); + } +} From 09bad3cc9dffea54428194bae879c552ebd9a470 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 08:26:11 +0800 Subject: [PATCH 20/36] almost there! --- .../api/codegen/config/FieldConfig.java | 34 +++++------ .../codegen/config/FieldConfigFactory.java | 2 +- .../transformer/InitCodeTransformer.java | 2 +- .../csharp/CSharpSurfaceNamer.java | 2 +- .../config/FieldConfigFactoryTest.java | 8 +-- .../codegen/config/FlatteningConfigTest.java | 14 ++--- .../ResourceNameMessageConfigsTest.java | 50 ++++++++--------- .../testdata/csharp/csharp_library.baseline | 56 +++++++++---------- ...amplegen_config_migration_library.baseline | 56 +++++++++---------- .../testdata/csharp_library.baseline | 56 +++++++++---------- 10 files changed, 139 insertions(+), 141 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index 58521419c1..f53852e97d 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -63,7 +63,7 @@ public abstract class FieldConfig { *

    The field `parent` will have two resource name configs: Project and Location. In this case, * we need to generate three flattening overloads for the method ListFoos. The method signatures * and the FieldConfig for the field `parent` has the following mapping: - *

  • method_signature -> (resourceNameConfig, exampleResourceNameConfig, resourceNameTreatment) + *
  • method_signature -> (resourceNameConfig, messageResourceNameConfig, resourceNameTreatment) *
  • ListFoos(ProjectName parent) -> ("Project", "Project", STATIC_TYPE); *
  • ListFoos(LocationName parent) -> ("Location", "Location", STATIC_TYPE); *
  • ListFoos(String parent) -> ("Project", "Project", SAMPLE_ONLY); @@ -77,7 +77,7 @@ public abstract class FieldConfig { * getExampleResourceConfig() and getResourceNameConfig() always return the same config. */ @Nullable - public abstract ResourceNameConfig getExampleResourceNameConfig(); + public abstract ResourceNameConfig getMessageResourceNameConfig(); public ResourceNameType getResourceNameType() { if (getResourceNameConfig() == null) { @@ -90,7 +90,7 @@ private static FieldConfig createFieldConfig( FieldModel field, ResourceNameTreatment resourceNameTreatment, ResourceNameConfig resourceNameConfig, - ResourceNameConfig exampleResourceNameConfig) { + ResourceNameConfig messageResourceNameConfig) { if (resourceNameTreatment != ResourceNameTreatment.NONE && resourceNameConfig == null) { throw new IllegalArgumentException( "resourceName may only be null if resourceNameTreatment is NONE"); @@ -104,7 +104,7 @@ private static FieldConfig createFieldConfig( .setField(field) .setResourceNameTreatment(resourceNameTreatment) .setResourceNameConfig(resourceNameConfig) - .setExampleResourceNameConfig(exampleResourceNameConfig) + .setMessageResourceNameConfig(messageResourceNameConfig) .build(); } @@ -184,7 +184,7 @@ static FieldConfig createFieldConfig( .setField(field) .setResourceNameTreatment(treatment) .setResourceNameConfig(flattenedFieldResourceNameConfig) - .setExampleResourceNameConfig(messageFieldResourceNameConfig) + .setMessageResourceNameConfig(messageFieldResourceNameConfig) .build(); return config; } @@ -231,7 +231,7 @@ public boolean useValidation() { public FieldConfig withResourceNameConfig(ResourceNameConfig resourceNameConfig) { return FieldConfig.createFieldConfig( - getField(), getResourceNameTreatment(), resourceNameConfig, getExampleResourceNameConfig()); + getField(), getResourceNameTreatment(), resourceNameConfig, getMessageResourceNameConfig()); } public FieldConfig withResourceNameInSampleOnly() { @@ -241,28 +241,28 @@ public FieldConfig withResourceNameInSampleOnly() { newTreatment = ResourceNameTreatment.SAMPLE_ONLY; } return FieldConfig.createFieldConfig( - getField(), newTreatment, getResourceNameConfig(), getExampleResourceNameConfig()); + getField(), newTreatment, getResourceNameConfig(), getMessageResourceNameConfig()); } public boolean requiresParamTransformation() { return getResourceNameConfig() != null - && getExampleResourceNameConfig() != null - && !getResourceNameConfig().equals(getExampleResourceNameConfig()); + && getMessageResourceNameConfig() != null + && !getResourceNameConfig().equals(getMessageResourceNameConfig()); } public boolean requiresParamTransformationFromAny() { - return getExampleResourceNameConfig() != null - && getExampleResourceNameConfig().getResourceNameType() == ResourceNameType.ANY; + return getMessageResourceNameConfig() != null + && getMessageResourceNameConfig().getResourceNameType() == ResourceNameType.ANY; } public FieldConfig getMessageFieldConfig() { return FieldConfig.createFieldConfig( getField(), - getExampleResourceNameConfig() == null + getMessageResourceNameConfig() == null ? ResourceNameTreatment.NONE : getResourceNameTreatment(), - getExampleResourceNameConfig(), - getExampleResourceNameConfig()); + getMessageResourceNameConfig(), + getMessageResourceNameConfig()); } public boolean isRepeatedResourceNameTypeField() { @@ -326,7 +326,7 @@ public abstract static class Builder { public abstract Builder setResourceNameConfig(ResourceNameConfig val); - public abstract Builder setExampleResourceNameConfig(ResourceNameConfig val); + public abstract Builder setMessageResourceNameConfig(ResourceNameConfig val); public abstract FieldConfig build(); } @@ -340,9 +340,9 @@ public String toString() { String resourceNameEntityId = getResourceNameConfig() == null ? "null" : getResourceNameConfig().getEntityId(); String exampleResourceNameEntityId = - getExampleResourceNameConfig() == null + getMessageResourceNameConfig() == null ? "null" - : getExampleResourceNameConfig().getEntityId(); + : getMessageResourceNameConfig().getEntityId(); return MoreObjects.toStringHelper(this) .add("fieldName", getField().getSimpleName()) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java index c8122e374e..a9b42b1b22 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java @@ -32,7 +32,7 @@ private FieldConfigFactory() {} /* * Create a FieldConfig for a field in a message. If the field is associated * with multiple resource names through child_type resource reference, - * the created FieldConfig will pick one for its exampleResourceNameConfig. + * the created FieldConfig will pick one for its messageResourceNameConfig. */ static FieldConfig createMessageFieldConfig( ResourceNameMessageConfigs messageConfigs, diff --git a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java index 16df4aefd7..3d02f8a5c1 100644 --- a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java @@ -649,7 +649,7 @@ private void setInitValueAndComments( if (context.getFeatureConfig().useResourceNameFormatOptionInSample(context, fieldConfig)) { if (!context.isFlattenedMethodContext()) { - ResourceNameConfig messageResNameConfig = fieldConfig.getExampleResourceNameConfig(); + ResourceNameConfig messageResNameConfig = fieldConfig.getMessageResourceNameConfig(); if (messageResNameConfig == null || messageResNameConfig.getResourceNameType() != ResourceNameType.ANY) { // In a non-flattened context, we always use the resource name type set on the message diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java index e95d0a8f69..70ddd6d2d4 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpSurfaceNamer.java @@ -288,7 +288,7 @@ public String getResourceNameFieldGetFunctionName(FieldConfig fieldConfig) { if (fieldConfig.getResourceNameType() == ResourceNameType.ANY) { resourceName = Name.from(AnyResourceNameConfig.ENTITY_NAME); } else { - resourceName = getResourceTypeNameObject(fieldConfig.getExampleResourceNameConfig()); + resourceName = getResourceTypeNameObject(fieldConfig.getMessageResourceNameConfig()); } Name name = Name.from(); diff --git a/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java b/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java index 0fd7f6cbb2..3a1410c53b 100644 --- a/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java +++ b/src/test/java/com/google/api/codegen/config/FieldConfigFactoryTest.java @@ -97,14 +97,14 @@ public void testCreateFlattenedFieldConfigsForSingularMultiResourceField() { FieldConfig parentConfig1 = FieldConfig.newBuilder() .setResourceNameConfig(archive) - .setExampleResourceNameConfig(archive) + .setMessageResourceNameConfig(archive) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(parent) .build(); FieldConfig parentConfig2 = FieldConfig.newBuilder() .setResourceNameConfig(shelf) - .setExampleResourceNameConfig(shelf) + .setMessageResourceNameConfig(shelf) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(parent) .build(); @@ -119,14 +119,14 @@ public void testCreateFlattenedFieldConfigsForRepeatedMultiResourceField() { FieldConfig moreParentConfig1 = FieldConfig.newBuilder() .setResourceNameConfig(archive) - .setExampleResourceNameConfig(archive) + .setMessageResourceNameConfig(archive) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(moreParents) .build(); FieldConfig moreParentConfig2 = FieldConfig.newBuilder() .setResourceNameConfig(shelf) - .setExampleResourceNameConfig(shelf) + .setMessageResourceNameConfig(shelf) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(moreParents) .build(); diff --git a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java index 2794df7523..ae1a42b7cf 100644 --- a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java +++ b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java @@ -162,7 +162,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { FieldConfig sourceFieldStateResource = FieldConfig.newBuilder() .setResourceNameConfig(state) - .setExampleResourceNameConfig(state) + .setMessageResourceNameConfig(state) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(source) .build(); @@ -170,7 +170,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { FieldConfig sourceFieldCountyResource = FieldConfig.newBuilder() .setResourceNameConfig(county) - .setExampleResourceNameConfig(county) + .setMessageResourceNameConfig(county) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(source) .build(); @@ -178,7 +178,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { FieldConfig sourceFieldSampleOnly = FieldConfig.newBuilder() .setResourceNameConfig(county) - .setExampleResourceNameConfig(county) + .setMessageResourceNameConfig(county) .setResourceNameTreatment(ResourceNameTreatment.SAMPLE_ONLY) .setField(source) .build(); @@ -186,7 +186,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { FieldConfig destinationFieldStateResource = FieldConfig.newBuilder() .setResourceNameConfig(state) - .setExampleResourceNameConfig(state) + .setMessageResourceNameConfig(state) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(destination) .build(); @@ -194,7 +194,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { FieldConfig destinationFieldCountyResource = FieldConfig.newBuilder() .setResourceNameConfig(county) - .setExampleResourceNameConfig(county) + .setMessageResourceNameConfig(county) .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) .setField(destination) .build(); @@ -202,7 +202,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { FieldConfig destinationFieldSampleOnly = FieldConfig.newBuilder() .setResourceNameConfig(county) - .setExampleResourceNameConfig(county) + .setMessageResourceNameConfig(county) .setResourceNameTreatment(ResourceNameTreatment.SAMPLE_ONLY) .setField(destination) .build(); @@ -210,7 +210,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { FieldConfig animalsField = FieldConfig.newBuilder() .setResourceNameConfig(fish) - .setExampleResourceNameConfig(fish) + .setMessageResourceNameConfig(fish) .setResourceNameTreatment(ResourceNameTreatment.SAMPLE_ONLY) .setField(animals) .build(); diff --git a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java index 35ad9f38f4..2329eed0c8 100644 --- a/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java +++ b/src/test/java/com/google/api/codegen/config/ResourceNameMessageConfigsTest.java @@ -51,9 +51,8 @@ import java.util.Comparator; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.stream.Collectors; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.mockito.Spy; @@ -137,8 +136,8 @@ public class ResourceNameMessageConfigsTest { PROTO_ARCHIVED_BOOK_PATH, ImmutableList.of(ARCHIVED_BOOK_RESOURCE_DESCRIPTOR_CONFIG)); - @BeforeClass - public static void startUp() { + @Before + public void startUp() { configProto = ConfigProto.newBuilder() .addResourceNameGeneration( @@ -256,14 +255,13 @@ public void testCreateResourceNamesWithProtoFilesOnly() { protoParser, resourceDescriptorConfigMap, Collections.emptyMap()); - System.out.println(messageConfigs.getResourceTypeConfigMap()); assertThat(messageConfigs.getResourceTypeConfigMap().size()).isEqualTo(2); ResourceNameMessageConfig bookMessageConfig = messageConfigs.getResourceTypeConfigMap().get("library.Book"); - assertThat(bookMessageConfig.fieldEntityMap().get("name")).isEqualTo("Book"); + assertThat(bookMessageConfig.fieldEntityMap().get("name")).containsExactly("Book"); ResourceNameMessageConfig shelfMessageConfig = messageConfigs.getResourceTypeConfigMap().get("library.Shelf"); - assertThat(shelfMessageConfig.fieldEntityMap().get("name")).isEqualTo("Shelf"); + assertThat(shelfMessageConfig.fieldEntityMap().get("name")).containsExactly("Shelf"); } @Test @@ -312,8 +310,6 @@ public void testCreateResourceNamesWithConfigOnly() { assertThat(shelfResource.getEntityNamesForField("name").get(0)).isEqualTo("shelf"); } - public void testCreateResourceNameMessageConfigForFieldWithMultipleResourceNames() {} - @Test public void testCreateResourceNameConfigs() { DiagCollector diagCollector = new BoundedDiagCollector(); @@ -455,30 +451,32 @@ public void testCreateFlattenings() { .collect(Collectors.toList()); assertThat(flatteningConfigs).isNotNull(); - assertThat(flatteningConfigs.size()).isEqualTo(3); + assertThat(flatteningConfigs.size()).isEqualTo(6); // Check the flattening from the Gapic config. - Optional flatteningConfigFromGapicConfig = + List flatteningConfigFromGapicConfigs = flatteningConfigs .stream() .filter( f -> f.getFlattenedFieldConfigs().size() == 1 && f.getFlattenedFieldConfigs().containsKey("book")) - .findAny(); - assertThat(flatteningConfigFromGapicConfig.isPresent()).isTrue(); - Map paramsFromGapicConfigFlattening = - flatteningConfigFromGapicConfig.get().getFlattenedFieldConfigs(); - assertThat(paramsFromGapicConfigFlattening.get("book").getField().getSimpleName()) - .isEqualTo("book"); - assertThat( - ((ProtoField) paramsFromGapicConfigFlattening.get("book").getField()) - .getType() - .getProtoType() - .getMessageType()) - .isEqualTo(bookType); - - flatteningConfigs.remove(flatteningConfigFromGapicConfig.get()); + .collect(ImmutableList.toImmutableList()); + assertThat(flatteningConfigFromGapicConfigs.size()).isEqualTo(2); + for (FlatteningConfig configFromGapicConfig : flatteningConfigFromGapicConfigs) { + Map paramsFromGapicConfigFlattening = + configFromGapicConfig.getFlattenedFieldConfigs(); + assertThat(paramsFromGapicConfigFlattening.get("book").getField().getSimpleName()) + .isEqualTo("book"); + assertThat( + ((ProtoField) paramsFromGapicConfigFlattening.get("book").getField()) + .getType() + .getProtoType() + .getMessageType()) + .isEqualTo(bookType); + } + + flatteningConfigs.removeAll(flatteningConfigFromGapicConfigs); // Check the flattenings from the protofile annotations. flatteningConfigs.sort(Comparator.comparingInt(c -> Iterables.size(c.getFlattenedFields()))); @@ -491,7 +489,7 @@ public void testCreateFlattenings() { assertThat(((SingleResourceNameConfig) nameConfig.getResourceNameConfig()).getNamePattern()) .isEqualTo(PROTO_SHELF_PATH); - FlatteningConfig shelfAndBookFlattening = flatteningConfigs.get(1); + FlatteningConfig shelfAndBookFlattening = flatteningConfigs.get(2); assertThat(Iterables.size(shelfAndBookFlattening.getFlattenedFields())).isEqualTo(2); FieldConfig nameConfig2 = shelfAndBookFlattening.getFlattenedFieldConfigs().get("name"); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index a1648542a2..f9ffad58de 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -8312,9 +8312,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -8373,9 +8373,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -8412,7 +8412,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -8446,9 +8446,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -8507,9 +8507,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -8546,7 +8546,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -11068,9 +11068,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -11129,9 +11129,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -11167,7 +11167,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -11332,9 +11332,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -11393,9 +11393,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -11431,7 +11431,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 516a42fcc0..0cfb40bd61 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -5067,9 +5067,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -5096,9 +5096,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -5135,7 +5135,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -5169,9 +5169,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -5198,9 +5198,9 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -5237,7 +5237,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -7645,9 +7645,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -7674,9 +7674,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -7712,7 +7712,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -7845,9 +7845,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); - IEnumerable formattedRequiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); IDictionary requiredMap = new Dictionary(); @@ -7874,9 +7874,9 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); - IEnumerable formattedOptionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); IDictionary optionalMap = new Dictionary(); @@ -7912,7 +7912,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, formattedRequiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, formattedOptionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index c5daf7e55b..3bbd648b95 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -8367,8 +8367,8 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); @@ -8428,8 +8428,8 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); @@ -8467,7 +8467,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -8501,8 +8501,8 @@ namespace Google.Example.Library.V1.Snippets IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); @@ -8562,8 +8562,8 @@ namespace Google.Example.Library.V1.Snippets IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); @@ -8601,7 +8601,7 @@ namespace Google.Example.Library.V1.Snippets IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); // End snippet } @@ -9065,10 +9065,10 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) ArchiveName source = new ArchiveName("[ARCHIVE]"); ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable formattedPublishers = new List(); + IEnumerable publishers = new List(); ProjectName project = new ProjectName("[PROJECT]"); // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, formattedPublishers, project); + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); // End snippet } @@ -9081,10 +9081,10 @@ namespace Google.Example.Library.V1.Snippets // Initialize request argument(s) ArchiveName source = new ArchiveName("[ARCHIVE]"); ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable formattedPublishers = new List(); + IEnumerable publishers = new List(); ProjectName project = new ProjectName("[PROJECT]"); // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, formattedPublishers, project); + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); // End snippet } @@ -11900,8 +11900,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); @@ -11961,8 +11961,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); @@ -11999,7 +11999,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = client.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -12164,8 +12164,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable requiredRepeatedString = new List(); IEnumerable requiredRepeatedBytes = new List(); IEnumerable requiredRepeatedMessage = new List(); - IEnumerable formattedRequiredRepeatedResourceName = new List(); - IEnumerable formattedRequiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); IEnumerable requiredRepeatedResourceNameCommon = new List(); IEnumerable requiredRepeatedFixed32 = new List(); IEnumerable requiredRepeatedFixed64 = new List(); @@ -12225,8 +12225,8 @@ namespace Google.Example.Library.V1.Tests IEnumerable optionalRepeatedString = new List(); IEnumerable optionalRepeatedBytes = new List(); IEnumerable optionalRepeatedMessage = new List(); - IEnumerable formattedOptionalRepeatedResourceName = new List(); - IEnumerable formattedOptionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); IEnumerable optionalRepeatedResourceNameCommon = new List(); IEnumerable optionalRepeatedFixed32 = new List(); IEnumerable optionalRepeatedFixed64 = new List(); @@ -12263,7 +12263,7 @@ namespace Google.Example.Library.V1.Tests IEnumerable repeatedStringValue = new List(); IEnumerable repeatedBoolValue = new List(); IEnumerable repeatedBytesValue = new List(); - TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, formattedRequiredRepeatedResourceName, formattedRequiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, formattedOptionalRepeatedResourceName, formattedOptionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + TestOptionalRequiredFlatteningParamsResponse response = await client.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -12454,9 +12454,9 @@ namespace Google.Example.Library.V1.Tests LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ArchiveName source = new ArchiveName("[ARCHIVE]"); ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable formattedPublishers = new List(); + IEnumerable publishers = new List(); ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = client.MoveBooks(source, destination, formattedPublishers, project); + MoveBooksResponse response = client.MoveBooks(source, destination, publishers, project); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } @@ -12485,9 +12485,9 @@ namespace Google.Example.Library.V1.Tests LibraryServiceClient client = new LibraryServiceClientImpl(mockGrpcClient.Object, null); ArchiveName source = new ArchiveName("[ARCHIVE]"); ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable formattedPublishers = new List(); + IEnumerable publishers = new List(); ProjectName project = new ProjectName("[PROJECT]"); - MoveBooksResponse response = await client.MoveBooksAsync(source, destination, formattedPublishers, project); + MoveBooksResponse response = await client.MoveBooksAsync(source, destination, publishers, project); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } From 16ec1ea246a75cba4a5b6c2314448f3b9295ca2d Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 09:24:30 +0800 Subject: [PATCH 21/36] docs --- .../api/codegen/config/FieldConfig.java | 39 ++----------------- .../codegen/config/FieldConfigFactory.java | 34 ++++++++++++++++ 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index f53852e97d..fb6c623d55 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -36,45 +36,14 @@ public abstract class FieldConfig { @Nullable public abstract ResourceNameTreatment getResourceNameTreatment(); - /** - * The resource name config used in API surfaces. For resource name fields in a message, - * getResourceNameConfig() always returns null. For flattened resource name fields, - * getResourceNameConfigs() returns the resource name config in the API surface. - * - *

    Note a field can have multiple resource names the field has child_type resource reference. - * For example, consider the following case: - * - * option (google.api.resource_defintion) = { - * type: "library.googleapis.com/Book", - * pattern: "projects/{project}/books/{book}", - * pattern: "projects/{project}/locations/{location}/books/{book}" - * }; - * - * rpc ListFoos(ListFoosRequest) returns (ListFoosResponse) { - * option (google.api.method_signature) = "parent"; - * } - * - * message ListFoosRequest { - * string parent = 1 [ - * (google.api.resource_reference).child_type = "library.googleapis.com/Book"] - * } - * - * - *

    The field `parent` will have two resource name configs: Project and Location. In this case, - * we need to generate three flattening overloads for the method ListFoos. The method signatures - * and the FieldConfig for the field `parent` has the following mapping: - *

  • method_signature -> (resourceNameConfig, messageResourceNameConfig, resourceNameTreatment) - *
  • ListFoos(ProjectName parent) -> ("Project", "Project", STATIC_TYPE); - *
  • ListFoos(LocationName parent) -> ("Location", "Location", STATIC_TYPE); - *
  • ListFoos(String parent) -> ("Project", "Project", SAMPLE_ONLY); - *
  • ListFoos(ListFoosRequest request); -> (null, "Project", SAMPLE_ONLY); - */ + /** The resource name config used in API surfaces. Used to generate flattened API methods. */ @Nullable public abstract ResourceNameConfig getResourceNameConfig(); /** - * The resource name config used in samples and tests. For flattened resource name fields, - * getExampleResourceConfig() and getResourceNameConfig() always return the same config. + * The resource name associated to the field in a proto message. Used to generate samples and + * tests in API methods that take request objects, and iterator methods (e.g., + * iterateAllAsBookName) in page streaming responses. */ @Nullable public abstract ResourceNameConfig getMessageResourceNameConfig(); diff --git a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java index a9b42b1b22..7bcc3457bd 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java @@ -73,6 +73,37 @@ static List createFlattenedFieldConfigs( * Create a list of FieldConfigs for a flattened field in the API surface. If the field is * associated with multiple resource names through child_type resource reference, each created * FieldConfig will have one of these resource name configs. + * + *

    For example, consider the following case: + * option (google.api.resource_defintion) = { + * type: "library.googleapis.com/Book", + * pattern: "projects/{project}/books/{book}", + * pattern: "projects/{project}/locations/{location}/books/{book}" + * }; + * + * rpc ListFoos(ListFoosRequest) returns (ListFoosResponse) { + * option (google.api.method_signature) = "parent"; + * } + * + * message ListFoosRequest { + * string parent = 1 [ + * (google.api.resource_reference).child_type = "library.googleapis.com/Book"] + * } + * + * + *

    The field `parent` will have two resource name configs: Project and Location. In this case, + * we need to generate three flattening overloads for the method ListFoos. The method signatures + * and the created FieldConfigs for the field `parent` has the following mapping: + * + *

    + * + *

      + *
    • method_signature -> (resourceNameConfig, messageResourceNameConfig, + * resourceNameTreatment) + *
    • ListFoos(ProjectName parent) -> ("Project", "Project", STATIC_TYPE); + *
    • ListFoos(LocationName parent) -> ("Location", "Location", STATIC_TYPE); + *
    • ListFoos(String parent) -> ("Project", "Project", SAMPLE_ONLY); + *
    */ static List createFlattenedFieldConfigs( DiagCollector diagCollector, @@ -122,6 +153,9 @@ static List createFlattenedFieldConfigs( defaultResourceNameTreatment)); } + /** Create a FieldConfig for a flattened field in a GAPIC config backed API. + * Because GAPIC YAML does not support configuring multiple resource names + * to fields, one field will always have only one FieldConfig. */ static FieldConfig createFlattenedFieldConfigFromGapicYaml( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, From b842aab29a1228e61c049eb36424176d3ba0aa35 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 09:27:38 +0800 Subject: [PATCH 22/36] format --- .../com/google/api/codegen/config/FieldConfigFactory.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java index 7bcc3457bd..cceeb557b0 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java @@ -153,9 +153,11 @@ static List createFlattenedFieldConfigs( defaultResourceNameTreatment)); } - /** Create a FieldConfig for a flattened field in a GAPIC config backed API. - * Because GAPIC YAML does not support configuring multiple resource names - * to fields, one field will always have only one FieldConfig. */ + /** + * Create a FieldConfig for a flattened field in a GAPIC config backed API. Because GAPIC YAML + * does not support configuring multiple resource names to fields, one field will always have only + * one FieldConfig. + */ static FieldConfig createFlattenedFieldConfigFromGapicYaml( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, From 0fcffebc44943a0ecba8e14b97aa066fa34bdd28 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 13:18:16 +0800 Subject: [PATCH 23/36] update csharp baseline --- .../config/ResourceDescriptorConfig.java | 2 +- .../CSharpGapicSnippetsTransformer.java | 5 + .../codegen/config/FlatteningConfigTest.java | 12 - .../testdata/csharp/csharp_library.baseline | 450 +----------------- ...amplegen_config_migration_library.baseline | 450 +----------------- .../testdata/csharp_library.baseline | 450 +----------------- 6 files changed, 18 insertions(+), 1351 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java index 7905125c60..7f7ef87660 100644 --- a/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java +++ b/src/main/java/com/google/api/codegen/config/ResourceDescriptorConfig.java @@ -278,7 +278,7 @@ static String getParentPattern(String pattern) { return String.join("/", segments.subList(0, index)); } - static Map getParentPatternsMap(ResourceDescriptorConfig resource) { + private static Map getParentPatternsMap(ResourceDescriptorConfig resource) { return resource .getPatterns() .stream() diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index f4c292a410..bc440b04b4 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -147,6 +147,11 @@ private List generateMethods(InterfaceContext co } else if (methodConfig.isPageStreaming()) { if (methodConfig.isFlattening()) { ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); + flatteningGroups = + flatteningGroups + .stream() + .filter(FlatteningConfig::hasAnyResourceNameParameter) + .collect(ImmutableList.toImmutableList()); // Find flattenings that have ambiguous parameters, and mark them to use named arguments. // Ambiguity occurs in a page-stream flattening that has one or two extra string // parameters (that are not resource-names) compared to any other flattening of this same diff --git a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java index ae1a42b7cf..6f367ed5c6 100644 --- a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java +++ b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java @@ -38,11 +38,7 @@ public class FlatteningConfigTest { @Mock private ProtoParser protoParser; @Mock private DiagCollector diagCollector; - // @Mock private Method createMigrationRoutesRpc; - // @Mock private TypeRef createMigrationRoutesRequestTypeRef; - // @Mock private MessageType createMigrationRoutesRequestMessage; @Mock private Field dummyField; - // @Mock private TypeRef dummyTypeRef; @Mock private ProtoField source; @Mock private ProtoField destination; @Mock private ProtoField animals; @@ -64,14 +60,6 @@ public void setUp() { .when(diagCollector) .addDiag(any(Diag.class)); - // when(createMigrationRoutesRpc.getInputType()).thenReturn(createMigrationRoutesRequestTypeRef); - // when(createMigrationRoutesRpc.getOutputType()).thenReturn(createMigrationRoutesRequestTypeRef); - // when(createMigrationRoutesRequestTypeRef.getMessageType()) - // .thenReturn(createMigrationRoutesRequestMessage); - // when(createMigrationRoutesRequestMessage.lookupField(anyString())).thenReturn(dummyField); - // when(dummyField.getType()).thenReturn(dummyTypeRef); - // createMigrationRoutes = new ProtoMethodModel(createMigrationRoutesRpc); - when(createMigrationRoutes.getInputField("source")).thenReturn(source); when(createMigrationRoutes.getInputField("destination")).thenReturn(destination); when(createMigrationRoutes.getInputField("animals")).thenReturn(animals); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index f9ffad58de..1c25e87314 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -5119,90 +5119,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListShelvesAsync - public async Task ListShelvesAsync() - { - // Snippet: ListShelvesAsync(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListShelvesAsync(); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Shelf item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListShelvesResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Shelf item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Shelf item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListShelves - public void ListShelves() - { - // Snippet: ListShelves(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListShelves(); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Shelf item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListShelvesResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Shelf item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Shelf item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListShelvesAsync public async Task ListShelvesAsync_RequestObject() { @@ -5734,7 +5650,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync1() + public async Task ListBooksAsync() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -5779,7 +5695,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks1() + public void ListBooks() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -5823,96 +5739,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListBooksAsync - public async Task ListBooksAsync2() - { - // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Book item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooks - public void ListBooks2() - { - // Snippet: ListBooks(string,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedEnumerable response = - libraryServiceClient.ListBooks(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Book item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListBooksAsync public async Task ListBooksAsync_RequestObject() { @@ -6353,91 +6179,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync1() - { - // Snippet: ListStringsAsync(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings1() - { - // Snippet: ListStrings(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStringsAsync - public async Task ListStringsAsync2() + public async Task ListStringsAsync() { // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client @@ -6481,7 +6223,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings2() + public void ListStrings() { // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client @@ -6524,94 +6266,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListStringsAsync - public async Task ListStringsAsync3() - { - // Snippet: ListStringsAsync(string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(name); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings3() - { - // Snippet: ListStrings(string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(name); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListStringsAsync public async Task ListStringsAsync_RequestObject() { @@ -7339,102 +6993,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for FindRelatedBooksAsync - public async Task FindRelatedBooksAsync() - { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IEnumerable names = new[] - { - new BookName("[SHELF]", "[BOOK]"), - }; - IEnumerable shelves = new List(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.FindRelatedBooksAsync(names, shelves); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (BookName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for FindRelatedBooks - public void FindRelatedBooks() - { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IEnumerable names = new[] - { - new BookName("[SHELF]", "[BOOK]"), - }; - IEnumerable shelves = new List(); - // Make the request - PagedEnumerable response = - libraryServiceClient.FindRelatedBooks(names, shelves); - - // Iterate over all response items, lazily performing RPCs as required - foreach (BookName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (FindRelatedBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (BookName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 0cfb40bd61..2827277b00 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -1956,90 +1956,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListShelvesAsync - public async Task ListShelvesAsync() - { - // Snippet: ListShelvesAsync(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListShelvesAsync(); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Shelf item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListShelvesResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Shelf item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Shelf item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListShelves - public void ListShelves() - { - // Snippet: ListShelves(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListShelves(); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Shelf item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListShelvesResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Shelf item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Shelf item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListShelvesAsync public async Task ListShelvesAsync_RequestObject() { @@ -2571,7 +2487,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync1() + public async Task ListBooksAsync() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -2616,7 +2532,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks1() + public void ListBooks() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -2660,96 +2576,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListBooksAsync - public async Task ListBooksAsync2() - { - // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Book item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooks - public void ListBooks2() - { - // Snippet: ListBooks(string,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedEnumerable response = - libraryServiceClient.ListBooks(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Book item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListBooksAsync public async Task ListBooksAsync_RequestObject() { @@ -3190,91 +3016,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync1() - { - // Snippet: ListStringsAsync(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings1() - { - // Snippet: ListStrings(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStringsAsync - public async Task ListStringsAsync2() + public async Task ListStringsAsync() { // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client @@ -3318,7 +3060,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings2() + public void ListStrings() { // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client @@ -3361,94 +3103,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListStringsAsync - public async Task ListStringsAsync3() - { - // Snippet: ListStringsAsync(string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(name); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings3() - { - // Snippet: ListStrings(string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(name); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListStringsAsync public async Task ListStringsAsync_RequestObject() { @@ -4158,102 +3812,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for FindRelatedBooksAsync - public async Task FindRelatedBooksAsync() - { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IEnumerable names = new[] - { - new BookName("[SHELF]", "[BOOK]"), - }; - IEnumerable shelves = new List(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.FindRelatedBooksAsync(names, shelves); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (BookName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for FindRelatedBooks - public void FindRelatedBooks() - { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IEnumerable names = new[] - { - new BookName("[SHELF]", "[BOOK]"), - }; - IEnumerable shelves = new List(); - // Make the request - PagedEnumerable response = - libraryServiceClient.FindRelatedBooks(names, shelves); - - // Iterate over all response items, lazily performing RPCs as required - foreach (BookName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (FindRelatedBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (BookName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index 3bbd648b95..f270a2b66b 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -5160,90 +5160,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListShelvesAsync - public async Task ListShelvesAsync() - { - // Snippet: ListShelvesAsync(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListShelvesAsync(); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Shelf item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListShelvesResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Shelf item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Shelf item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListShelves - public void ListShelves() - { - // Snippet: ListShelves(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListShelves(); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Shelf item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListShelvesResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Shelf item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Shelf item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListShelvesAsync public async Task ListShelvesAsync_RequestObject() { @@ -5818,7 +5734,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync1() + public async Task ListBooksAsync() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -5863,7 +5779,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks1() + public void ListBooks() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -5907,96 +5823,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListBooksAsync - public async Task ListBooksAsync2() - { - // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Book item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooks - public void ListBooks2() - { - // Snippet: ListBooks(string,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedEnumerable response = - libraryServiceClient.ListBooks(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Book item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListBooksAsync public async Task ListBooksAsync_RequestObject() { @@ -6437,91 +6263,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync1() - { - // Snippet: ListStringsAsync(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings1() - { - // Snippet: ListStrings(string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStringsAsync - public async Task ListStringsAsync2() + public async Task ListStringsAsync() { // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client @@ -6565,7 +6307,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings2() + public void ListStrings() { // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client @@ -6608,94 +6350,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ListStringsAsync - public async Task ListStringsAsync3() - { - // Snippet: ListStringsAsync(string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IResourceName name = new ArchiveName("[ARCHIVE]"); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(name); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings3() - { - // Snippet: ListStrings(string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IResourceName name = new ArchiveName("[ARCHIVE]"); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(name); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for ListStringsAsync public async Task ListStringsAsync_RequestObject() { @@ -7423,102 +7077,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for FindRelatedBooksAsync - public async Task FindRelatedBooksAsync() - { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IEnumerable names = new[] - { - BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - IEnumerable shelves = new List(); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.FindRelatedBooksAsync(names, shelves); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((BookNameOneof item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (BookNameOneof item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookNameOneof item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for FindRelatedBooks - public void FindRelatedBooks() - { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IEnumerable names = new[] - { - BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - IEnumerable shelves = new List(); - // Make the request - PagedEnumerable response = - libraryServiceClient.FindRelatedBooks(names, shelves); - - // Iterate over all response items, lazily performing RPCs as required - foreach (BookNameOneof item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (FindRelatedBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (BookNameOneof item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (BookNameOneof item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync_RequestObject() { From 1c0fd97264628b76c246444f8da5ae043f96326d Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 13:27:27 +0800 Subject: [PATCH 24/36] update csharp --- .../CSharpGapicSnippetsTransformer.java | 10 +- .../testdata/csharp/csharp_library.baseline | 1395 +++++---------- ...amplegen_config_migration_library.baseline | 1325 +++++--------- .../testdata/csharp_library.baseline | 1585 ++++++----------- 4 files changed, 1511 insertions(+), 2804 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index bc440b04b4..9e93b00d22 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -147,11 +147,6 @@ private List generateMethods(InterfaceContext co } else if (methodConfig.isPageStreaming()) { if (methodConfig.isFlattening()) { ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); - flatteningGroups = - flatteningGroups - .stream() - .filter(FlatteningConfig::hasAnyResourceNameParameter) - .collect(ImmutableList.toImmutableList()); // Find flattenings that have ambiguous parameters, and mark them to use named arguments. // Ambiguity occurs in a page-stream flattening that has one or two extra string // parameters (that are not resource-names) compared to any other flattening of this same @@ -208,6 +203,11 @@ private List generateMethods(InterfaceContext co } else { if (methodConfig.isFlattening()) { ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); + flatteningGroups = + flatteningGroups + .stream() + .filter(FlatteningConfig::hasAnyResourceNameParameter) + .collect(ImmutableList.toImmutableList()); boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { FlatteningConfig flatteningGroup = flatteningGroups.get(i); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 1c25e87314..dea3aab165 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -4850,33 +4850,6 @@ namespace Google.Example.Library.V1.Snippets /// Generated snippets public class GeneratedLibraryServiceClientSnippets { - /// Snippet for CreateShelfAsync - public async Task CreateShelfAsync() - { - // Snippet: CreateShelfAsync(Shelf,CallSettings) - // Additional: CreateShelfAsync(Shelf,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - // Make the request - Shelf response = await libraryServiceClient.CreateShelfAsync(shelf); - // End snippet - } - - /// Snippet for CreateShelf - public void CreateShelf() - { - // Snippet: CreateShelf(Shelf,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - // Make the request - Shelf response = libraryServiceClient.CreateShelf(shelf); - // End snippet - } - /// Snippet for CreateShelfAsync public async Task CreateShelfAsync_RequestObject() { @@ -4939,33 +4912,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() - { - // Snippet: GetShelfAsync(string,CallSettings) - // Additional: GetShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf2() - { - // Snippet: GetShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) @@ -4980,7 +4926,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf3() + public void GetShelf2() { // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) // Create client @@ -4994,36 +4940,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelfAsync - public async Task GetShelfAsync4() - { - // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf4() - { - // Snippet: GetShelf(string,SomeMessage,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync5() + public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) @@ -5039,7 +4956,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf5() + public void GetShelf3() { // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) // Create client @@ -5053,37 +4970,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetShelfAsync - public async Task GetShelfAsync6() - { - // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf6() - { - // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); - // End snippet - } - /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5120,16 +5006,14 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListShelvesAsync - public async Task ListShelvesAsync_RequestObject() + public async Task ListShelvesAsync() { - // Snippet: ListShelvesAsync(ListShelvesRequest,CallSettings) + // Snippet: ListShelvesAsync(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListShelvesAsync(request); + libraryServiceClient.ListShelvesAsync(); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Shelf item) => @@ -5164,16 +5048,14 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListShelves - public void ListShelves_RequestObject() + public void ListShelves() { - // Snippet: ListShelves(ListShelvesRequest,CallSettings) + // Snippet: ListShelves(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); // Make the request PagedEnumerable response = - libraryServiceClient.ListShelves(request); + libraryServiceClient.ListShelves(); // Iterate over all response items, lazily performing RPCs as required foreach (Shelf item in response) @@ -5207,38 +5089,99 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync1() + /// Snippet for ListShelvesAsync + public async Task ListShelvesAsync_RequestObject() { - // Snippet: DeleteShelfAsync(ShelfName,CallSettings) - // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Snippet: ListShelvesAsync(ListShelvesRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); + ListShelvesRequest request = new ListShelvesRequest(); // Make the request - await libraryServiceClient.DeleteShelfAsync(name); + PagedAsyncEnumerable response = + libraryServiceClient.ListShelvesAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Shelf item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListShelvesResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Shelf item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Shelf item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } - /// Snippet for DeleteShelf - public void DeleteShelf1() + /// Snippet for ListShelves + public void ListShelves_RequestObject() { - // Snippet: DeleteShelf(ShelfName,CallSettings) + // Snippet: ListShelves(ListShelvesRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); + ListShelvesRequest request = new ListShelvesRequest(); // Make the request - libraryServiceClient.DeleteShelf(name); + PagedEnumerable response = + libraryServiceClient.ListShelves(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Shelf item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListShelvesResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Shelf item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Shelf item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync2() + public async Task DeleteShelfAsync() { - // Snippet: DeleteShelfAsync(string,CallSettings) - // Additional: DeleteShelfAsync(string,CancellationToken) + // Snippet: DeleteShelfAsync(ShelfName,CallSettings) + // Additional: DeleteShelfAsync(ShelfName,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5249,9 +5192,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelf - public void DeleteShelf2() + public void DeleteShelf() { - // Snippet: DeleteShelf(string,CallSettings) + // Snippet: DeleteShelf(ShelfName,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5295,7 +5238,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync1() + public async Task MergeShelvesAsync() { // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) @@ -5310,7 +5253,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelves - public void MergeShelves1() + public void MergeShelves() { // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) // Create client @@ -5323,35 +5266,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync2() - { - // Snippet: MergeShelvesAsync(string,string,CallSettings) - // Additional: MergeShelvesAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MergeShelves - public void MergeShelves2() - { - // Snippet: MergeShelves(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); - // End snippet - } - /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5388,7 +5302,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBookAsync - public async Task CreateBookAsync1() + public async Task CreateBookAsync() { // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) @@ -5403,7 +5317,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBook - public void CreateBook1() + public void CreateBook() { // Snippet: CreateBook(ShelfName,Book,CallSettings) // Create client @@ -5416,35 +5330,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for CreateBookAsync - public async Task CreateBookAsync2() - { - // Snippet: CreateBookAsync(string,Book,CallSettings) - // Additional: CreateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.CreateBookAsync(name, book); - // End snippet - } - - /// Snippet for CreateBook - public void CreateBook2() - { - // Snippet: CreateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.CreateBook(name, book); - // End snippet - } - /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5480,45 +5365,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for PublishSeriesAsync - public async Task PublishSeriesAsync() - { - // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) - // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - // Make the request - PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid); - // End snippet - } - - /// Snippet for PublishSeries - public void PublishSeries() - { - // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - // Make the request - PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid); - // End snippet - } - /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -5563,7 +5409,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookAsync - public async Task GetBookAsync1() + public async Task GetBookAsync() { // Snippet: GetBookAsync(BookName,CallSettings) // Additional: GetBookAsync(BookName,CancellationToken) @@ -5577,7 +5423,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBook - public void GetBook1() + public void GetBook() { // Snippet: GetBook(BookName,CallSettings) // Create client @@ -5589,33 +5435,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookAsync - public async Task GetBookAsync2() - { - // Snippet: GetBookAsync(string,CallSettings) - // Additional: GetBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = await libraryServiceClient.GetBookAsync(name); - // End snippet - } - - /// Snippet for GetBook - public void GetBook2() - { - // Snippet: GetBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = libraryServiceClient.GetBook(name); - // End snippet - } - /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5650,7 +5469,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync() + public async Task ListBooksAsync1() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -5695,7 +5514,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks() + public void ListBooks1() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -5739,6 +5558,96 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for ListBooksAsync + public async Task ListBooksAsync2() + { + // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListBooksAsync(name, filter); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Book item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListBooks + public void ListBooks2() + { + // Snippet: ListBooks(string,string,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; + // Make the request + PagedEnumerable response = + libraryServiceClient.ListBooks(name, filter); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Book item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + /// Snippet for ListBooksAsync public async Task ListBooksAsync_RequestObject() { @@ -5836,7 +5745,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync1() + public async Task DeleteBookAsync() { // Snippet: DeleteBookAsync(BookName,CallSettings) // Additional: DeleteBookAsync(BookName,CancellationToken) @@ -5850,7 +5759,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteBook - public void DeleteBook1() + public void DeleteBook() { // Snippet: DeleteBook(BookName,CallSettings) // Create client @@ -5862,33 +5771,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync2() - { - // Snippet: DeleteBookAsync(string,CallSettings) - // Additional: DeleteBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook2() - { - // Snippet: DeleteBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -5953,35 +5835,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() - { - // Snippet: UpdateBookAsync(string,Book,CallSettings) - // Additional: UpdateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, book); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook2() - { - // Snippet: UpdateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, book); - // End snippet - } - - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync3() { // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) @@ -5999,7 +5852,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBook - public void UpdateBook3() + public void UpdateBook2() { // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client @@ -6015,41 +5868,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync4() - { - // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook4() - { - // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -6086,7 +5904,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync1() + public async Task MoveBookAsync() { // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) @@ -6101,7 +5919,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBook - public void MoveBook1() + public void MoveBook() { // Snippet: MoveBook(BookName,ShelfName,CallSettings) // Create client @@ -6115,71 +5933,126 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync2() + public async Task MoveBookAsync_RequestObject() { - // Snippet: MoveBookAsync(string,string,CallSettings) - // Additional: MoveBookAsync(string,string,CancellationToken) + // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) + // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request - Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + Book response = await libraryServiceClient.MoveBookAsync(request); // End snippet } /// Snippet for MoveBook - public void MoveBook2() + public void MoveBook_RequestObject() { - // Snippet: MoveBook(string,string,CallSettings) + // Snippet: MoveBook(MoveBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request - Book response = libraryServiceClient.MoveBook(name, otherShelfName); + Book response = libraryServiceClient.MoveBook(request); // End snippet } - /// Snippet for MoveBookAsync - public async Task MoveBookAsync_RequestObject() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync1() { - // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) - // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) + // Snippet: ListStringsAsync(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; // Make the request - Book response = await libraryServiceClient.MoveBookAsync(request); + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((IResourceName item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } - /// Snippet for MoveBook - public void MoveBook_RequestObject() + /// Snippet for ListStrings + public void ListStrings1() { - // Snippet: MoveBook(MoveBookRequest,CallSettings) + // Snippet: ListStrings(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; // Make the request - Book response = libraryServiceClient.MoveBook(request); + PagedEnumerable response = + libraryServiceClient.ListStrings(); + + // Iterate over all response items, lazily performing RPCs as required + foreach (IResourceName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } /// Snippet for ListStringsAsync - public async Task ListStringsAsync() + public async Task ListStringsAsync2() { // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client @@ -6223,7 +6096,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings() + public void ListStrings2() { // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client @@ -6267,16 +6140,16 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync_RequestObject() + public async Task ListStringsAsync3() { - // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) + // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(request); + libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((IResourceName item) => @@ -6311,16 +6184,16 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings_RequestObject() + public void ListStrings3() { - // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Snippet: ListStrings(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); // Make the request PagedEnumerable response = - libraryServiceClient.ListStrings(request); + libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required foreach (IResourceName item in response) @@ -6354,56 +6227,99 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync1() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync_RequestObject() { - // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((IResourceName item) => { - new Comment + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - await libraryServiceClient.AddCommentsAsync(name, comments); + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } - /// Snippet for AddComments - public void AddComments1() + /// Snippet for ListStrings + public void ListStrings_RequestObject() { - // Snippet: AddComments(BookName,IEnumerable,CallSettings) + // Snippet: ListStrings(ListStringsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedEnumerable response = + libraryServiceClient.ListStrings(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (IResourceName item in response) { - new Comment + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - libraryServiceClient.AddComments(name, comments); + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync2() + public async Task AddCommentsAsync() { - // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) + // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6423,9 +6339,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for AddComments - public void AddComments2() + public void AddComments() { - // Snippet: AddComments(string,IEnumerable,CallSettings) + // Snippet: AddComments(BookName,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6496,7 +6412,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync1() + public async Task GetBookFromArchiveAsync() { // Snippet: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CallSettings) // Additional: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CancellationToken) @@ -6511,7 +6427,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchive - public void GetBookFromArchive1() + public void GetBookFromArchive() { // Snippet: GetBookFromArchive(ArchivedBookName,LocationParentNameOneof,CallSettings) // Create client @@ -6524,35 +6440,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync2() - { - // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) - // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); - // Make the request - BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); - // End snippet - } - - /// Snippet for GetBookFromArchive - public void GetBookFromArchive2() - { - // Snippet: GetBookFromArchive(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); - // Make the request - BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); - // End snippet - } - /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -6589,7 +6476,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync1() + public async Task GetBookFromAnywhereAsync() { // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CallSettings) // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CancellationToken) @@ -6606,7 +6493,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere1() + public void GetBookFromAnywhere() { // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,LocationName,FolderName,CallSettings) // Create client @@ -6622,62 +6509,29 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync2() + public async Task GetBookFromAnywhereAsync_RequestObject() { - // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) - // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) + // Snippet: GetBookFromAnywhereAsync(GetBookFromAnywhereRequest,CallSettings) + // Additional: GetBookFromAnywhereAsync(GetBookFromAnywhereRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); + GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), + }; // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); + BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(request); // End snippet } /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere2() + public void GetBookFromAnywhere_RequestObject() { - // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); - // End snippet - } - - /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync_RequestObject() - { - // Snippet: GetBookFromAnywhereAsync(GetBookFromAnywhereRequest,CallSettings) - // Additional: GetBookFromAnywhereAsync(GetBookFromAnywhereRequest,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - GetBookFromAnywhereRequest request = new GetBookFromAnywhereRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), - FolderAsFolderName = new FolderName("[FOLDER]"), - }; - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(request); - // End snippet - } - - /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere_RequestObject() - { - // Snippet: GetBookFromAnywhere(GetBookFromAnywhereRequest,CallSettings) + // Snippet: GetBookFromAnywhere(GetBookFromAnywhereRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6694,7 +6548,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync1() + public async Task GetBookFromAbsolutelyAnywhereAsync() { // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) @@ -6708,7 +6562,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere1() + public void GetBookFromAbsolutelyAnywhere() { // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) // Create client @@ -6720,33 +6574,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync2() - { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); - // End snippet - } - - /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere2() - { - // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); - // End snippet - } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -6781,7 +6608,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync1() + public async Task UpdateBookIndexAsync() { // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) @@ -6800,7 +6627,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndex - public void UpdateBookIndex1() + public void UpdateBookIndex() { // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) // Create client @@ -6817,43 +6644,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync2() - { - // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); - // End snippet - } - - /// Snippet for UpdateBookIndex - public void UpdateBookIndex2() - { - // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); - // End snippet - } - /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -6993,6 +6783,102 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for FindRelatedBooksAsync + public async Task FindRelatedBooksAsync() + { + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.FindRelatedBooksAsync(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((BookName item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for FindRelatedBooks + public void FindRelatedBooks() + { + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedEnumerable response = + libraryServiceClient.FindRelatedBooks(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + foreach (BookName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (FindRelatedBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync_RequestObject() { @@ -7095,35 +6981,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddLabelAsync - public async Task AddLabelAsync() - { - // Snippet: AddLabelAsync(string,string,CallSettings) - // Additional: AddLabelAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); - string label = ""; - // Make the request - AddLabelResponse response = await libraryServiceClient.AddLabelAsync(formattedResource, label); - // End snippet - } - - /// Snippet for AddLabel - public void AddLabel() - { - // Snippet: AddLabel(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); - string label = ""; - // Make the request - AddLabelResponse response = libraryServiceClient.AddLabel(formattedResource, label); - // End snippet - } - /// Snippet for AddLabelAsync public async Task AddLabelAsync_RequestObject() { @@ -7548,30 +7405,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync1() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams1() - { - // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync2() + public async Task TestOptionalRequiredFlatteningParamsAsync() { // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) @@ -7706,7 +7540,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams2() + public void TestOptionalRequiredFlatteningParams() { // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client @@ -7839,275 +7673,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync3() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams3() - { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 2827277b00..d6ec901d7f 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -1687,33 +1687,6 @@ namespace Google.Example.Library.V1.Snippets /// Generated snippets public class GeneratedLibraryServiceClientSnippets { - /// Snippet for CreateShelfAsync - public async Task CreateShelfAsync() - { - // Snippet: CreateShelfAsync(Shelf,CallSettings) - // Additional: CreateShelfAsync(Shelf,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - // Make the request - Shelf response = await libraryServiceClient.CreateShelfAsync(shelf); - // End snippet - } - - /// Snippet for CreateShelf - public void CreateShelf() - { - // Snippet: CreateShelf(Shelf,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - // Make the request - Shelf response = libraryServiceClient.CreateShelf(shelf); - // End snippet - } - /// Snippet for CreateShelfAsync public async Task CreateShelfAsync_RequestObject() { @@ -1776,33 +1749,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() - { - // Snippet: GetShelfAsync(string,CallSettings) - // Additional: GetShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf2() - { - // Snippet: GetShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) @@ -1817,7 +1763,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf3() + public void GetShelf2() { // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) // Create client @@ -1831,36 +1777,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelfAsync - public async Task GetShelfAsync4() - { - // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf4() - { - // Snippet: GetShelf(string,SomeMessage,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync5() + public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) @@ -1876,7 +1793,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf5() + public void GetShelf3() { // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) // Create client @@ -1890,37 +1807,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetShelfAsync - public async Task GetShelfAsync6() - { - // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf6() - { - // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); - // End snippet - } - /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -1957,16 +1843,14 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListShelvesAsync - public async Task ListShelvesAsync_RequestObject() + public async Task ListShelvesAsync() { - // Snippet: ListShelvesAsync(ListShelvesRequest,CallSettings) + // Snippet: ListShelvesAsync(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListShelvesAsync(request); + libraryServiceClient.ListShelvesAsync(); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Shelf item) => @@ -2001,16 +1885,14 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListShelves - public void ListShelves_RequestObject() + public void ListShelves() { - // Snippet: ListShelves(ListShelvesRequest,CallSettings) + // Snippet: ListShelves(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); // Make the request PagedEnumerable response = - libraryServiceClient.ListShelves(request); + libraryServiceClient.ListShelves(); // Iterate over all response items, lazily performing RPCs as required foreach (Shelf item in response) @@ -2044,38 +1926,99 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync1() + /// Snippet for ListShelvesAsync + public async Task ListShelvesAsync_RequestObject() { - // Snippet: DeleteShelfAsync(ShelfName,CallSettings) - // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Snippet: ListShelvesAsync(ListShelvesRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); + ListShelvesRequest request = new ListShelvesRequest(); // Make the request - await libraryServiceClient.DeleteShelfAsync(name); + PagedAsyncEnumerable response = + libraryServiceClient.ListShelvesAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Shelf item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListShelvesResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Shelf item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Shelf item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } - /// Snippet for DeleteShelf - public void DeleteShelf1() + /// Snippet for ListShelves + public void ListShelves_RequestObject() { - // Snippet: DeleteShelf(ShelfName,CallSettings) + // Snippet: ListShelves(ListShelvesRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); + ListShelvesRequest request = new ListShelvesRequest(); // Make the request - libraryServiceClient.DeleteShelf(name); + PagedEnumerable response = + libraryServiceClient.ListShelves(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Shelf item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListShelvesResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Shelf item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Shelf item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync2() + public async Task DeleteShelfAsync() { - // Snippet: DeleteShelfAsync(string,CallSettings) - // Additional: DeleteShelfAsync(string,CancellationToken) + // Snippet: DeleteShelfAsync(ShelfName,CallSettings) + // Additional: DeleteShelfAsync(ShelfName,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2086,9 +2029,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelf - public void DeleteShelf2() + public void DeleteShelf() { - // Snippet: DeleteShelf(string,CallSettings) + // Snippet: DeleteShelf(ShelfName,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2132,7 +2075,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync1() + public async Task MergeShelvesAsync() { // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) @@ -2147,7 +2090,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelves - public void MergeShelves1() + public void MergeShelves() { // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) // Create client @@ -2160,35 +2103,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync2() - { - // Snippet: MergeShelvesAsync(string,string,CallSettings) - // Additional: MergeShelvesAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MergeShelves - public void MergeShelves2() - { - // Snippet: MergeShelves(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); - // End snippet - } - /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -2225,7 +2139,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBookAsync - public async Task CreateBookAsync1() + public async Task CreateBookAsync() { // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) @@ -2240,7 +2154,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBook - public void CreateBook1() + public void CreateBook() { // Snippet: CreateBook(ShelfName,Book,CallSettings) // Create client @@ -2253,35 +2167,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for CreateBookAsync - public async Task CreateBookAsync2() - { - // Snippet: CreateBookAsync(string,Book,CallSettings) - // Additional: CreateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.CreateBookAsync(name, book); - // End snippet - } - - /// Snippet for CreateBook - public void CreateBook2() - { - // Snippet: CreateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.CreateBook(name, book); - // End snippet - } - /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -2317,45 +2202,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for PublishSeriesAsync - public async Task PublishSeriesAsync() - { - // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) - // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - // Make the request - PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid); - // End snippet - } - - /// Snippet for PublishSeries - public void PublishSeries() - { - // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - // Make the request - PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid); - // End snippet - } - /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -2400,7 +2246,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookAsync - public async Task GetBookAsync1() + public async Task GetBookAsync() { // Snippet: GetBookAsync(BookName,CallSettings) // Additional: GetBookAsync(BookName,CancellationToken) @@ -2414,7 +2260,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBook - public void GetBook1() + public void GetBook() { // Snippet: GetBook(BookName,CallSettings) // Create client @@ -2426,33 +2272,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookAsync - public async Task GetBookAsync2() - { - // Snippet: GetBookAsync(string,CallSettings) - // Additional: GetBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = await libraryServiceClient.GetBookAsync(name); - // End snippet - } - - /// Snippet for GetBook - public void GetBook2() - { - // Snippet: GetBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = libraryServiceClient.GetBook(name); - // End snippet - } - /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -2487,7 +2306,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync() + public async Task ListBooksAsync1() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -2532,7 +2351,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks() + public void ListBooks1() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -2576,6 +2395,96 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for ListBooksAsync + public async Task ListBooksAsync2() + { + // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListBooksAsync(name, filter); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Book item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListBooks + public void ListBooks2() + { + // Snippet: ListBooks(string,string,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; + // Make the request + PagedEnumerable response = + libraryServiceClient.ListBooks(name, filter); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Book item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + /// Snippet for ListBooksAsync public async Task ListBooksAsync_RequestObject() { @@ -2673,7 +2582,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync1() + public async Task DeleteBookAsync() { // Snippet: DeleteBookAsync(BookName,CallSettings) // Additional: DeleteBookAsync(BookName,CancellationToken) @@ -2687,7 +2596,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteBook - public void DeleteBook1() + public void DeleteBook() { // Snippet: DeleteBook(BookName,CallSettings) // Create client @@ -2699,33 +2608,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync2() - { - // Snippet: DeleteBookAsync(string,CallSettings) - // Additional: DeleteBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook2() - { - // Snippet: DeleteBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -2790,35 +2672,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() - { - // Snippet: UpdateBookAsync(string,Book,CallSettings) - // Additional: UpdateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, book); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook2() - { - // Snippet: UpdateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, book); - // End snippet - } - - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync3() { // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) @@ -2836,7 +2689,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBook - public void UpdateBook3() + public void UpdateBook2() { // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client @@ -2852,41 +2705,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync4() - { - // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook4() - { - // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -2923,7 +2741,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync1() + public async Task MoveBookAsync() { // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) @@ -2938,7 +2756,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBook - public void MoveBook1() + public void MoveBook() { // Snippet: MoveBook(BookName,ShelfName,CallSettings) // Create client @@ -2952,73 +2770,216 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync2() + public async Task MoveBookAsync_RequestObject() { - // Snippet: MoveBookAsync(string,string,CallSettings) - // Additional: MoveBookAsync(string,string,CancellationToken) + // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) + // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request - Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + Book response = await libraryServiceClient.MoveBookAsync(request); // End snippet } /// Snippet for MoveBook - public void MoveBook2() + public void MoveBook_RequestObject() { - // Snippet: MoveBook(string,string,CallSettings) + // Snippet: MoveBook(MoveBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request - Book response = libraryServiceClient.MoveBook(name, otherShelfName); + Book response = libraryServiceClient.MoveBook(request); // End snippet } - /// Snippet for MoveBookAsync - public async Task MoveBookAsync_RequestObject() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync1() { - // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) - // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) + // Snippet: ListStringsAsync(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((IResourceName item) => { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListStrings + public void ListStrings1() + { + // Snippet: ListStrings(string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Make the request - Book response = await libraryServiceClient.MoveBookAsync(request); + PagedEnumerable response = + libraryServiceClient.ListStrings(); + + // Iterate over all response items, lazily performing RPCs as required + foreach (IResourceName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } - /// Snippet for MoveBook - public void MoveBook_RequestObject() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync2() { - // Snippet: MoveBook(MoveBookRequest,CallSettings) + // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(name); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((IResourceName item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListStrings + public void ListStrings2() + { + // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest + IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + // Make the request + PagedEnumerable response = + libraryServiceClient.ListStrings(name); + + // Iterate over all response items, lazily performing RPCs as required + foreach (IResourceName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - // Make the request - Book response = libraryServiceClient.MoveBook(request); + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } /// Snippet for ListStringsAsync - public async Task ListStringsAsync() + public async Task ListStringsAsync3() { - // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) + // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3060,9 +3021,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings() + public void ListStrings3() { - // Snippet: ListStrings(IResourceName,string,int?,CallSettings) + // Snippet: ListStrings(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3192,7 +3153,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync1() + public async Task AddCommentsAsync() { // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) @@ -3215,7 +3176,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for AddComments - public void AddComments1() + public void AddComments() { // Snippet: AddComments(BookName,IEnumerable,CallSettings) // Create client @@ -3236,51 +3197,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync2() - { - // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - await libraryServiceClient.AddCommentsAsync(name, comments); - // End snippet - } - - /// Snippet for AddComments - public void AddComments2() - { - // Snippet: AddComments(string,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - libraryServiceClient.AddComments(name, comments); - // End snippet - } - /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -3333,7 +3249,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync1() + public async Task GetBookFromArchiveAsync() { // Snippet: GetBookFromArchiveAsync(ArchivedBookName,CallSettings) // Additional: GetBookFromArchiveAsync(ArchivedBookName,CancellationToken) @@ -3347,7 +3263,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchive - public void GetBookFromArchive1() + public void GetBookFromArchive() { // Snippet: GetBookFromArchive(ArchivedBookName,CallSettings) // Create client @@ -3359,33 +3275,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync2() - { - // Snippet: GetBookFromArchiveAsync(string,CallSettings) - // Additional: GetBookFromArchiveAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name); - // End snippet - } - - /// Snippet for GetBookFromArchive - public void GetBookFromArchive2() - { - // Snippet: GetBookFromArchive(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - BookFromArchive response = libraryServiceClient.GetBookFromArchive(name); - // End snippet - } - /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -3420,7 +3309,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync1() + public async Task GetBookFromAnywhereAsync() { // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,CallSettings) // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,CancellationToken) @@ -3435,7 +3324,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere1() + public void GetBookFromAnywhere() { // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,CallSettings) // Create client @@ -3448,35 +3337,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync2() - { - // Snippet: GetBookFromAnywhereAsync(string,string,CallSettings) - // Additional: GetBookFromAnywhereAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName); - // End snippet - } - - /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere2() - { - // Snippet: GetBookFromAnywhere(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName); - // End snippet - } - /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -3513,7 +3373,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync1() + public async Task GetBookFromAbsolutelyAnywhereAsync() { // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) @@ -3527,7 +3387,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere1() + public void GetBookFromAbsolutelyAnywhere() { // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) // Create client @@ -3539,33 +3399,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync2() - { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); - // End snippet - } - - /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere2() - { - // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); - // End snippet - } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -3600,7 +3433,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync1() + public async Task UpdateBookIndexAsync() { // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) @@ -3619,7 +3452,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndex - public void UpdateBookIndex1() + public void UpdateBookIndex() { // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) // Create client @@ -3636,43 +3469,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync2() - { - // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); - // End snippet - } - - /// Snippet for UpdateBookIndex - public void UpdateBookIndex2() - { - // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); - // End snippet - } - /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -3802,13 +3598,109 @@ namespace Google.Example.Library.V1.Snippets // Stream a request to the server await duplexStream.WriteAsync(request); - // Set "done" to true when sending requests is complete + // Set "done" to true when sending requests is complete + } + // Complete writing requests to the stream + await duplexStream.WriteCompleteAsync(); + // Await the response handler. + // This will complete once all server responses have been processed. + await responseHandlerTask; + // End snippet + } + + /// Snippet for FindRelatedBooksAsync + public async Task FindRelatedBooksAsync() + { + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.FindRelatedBooksAsync(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((BookName item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for FindRelatedBooks + public void FindRelatedBooks() + { + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + IEnumerable names = new[] + { + new BookName("[SHELF]", "[BOOK]"), + }; + IEnumerable shelves = new List(); + // Make the request + PagedEnumerable response = + libraryServiceClient.FindRelatedBooks(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + foreach (BookName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (FindRelatedBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookName item in singlePage) + { + Console.WriteLine(item); } - // Complete writing requests to the stream - await duplexStream.WriteCompleteAsync(); - // Await the response handler. - // This will complete once all server responses have been processed. - await responseHandlerTask; + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } @@ -3914,35 +3806,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddLabelAsync - public async Task AddLabelAsync() - { - // Snippet: AddLabelAsync(string,string,CallSettings) - // Additional: AddLabelAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); - string label = ""; - // Make the request - AddLabelResponse response = await libraryServiceClient.AddLabelAsync(formattedResource, label); - // End snippet - } - - /// Snippet for AddLabel - public void AddLabel() - { - // Snippet: AddLabel(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); - string label = ""; - // Make the request - AddLabelResponse response = libraryServiceClient.AddLabel(formattedResource, label); - // End snippet - } - /// Snippet for AddLabelAsync public async Task AddLabelAsync_RequestObject() { @@ -4367,30 +4230,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync1() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams1() - { - // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync2() + public async Task TestOptionalRequiredFlatteningParamsAsync() { // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) @@ -4493,7 +4333,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams2() + public void TestOptionalRequiredFlatteningParams() { // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client @@ -4594,211 +4434,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync3() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams3() - { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index f270a2b66b..6bdd818655 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -4891,33 +4891,6 @@ namespace Google.Example.Library.V1.Snippets /// Generated snippets public class GeneratedLibraryServiceClientSnippets { - /// Snippet for CreateShelfAsync - public async Task CreateShelfAsync() - { - // Snippet: CreateShelfAsync(Shelf,CallSettings) - // Additional: CreateShelfAsync(Shelf,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - // Make the request - Shelf response = await libraryServiceClient.CreateShelfAsync(shelf); - // End snippet - } - - /// Snippet for CreateShelf - public void CreateShelf() - { - // Snippet: CreateShelf(Shelf,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - // Make the request - Shelf response = libraryServiceClient.CreateShelf(shelf); - // End snippet - } - /// Snippet for CreateShelfAsync public async Task CreateShelfAsync_RequestObject() { @@ -4980,33 +4953,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() - { - // Snippet: GetShelfAsync(string,CallSettings) - // Additional: GetShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf2() - { - // Snippet: GetShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) @@ -5021,7 +4967,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf3() + public void GetShelf2() { // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) // Create client @@ -5035,36 +4981,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelfAsync - public async Task GetShelfAsync4() - { - // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf4() - { - // Snippet: GetShelf(string,SomeMessage,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync5() + public async Task GetShelfAsync3() { // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) @@ -5080,7 +4997,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetShelf - public void GetShelf5() + public void GetShelf3() { // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) // Create client @@ -5094,37 +5011,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetShelfAsync - public async Task GetShelfAsync6() - { - // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf6() - { - // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); - // End snippet - } - /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5161,16 +5047,14 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListShelvesAsync - public async Task ListShelvesAsync_RequestObject() + public async Task ListShelvesAsync() { - // Snippet: ListShelvesAsync(ListShelvesRequest,CallSettings) + // Snippet: ListShelvesAsync(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListShelvesAsync(request); + libraryServiceClient.ListShelvesAsync(); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Shelf item) => @@ -5205,16 +5089,14 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListShelves - public void ListShelves_RequestObject() + public void ListShelves() { - // Snippet: ListShelves(ListShelvesRequest,CallSettings) + // Snippet: ListShelves(string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ListShelvesRequest request = new ListShelvesRequest(); // Make the request PagedEnumerable response = - libraryServiceClient.ListShelves(request); + libraryServiceClient.ListShelves(); // Iterate over all response items, lazily performing RPCs as required foreach (Shelf item in response) @@ -5248,38 +5130,99 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync1() + /// Snippet for ListShelvesAsync + public async Task ListShelvesAsync_RequestObject() { - // Snippet: DeleteShelfAsync(ShelfName,CallSettings) - // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Snippet: ListShelvesAsync(ListShelvesRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); + ListShelvesRequest request = new ListShelvesRequest(); // Make the request - await libraryServiceClient.DeleteShelfAsync(name); + PagedAsyncEnumerable response = + libraryServiceClient.ListShelvesAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Shelf item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListShelvesResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Shelf item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Shelf item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } - /// Snippet for DeleteShelf - public void DeleteShelf1() + /// Snippet for ListShelves + public void ListShelves_RequestObject() { - // Snippet: DeleteShelf(ShelfName,CallSettings) + // Snippet: ListShelves(ListShelvesRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); + ListShelvesRequest request = new ListShelvesRequest(); // Make the request - libraryServiceClient.DeleteShelf(name); + PagedEnumerable response = + libraryServiceClient.ListShelves(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Shelf item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListShelvesResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Shelf item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Shelf item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync2() + public async Task DeleteShelfAsync() { - // Snippet: DeleteShelfAsync(string,CallSettings) - // Additional: DeleteShelfAsync(string,CancellationToken) + // Snippet: DeleteShelfAsync(ShelfName,CallSettings) + // Additional: DeleteShelfAsync(ShelfName,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5290,9 +5233,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteShelf - public void DeleteShelf2() + public void DeleteShelf() { - // Snippet: DeleteShelf(string,CallSettings) + // Snippet: DeleteShelf(ShelfName,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5336,7 +5279,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync1() + public async Task MergeShelvesAsync() { // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) @@ -5351,7 +5294,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MergeShelves - public void MergeShelves1() + public void MergeShelves() { // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) // Create client @@ -5364,35 +5307,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync2() - { - // Snippet: MergeShelvesAsync(string,string,CallSettings) - // Additional: MergeShelvesAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MergeShelves - public void MergeShelves2() - { - // Snippet: MergeShelves(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); - // End snippet - } - /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5429,7 +5343,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBookAsync - public async Task CreateBookAsync1() + public async Task CreateBookAsync() { // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) @@ -5444,7 +5358,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for CreateBook - public void CreateBook1() + public void CreateBook() { // Snippet: CreateBook(ShelfName,Book,CallSettings) // Create client @@ -5457,35 +5371,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for CreateBookAsync - public async Task CreateBookAsync2() - { - // Snippet: CreateBookAsync(string,Book,CallSettings) - // Additional: CreateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.CreateBookAsync(name, book); - // End snippet - } - - /// Snippet for CreateBook - public void CreateBook2() - { - // Snippet: CreateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.CreateBook(name, book); - // End snippet - } - /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5522,7 +5407,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for PublishSeriesAsync - public async Task PublishSeriesAsync1() + public async Task PublishSeriesAsync() { // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CancellationToken) @@ -5543,7 +5428,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for PublishSeries - public void PublishSeries1() + public void PublishSeries() { // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) // Create client @@ -5562,47 +5447,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for PublishSeriesAsync - public async Task PublishSeriesAsync2() - { - // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) - // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - // Make the request - PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); - // End snippet - } - - /// Snippet for PublishSeries - public void PublishSeries2() - { - // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - // Make the request - PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid, publisher); - // End snippet - } - /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -5647,7 +5491,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookAsync - public async Task GetBookAsync1() + public async Task GetBookAsync() { // Snippet: GetBookAsync(BookNameOneof,CallSettings) // Additional: GetBookAsync(BookNameOneof,CancellationToken) @@ -5661,7 +5505,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBook - public void GetBook1() + public void GetBook() { // Snippet: GetBook(BookNameOneof,CallSettings) // Create client @@ -5673,33 +5517,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookAsync - public async Task GetBookAsync2() - { - // Snippet: GetBookAsync(string,CallSettings) - // Additional: GetBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Book response = await libraryServiceClient.GetBookAsync(name); - // End snippet - } - - /// Snippet for GetBook - public void GetBook2() - { - // Snippet: GetBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Book response = libraryServiceClient.GetBook(name); - // End snippet - } - /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5734,7 +5551,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync() + public async Task ListBooksAsync1() { // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client @@ -5779,7 +5596,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks() + public void ListBooks1() { // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client @@ -5823,6 +5640,96 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for ListBooksAsync + public async Task ListBooksAsync2() + { + // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListBooksAsync(name, filter); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((Book item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListBooks + public void ListBooks2() + { + // Snippet: ListBooks(string,string,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + string filter = "book-filter-string"; + // Make the request + PagedEnumerable response = + libraryServiceClient.ListBooks(name, filter); + + // Iterate over all response items, lazily performing RPCs as required + foreach (Book item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListBooksResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (Book item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (Book item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + /// Snippet for ListBooksAsync public async Task ListBooksAsync_RequestObject() { @@ -5920,7 +5827,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync1() + public async Task DeleteBookAsync() { // Snippet: DeleteBookAsync(BookNameOneof,CallSettings) // Additional: DeleteBookAsync(BookNameOneof,CancellationToken) @@ -5934,7 +5841,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for DeleteBook - public void DeleteBook1() + public void DeleteBook() { // Snippet: DeleteBook(BookNameOneof,CallSettings) // Create client @@ -5946,33 +5853,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync2() - { - // Snippet: DeleteBookAsync(string,CallSettings) - // Additional: DeleteBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook2() - { - // Snippet: DeleteBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -6037,35 +5917,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() - { - // Snippet: UpdateBookAsync(string,Book,CallSettings) - // Additional: UpdateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, book); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook2() - { - // Snippet: UpdateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, book); - // End snippet - } - - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync3() { // Snippet: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) // Additional: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CancellationToken) @@ -6083,7 +5934,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBook - public void UpdateBook3() + public void UpdateBook2() { // Snippet: UpdateBook(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client @@ -6099,41 +5950,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync4() - { - // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook4() - { - // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -6170,7 +5986,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync1() + public async Task MoveBookAsync() { // Snippet: MoveBookAsync(BookNameOneof,ShelfName,CallSettings) // Additional: MoveBookAsync(BookNameOneof,ShelfName,CancellationToken) @@ -6185,7 +6001,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBook - public void MoveBook1() + public void MoveBook() { // Snippet: MoveBook(BookNameOneof,ShelfName,CallSettings) // Create client @@ -6198,35 +6014,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MoveBookAsync - public async Task MoveBookAsync2() - { - // Snippet: MoveBookAsync(string,string,CallSettings) - // Additional: MoveBookAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MoveBook - public void MoveBook2() - { - // Snippet: MoveBook(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Book response = libraryServiceClient.MoveBook(name, otherShelfName); - // End snippet - } - /// Snippet for MoveBookAsync public async Task MoveBookAsync_RequestObject() { @@ -6263,7 +6050,91 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync() + public async Task ListStringsAsync1() + { + // Snippet: ListStringsAsync(string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((IResourceName item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListStrings + public void ListStrings1() + { + // Snippet: ListStrings(string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Make the request + PagedEnumerable response = + libraryServiceClient.ListStrings(); + + // Iterate over all response items, lazily performing RPCs as required + foreach (IResourceName item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) + { + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for ListStringsAsync + public async Task ListStringsAsync2() { // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client @@ -6307,7 +6178,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings() + public void ListStrings2() { // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client @@ -6351,16 +6222,16 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStringsAsync - public async Task ListStringsAsync_RequestObject() + public async Task ListStringsAsync3() { - // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) + // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchiveName("[ARCHIVE]"); // Make the request PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(request); + libraryServiceClient.ListStringsAsync(name); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((IResourceName item) => @@ -6395,16 +6266,16 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings_RequestObject() + public void ListStrings3() { - // Snippet: ListStrings(ListStringsRequest,CallSettings) + // Snippet: ListStrings(string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - ListStringsRequest request = new ListStringsRequest(); + IResourceName name = new ArchiveName("[ARCHIVE]"); // Make the request PagedEnumerable response = - libraryServiceClient.ListStrings(request); + libraryServiceClient.ListStrings(name); // Iterate over all response items, lazily performing RPCs as required foreach (IResourceName item in response) @@ -6438,56 +6309,99 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync1() + /// Snippet for ListStringsAsync + public async Task ListStringsAsync_RequestObject() { - // Snippet: AddCommentsAsync(BookNameOneof,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookNameOneof,IEnumerable,CancellationToken) + // Snippet: ListStringsAsync(ListStringsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.ListStringsAsync(request); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((IResourceName item) => { - new Comment + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - await libraryServiceClient.AddCommentsAsync(name, comments); + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } - /// Snippet for AddComments - public void AddComments1() + /// Snippet for ListStrings + public void ListStrings_RequestObject() { - // Snippet: AddComments(BookNameOneof,IEnumerable,CallSettings) + // Snippet: ListStrings(ListStringsRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] + ListStringsRequest request = new ListStringsRequest(); + // Make the request + PagedEnumerable response = + libraryServiceClient.ListStrings(request); + + // Iterate over all response items, lazily performing RPCs as required + foreach (IResourceName item in response) { - new Comment + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (ListStringsResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (IResourceName item in page) { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - libraryServiceClient.AddComments(name, comments); + Console.WriteLine(item); + } + } + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (IResourceName item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync2() + public async Task AddCommentsAsync() { - // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) + // Snippet: AddCommentsAsync(BookNameOneof,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookNameOneof,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6507,9 +6421,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for AddComments - public void AddComments2() + public void AddComments() { - // Snippet: AddComments(string,IEnumerable,CallSettings) + // Snippet: AddComments(BookNameOneof,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6580,7 +6494,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync1() + public async Task GetBookFromArchiveAsync() { // Snippet: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CallSettings) // Additional: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CancellationToken) @@ -6595,7 +6509,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromArchive - public void GetBookFromArchive1() + public void GetBookFromArchive() { // Snippet: GetBookFromArchive(ArchivedBookName,ProjectName,CallSettings) // Create client @@ -6608,35 +6522,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync2() - { - // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) - // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - // Make the request - BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); - // End snippet - } - - /// Snippet for GetBookFromArchive - public void GetBookFromArchive2() - { - // Snippet: GetBookFromArchive(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - // Make the request - BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); - // End snippet - } - /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -6673,7 +6558,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync1() + public async Task GetBookFromAnywhereAsync() { // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CancellationToken) @@ -6690,7 +6575,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere1() + public void GetBookFromAnywhere() { // Snippet: GetBookFromAnywhere(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) // Create client @@ -6705,39 +6590,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync2() - { - // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) - // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); - // End snippet - } - - /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere2() - { - // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); - // End snippet - } - /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -6778,7 +6630,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync1() + public async Task GetBookFromAbsolutelyAnywhereAsync() { // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) @@ -6792,7 +6644,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere1() + public void GetBookFromAbsolutelyAnywhere() { // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) // Create client @@ -6804,33 +6656,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync2() - { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); - // End snippet - } - - /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere2() - { - // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); - // End snippet - } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -6865,7 +6690,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync1() + public async Task UpdateBookIndexAsync() { // Snippet: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CallSettings) // Additional: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CancellationToken) @@ -6884,7 +6709,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookIndex - public void UpdateBookIndex1() + public void UpdateBookIndex() { // Snippet: UpdateBookIndex(BookNameOneof,string,IDictionary,CallSettings) // Create client @@ -6901,43 +6726,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync2() - { - // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); - // End snippet - } - - /// Snippet for UpdateBookIndex - public void UpdateBookIndex2() - { - // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); - // End snippet - } - /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -7043,37 +6831,133 @@ namespace Google.Example.Library.V1.Snippets // Sending requests and retrieving responses can be arbitrarily interleaved. // Exact sequence will depend on client/server behavior. - // Create task to do something with responses from server - Task responseHandlerTask = Task.Run(async () => + // Create task to do something with responses from server + Task responseHandlerTask = Task.Run(async () => + { + IAsyncEnumerator responseStream = duplexStream.ResponseStream; + while (await responseStream.MoveNext()) + { + Comment response = responseStream.Current; + // Do something with streamed response + } + // The response stream has completed + }); + + // Send requests to the server + bool done = false; + while (!done) + { + // Initialize a request + DiscussBookRequest request = new DiscussBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + // Stream a request to the server + await duplexStream.WriteAsync(request); + + // Set "done" to true when sending requests is complete + } + // Complete writing requests to the stream + await duplexStream.WriteCompleteAsync(); + // Await the response handler. + // This will complete once all server responses have been processed. + await responseHandlerTask; + // End snippet + } + + /// Snippet for FindRelatedBooksAsync + public async Task FindRelatedBooksAsync() + { + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + IEnumerable names = new[] + { + BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + IEnumerable shelves = new List(); + // Make the request + PagedAsyncEnumerable response = + libraryServiceClient.FindRelatedBooksAsync(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((BookNameOneof item) => + { + // Do something with each item + Console.WriteLine(item); + }); + + // Or iterate over pages (of server-defined size), performing one RPC per page + await response.AsRawResponses().ForEachAsync((FindRelatedBooksResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookNameOneof item in page) + { + Console.WriteLine(item); + } + }); + + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = await response.ReadPageAsync(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookNameOneof item in singlePage) + { + Console.WriteLine(item); + } + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; + // End snippet + } + + /// Snippet for FindRelatedBooks + public void FindRelatedBooks() + { + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + IEnumerable names = new[] + { + BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + IEnumerable shelves = new List(); + // Make the request + PagedEnumerable response = + libraryServiceClient.FindRelatedBooks(names, shelves); + + // Iterate over all response items, lazily performing RPCs as required + foreach (BookNameOneof item in response) + { + // Do something with each item + Console.WriteLine(item); + } + + // Or iterate over pages (of server-defined size), performing one RPC per page + foreach (FindRelatedBooksResponse page in response.AsRawResponses()) { - IAsyncEnumerator responseStream = duplexStream.ResponseStream; - while (await responseStream.MoveNext()) + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (BookNameOneof item in page) { - Comment response = responseStream.Current; - // Do something with streamed response + Console.WriteLine(item); } - // The response stream has completed - }); + } - // Send requests to the server - bool done = false; - while (!done) + // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required + int pageSize = 10; + Page singlePage = response.ReadPage(pageSize); + // Do something with the page of items + Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); + foreach (BookNameOneof item in singlePage) { - // Initialize a request - DiscussBookRequest request = new DiscussBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - // Stream a request to the server - await duplexStream.WriteAsync(request); - - // Set "done" to true when sending requests is complete + Console.WriteLine(item); } - // Complete writing requests to the stream - await duplexStream.WriteCompleteAsync(); - // Await the response handler. - // This will complete once all server responses have been processed. - await responseHandlerTask; + // Store the pageToken, for when the next page is required. + string nextPageToken = singlePage.NextPageToken; // End snippet } @@ -7538,367 +7422,75 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBigNothingAsync public async Task GetBigNothingAsync_RequestObject() - { - // Snippet: GetBigNothingAsync(GetBookRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - // Make the request - Operation response = - await libraryServiceClient.GetBigNothingAsync(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothing - public void GetBigNothing_RequestObject() - { - // Snippet: GetBigNothing(GetBookRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - // Make the request - Operation response = - libraryServiceClient.GetBigNothing(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigNothing(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync1() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams1() - { - // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync2() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = ""; - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = ""; - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); + { + // Snippet: GetBigNothingAsync(GetBookRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + GetBookRequest request = new GetBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Operation response = + await libraryServiceClient.GetBigNothingAsync(request); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } // End snippet } - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams2() + /// Snippet for GetBigNothing + public void GetBigNothing_RequestObject() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: GetBigNothing(GetBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = ""; - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = ""; - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); + GetBookRequest request = new GetBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + Operation response = + libraryServiceClient.GetBigNothing(request); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigNothing(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } // End snippet } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync3() + public async Task TestOptionalRequiredFlatteningParamsAsync() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -8030,9 +7622,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams3() + public void TestOptionalRequiredFlatteningParams() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -8613,39 +8205,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync10() - { - // Snippet: MoveBooksAsync(string,string,IEnumerable,string,CallSettings) - // Additional: MoveBooksAsync(string,string,IEnumerable,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks10() - { - // Snippet: MoveBooks(string,string,IEnumerable,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - /// Snippet for MoveBooksAsync public async Task MoveBooksAsync_RequestObject() { @@ -8760,35 +8319,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync4() - { - // Snippet: ArchiveBooksAsync(string,string,CallSettings) - // Additional: ArchiveBooksAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooks - public void ArchiveBooks4() - { - // Snippet: ArchiveBooks(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); - // End snippet - } - /// Snippet for ArchiveBooksAsync public async Task ArchiveBooksAsync_RequestObject() { @@ -9191,29 +8721,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for PrivateListShelvesAsync - public async Task PrivateListShelvesAsync() - { - // Snippet: PrivateListShelvesAsync(CallSettings) - // Additional: PrivateListShelvesAsync(CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Make the request - Book response = await libraryServiceClient.PrivateListShelvesAsync(); - // End snippet - } - - /// Snippet for PrivateListShelves - public void PrivateListShelves() - { - // Snippet: PrivateListShelves(CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Make the request - Book response = libraryServiceClient.PrivateListShelves(); - // End snippet - } - /// Snippet for PrivateListShelvesAsync public async Task PrivateListShelvesAsync_RequestObject() { From a9596c58153a032f67f91a8a8afc8c9e5e07062b Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 13:34:12 +0800 Subject: [PATCH 25/36] once more --- .../CSharpGapicSnippetsTransformer.java | 12 +- .../testdata/csharp/csharp_library.baseline | 224 ++++++-- ...amplegen_config_migration_library.baseline | 224 ++++++-- .../testdata/csharp_library.baseline | 527 +++++------------- 4 files changed, 492 insertions(+), 495 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index 9e93b00d22..4a85729fea 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -132,6 +132,11 @@ private List generateMethods(InterfaceContext co } else if (methodContext.isLongRunningMethodContext()) { if (methodConfig.isFlattening()) { ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); + flatteningGroups = + flatteningGroups + .stream() + .filter(f -> !FlatteningConfig.hasAnyResourceNameParameter(f)) + .collect(ImmutableList.toImmutableList()); boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { FlatteningConfig flatteningGroup = flatteningGroups.get(i); @@ -147,6 +152,11 @@ private List generateMethods(InterfaceContext co } else if (methodConfig.isPageStreaming()) { if (methodConfig.isFlattening()) { ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); + flatteningGroups = + flatteningGroups + .stream() + .filter(f -> !FlatteningConfig.hasAnyResourceNameParameter(f)) + .collect(ImmutableList.toImmutableList()); // Find flattenings that have ambiguous parameters, and mark them to use named arguments. // Ambiguity occurs in a page-stream flattening that has one or two extra string // parameters (that are not resource-names) compared to any other flattening of this same @@ -206,7 +216,7 @@ private List generateMethods(InterfaceContext co flatteningGroups = flatteningGroups .stream() - .filter(FlatteningConfig::hasAnyResourceNameParameter) + .filter(f -> !FlatteningConfig.hasAnyResourceNameParameter(f)) .collect(ImmutableList.toImmutableList()); boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index dea3aab165..b867b7fab7 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -4850,6 +4850,33 @@ namespace Google.Example.Library.V1.Snippets /// Generated snippets public class GeneratedLibraryServiceClientSnippets { + /// Snippet for CreateShelfAsync + public async Task CreateShelfAsync() + { + // Snippet: CreateShelfAsync(Shelf,CallSettings) + // Additional: CreateShelfAsync(Shelf,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + // Make the request + Shelf response = await libraryServiceClient.CreateShelfAsync(shelf); + // End snippet + } + + /// Snippet for CreateShelf + public void CreateShelf() + { + // Snippet: CreateShelf(Shelf,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + // Make the request + Shelf response = libraryServiceClient.CreateShelf(shelf); + // End snippet + } + /// Snippet for CreateShelfAsync public async Task CreateShelfAsync_RequestObject() { @@ -4886,8 +4913,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync1() { - // Snippet: GetShelfAsync(ShelfName,CallSettings) - // Additional: GetShelfAsync(ShelfName,CancellationToken) + // Snippet: GetShelfAsync(string,CallSettings) + // Additional: GetShelfAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4900,7 +4927,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf1() { - // Snippet: GetShelf(ShelfName,CallSettings) + // Snippet: GetShelf(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -4913,8 +4940,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() { - // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) - // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) + // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4928,7 +4955,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf2() { - // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) + // Snippet: GetShelf(string,SomeMessage,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -4942,8 +4969,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync3() { - // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) + // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4958,7 +4985,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf3() { - // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5180,8 +5207,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync() { - // Snippet: DeleteShelfAsync(ShelfName,CallSettings) - // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Snippet: DeleteShelfAsync(string,CallSettings) + // Additional: DeleteShelfAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5194,7 +5221,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteShelf public void DeleteShelf() { - // Snippet: DeleteShelf(ShelfName,CallSettings) + // Snippet: DeleteShelf(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5240,8 +5267,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync() { - // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) - // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) + // Snippet: MergeShelvesAsync(string,string,CallSettings) + // Additional: MergeShelvesAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5255,7 +5282,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MergeShelves public void MergeShelves() { - // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) + // Snippet: MergeShelves(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5304,8 +5331,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for CreateBookAsync public async Task CreateBookAsync() { - // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) - // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) + // Snippet: CreateBookAsync(string,Book,CallSettings) + // Additional: CreateBookAsync(string,Book,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5319,7 +5346,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for CreateBook public void CreateBook() { - // Snippet: CreateBook(ShelfName,Book,CallSettings) + // Snippet: CreateBook(string,Book,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5365,6 +5392,45 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for PublishSeriesAsync + public async Task PublishSeriesAsync() + { + // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) + // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + // Make the request + PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid); + // End snippet + } + + /// Snippet for PublishSeries + public void PublishSeries() + { + // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + // Make the request + PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid); + // End snippet + } + /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -5411,8 +5477,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookAsync public async Task GetBookAsync() { - // Snippet: GetBookAsync(BookName,CallSettings) - // Additional: GetBookAsync(BookName,CancellationToken) + // Snippet: GetBookAsync(string,CallSettings) + // Additional: GetBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5425,7 +5491,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBook public void GetBook() { - // Snippet: GetBook(BookName,CallSettings) + // Snippet: GetBook(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5747,8 +5813,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteBookAsync public async Task DeleteBookAsync() { - // Snippet: DeleteBookAsync(BookName,CallSettings) - // Additional: DeleteBookAsync(BookName,CancellationToken) + // Snippet: DeleteBookAsync(string,CallSettings) + // Additional: DeleteBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5761,7 +5827,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteBook public void DeleteBook() { - // Snippet: DeleteBook(BookName,CallSettings) + // Snippet: DeleteBook(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5807,8 +5873,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync1() { - // Snippet: UpdateBookAsync(BookName,Book,CallSettings) - // Additional: UpdateBookAsync(BookName,Book,CancellationToken) + // Snippet: UpdateBookAsync(string,Book,CallSettings) + // Additional: UpdateBookAsync(string,Book,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5822,7 +5888,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBook public void UpdateBook1() { - // Snippet: UpdateBook(BookName,Book,CallSettings) + // Snippet: UpdateBook(string,Book,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5836,8 +5902,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() { - // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5854,7 +5920,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBook public void UpdateBook2() { - // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5906,8 +5972,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MoveBookAsync public async Task MoveBookAsync() { - // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) - // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) + // Snippet: MoveBookAsync(string,string,CallSettings) + // Additional: MoveBookAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5921,7 +5987,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MoveBook public void MoveBook() { - // Snippet: MoveBook(BookName,ShelfName,CallSettings) + // Snippet: MoveBook(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6318,8 +6384,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for AddCommentsAsync public async Task AddCommentsAsync() { - // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6341,7 +6407,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for AddComments public void AddComments() { - // Snippet: AddComments(BookName,IEnumerable,CallSettings) + // Snippet: AddComments(string,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6414,8 +6480,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync() { - // Snippet: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CallSettings) - // Additional: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CancellationToken) + // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) + // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6429,7 +6495,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromArchive public void GetBookFromArchive() { - // Snippet: GetBookFromArchive(ArchivedBookName,LocationParentNameOneof,CallSettings) + // Snippet: GetBookFromArchive(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6478,8 +6544,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync() { - // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CallSettings) - // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CancellationToken) + // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) + // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6495,7 +6561,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAnywhere public void GetBookFromAnywhere() { - // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,LocationName,FolderName,CallSettings) + // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6550,8 +6616,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync() { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) + // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6564,7 +6630,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAbsolutelyAnywhere public void GetBookFromAbsolutelyAnywhere() { - // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) + // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6610,8 +6676,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync() { - // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) + // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6629,7 +6695,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookIndex public void UpdateBookIndex() { - // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) + // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6981,6 +7047,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for AddLabelAsync + public async Task AddLabelAsync() + { + // Snippet: AddLabelAsync(string,string,CallSettings) + // Additional: AddLabelAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); + string label = ""; + // Make the request + AddLabelResponse response = await libraryServiceClient.AddLabelAsync(formattedResource, label); + // End snippet + } + + /// Snippet for AddLabel + public void AddLabel() + { + // Snippet: AddLabel(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); + string label = ""; + // Make the request + AddLabelResponse response = libraryServiceClient.AddLabel(formattedResource, label); + // End snippet + } + /// Snippet for AddLabelAsync public async Task AddLabelAsync_RequestObject() { @@ -7405,10 +7500,33 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync() + public async Task TestOptionalRequiredFlatteningParamsAsync1() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams1() + { + // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync2() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -7540,9 +7658,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams() + public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index d6ec901d7f..3e98b081b6 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -1687,6 +1687,33 @@ namespace Google.Example.Library.V1.Snippets /// Generated snippets public class GeneratedLibraryServiceClientSnippets { + /// Snippet for CreateShelfAsync + public async Task CreateShelfAsync() + { + // Snippet: CreateShelfAsync(Shelf,CallSettings) + // Additional: CreateShelfAsync(Shelf,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + // Make the request + Shelf response = await libraryServiceClient.CreateShelfAsync(shelf); + // End snippet + } + + /// Snippet for CreateShelf + public void CreateShelf() + { + // Snippet: CreateShelf(Shelf,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + // Make the request + Shelf response = libraryServiceClient.CreateShelf(shelf); + // End snippet + } + /// Snippet for CreateShelfAsync public async Task CreateShelfAsync_RequestObject() { @@ -1723,8 +1750,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync1() { - // Snippet: GetShelfAsync(ShelfName,CallSettings) - // Additional: GetShelfAsync(ShelfName,CancellationToken) + // Snippet: GetShelfAsync(string,CallSettings) + // Additional: GetShelfAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -1737,7 +1764,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf1() { - // Snippet: GetShelf(ShelfName,CallSettings) + // Snippet: GetShelf(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -1750,8 +1777,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() { - // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) - // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) + // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -1765,7 +1792,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf2() { - // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) + // Snippet: GetShelf(string,SomeMessage,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -1779,8 +1806,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync3() { - // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) + // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -1795,7 +1822,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf3() { - // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2017,8 +2044,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync() { - // Snippet: DeleteShelfAsync(ShelfName,CallSettings) - // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Snippet: DeleteShelfAsync(string,CallSettings) + // Additional: DeleteShelfAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2031,7 +2058,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteShelf public void DeleteShelf() { - // Snippet: DeleteShelf(ShelfName,CallSettings) + // Snippet: DeleteShelf(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2077,8 +2104,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync() { - // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) - // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) + // Snippet: MergeShelvesAsync(string,string,CallSettings) + // Additional: MergeShelvesAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2092,7 +2119,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MergeShelves public void MergeShelves() { - // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) + // Snippet: MergeShelves(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2141,8 +2168,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for CreateBookAsync public async Task CreateBookAsync() { - // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) - // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) + // Snippet: CreateBookAsync(string,Book,CallSettings) + // Additional: CreateBookAsync(string,Book,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2156,7 +2183,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for CreateBook public void CreateBook() { - // Snippet: CreateBook(ShelfName,Book,CallSettings) + // Snippet: CreateBook(string,Book,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2202,6 +2229,45 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for PublishSeriesAsync + public async Task PublishSeriesAsync() + { + // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) + // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + // Make the request + PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid); + // End snippet + } + + /// Snippet for PublishSeries + public void PublishSeries() + { + // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + // Make the request + PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid); + // End snippet + } + /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -2248,8 +2314,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookAsync public async Task GetBookAsync() { - // Snippet: GetBookAsync(BookName,CallSettings) - // Additional: GetBookAsync(BookName,CancellationToken) + // Snippet: GetBookAsync(string,CallSettings) + // Additional: GetBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2262,7 +2328,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBook public void GetBook() { - // Snippet: GetBook(BookName,CallSettings) + // Snippet: GetBook(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2584,8 +2650,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteBookAsync public async Task DeleteBookAsync() { - // Snippet: DeleteBookAsync(BookName,CallSettings) - // Additional: DeleteBookAsync(BookName,CancellationToken) + // Snippet: DeleteBookAsync(string,CallSettings) + // Additional: DeleteBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2598,7 +2664,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteBook public void DeleteBook() { - // Snippet: DeleteBook(BookName,CallSettings) + // Snippet: DeleteBook(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2644,8 +2710,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync1() { - // Snippet: UpdateBookAsync(BookName,Book,CallSettings) - // Additional: UpdateBookAsync(BookName,Book,CancellationToken) + // Snippet: UpdateBookAsync(string,Book,CallSettings) + // Additional: UpdateBookAsync(string,Book,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2659,7 +2725,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBook public void UpdateBook1() { - // Snippet: UpdateBook(BookName,Book,CallSettings) + // Snippet: UpdateBook(string,Book,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2673,8 +2739,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() { - // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2691,7 +2757,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBook public void UpdateBook2() { - // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2743,8 +2809,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MoveBookAsync public async Task MoveBookAsync() { - // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) - // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) + // Snippet: MoveBookAsync(string,string,CallSettings) + // Additional: MoveBookAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2758,7 +2824,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MoveBook public void MoveBook() { - // Snippet: MoveBook(BookName,ShelfName,CallSettings) + // Snippet: MoveBook(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3155,8 +3221,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for AddCommentsAsync public async Task AddCommentsAsync() { - // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3178,7 +3244,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for AddComments public void AddComments() { - // Snippet: AddComments(BookName,IEnumerable,CallSettings) + // Snippet: AddComments(string,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3251,8 +3317,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync() { - // Snippet: GetBookFromArchiveAsync(ArchivedBookName,CallSettings) - // Additional: GetBookFromArchiveAsync(ArchivedBookName,CancellationToken) + // Snippet: GetBookFromArchiveAsync(string,CallSettings) + // Additional: GetBookFromArchiveAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3265,7 +3331,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromArchive public void GetBookFromArchive() { - // Snippet: GetBookFromArchive(ArchivedBookName,CallSettings) + // Snippet: GetBookFromArchive(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3311,8 +3377,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync() { - // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,CallSettings) - // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,CancellationToken) + // Snippet: GetBookFromAnywhereAsync(string,string,CallSettings) + // Additional: GetBookFromAnywhereAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3326,7 +3392,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAnywhere public void GetBookFromAnywhere() { - // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,CallSettings) + // Snippet: GetBookFromAnywhere(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3375,8 +3441,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync() { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) + // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3389,7 +3455,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAbsolutelyAnywhere public void GetBookFromAbsolutelyAnywhere() { - // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) + // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3435,8 +3501,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync() { - // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) + // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3454,7 +3520,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookIndex public void UpdateBookIndex() { - // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) + // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3806,6 +3872,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for AddLabelAsync + public async Task AddLabelAsync() + { + // Snippet: AddLabelAsync(string,string,CallSettings) + // Additional: AddLabelAsync(string,string,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); + string label = ""; + // Make the request + AddLabelResponse response = await libraryServiceClient.AddLabelAsync(formattedResource, label); + // End snippet + } + + /// Snippet for AddLabel + public void AddLabel() + { + // Snippet: AddLabel(string,string,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + string formattedResource = new BookName("[SHELF]", "[BOOK]").ToString(); + string label = ""; + // Make the request + AddLabelResponse response = libraryServiceClient.AddLabel(formattedResource, label); + // End snippet + } + /// Snippet for AddLabelAsync public async Task AddLabelAsync_RequestObject() { @@ -4230,10 +4325,33 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync() + public async Task TestOptionalRequiredFlatteningParamsAsync1() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams1() + { + // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync2() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4333,9 +4451,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams() + public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index 6bdd818655..90bb1f186d 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -4891,6 +4891,33 @@ namespace Google.Example.Library.V1.Snippets /// Generated snippets public class GeneratedLibraryServiceClientSnippets { + /// Snippet for CreateShelfAsync + public async Task CreateShelfAsync() + { + // Snippet: CreateShelfAsync(Shelf,CallSettings) + // Additional: CreateShelfAsync(Shelf,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + // Make the request + Shelf response = await libraryServiceClient.CreateShelfAsync(shelf); + // End snippet + } + + /// Snippet for CreateShelf + public void CreateShelf() + { + // Snippet: CreateShelf(Shelf,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + // Make the request + Shelf response = libraryServiceClient.CreateShelf(shelf); + // End snippet + } + /// Snippet for CreateShelfAsync public async Task CreateShelfAsync_RequestObject() { @@ -4927,8 +4954,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync1() { - // Snippet: GetShelfAsync(ShelfName,CallSettings) - // Additional: GetShelfAsync(ShelfName,CancellationToken) + // Snippet: GetShelfAsync(string,CallSettings) + // Additional: GetShelfAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4941,7 +4968,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf1() { - // Snippet: GetShelf(ShelfName,CallSettings) + // Snippet: GetShelf(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -4954,8 +4981,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync2() { - // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) - // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) + // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4969,7 +4996,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf2() { - // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) + // Snippet: GetShelf(string,SomeMessage,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -4983,8 +5010,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelfAsync public async Task GetShelfAsync3() { - // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) + // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -4999,7 +5026,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetShelf public void GetShelf3() { - // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5221,8 +5248,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync() { - // Snippet: DeleteShelfAsync(ShelfName,CallSettings) - // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Snippet: DeleteShelfAsync(string,CallSettings) + // Additional: DeleteShelfAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5235,7 +5262,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteShelf public void DeleteShelf() { - // Snippet: DeleteShelf(ShelfName,CallSettings) + // Snippet: DeleteShelf(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5281,8 +5308,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync() { - // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) - // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) + // Snippet: MergeShelvesAsync(string,string,CallSettings) + // Additional: MergeShelvesAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5296,7 +5323,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MergeShelves public void MergeShelves() { - // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) + // Snippet: MergeShelves(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5345,8 +5372,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for CreateBookAsync public async Task CreateBookAsync() { - // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) - // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) + // Snippet: CreateBookAsync(string,Book,CallSettings) + // Additional: CreateBookAsync(string,Book,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5360,7 +5387,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for CreateBook public void CreateBook() { - // Snippet: CreateBook(ShelfName,Book,CallSettings) + // Snippet: CreateBook(string,Book,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5409,8 +5436,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync() { - // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) - // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CancellationToken) + // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) + // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5430,7 +5457,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for PublishSeries public void PublishSeries() { - // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) + // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5493,8 +5520,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookAsync public async Task GetBookAsync() { - // Snippet: GetBookAsync(BookNameOneof,CallSettings) - // Additional: GetBookAsync(BookNameOneof,CancellationToken) + // Snippet: GetBookAsync(string,CallSettings) + // Additional: GetBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5507,7 +5534,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBook public void GetBook() { - // Snippet: GetBook(BookNameOneof,CallSettings) + // Snippet: GetBook(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5829,8 +5856,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteBookAsync public async Task DeleteBookAsync() { - // Snippet: DeleteBookAsync(BookNameOneof,CallSettings) - // Additional: DeleteBookAsync(BookNameOneof,CancellationToken) + // Snippet: DeleteBookAsync(string,CallSettings) + // Additional: DeleteBookAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5843,7 +5870,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for DeleteBook public void DeleteBook() { - // Snippet: DeleteBook(BookNameOneof,CallSettings) + // Snippet: DeleteBook(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5889,8 +5916,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync1() { - // Snippet: UpdateBookAsync(BookNameOneof,Book,CallSettings) - // Additional: UpdateBookAsync(BookNameOneof,Book,CancellationToken) + // Snippet: UpdateBookAsync(string,Book,CallSettings) + // Additional: UpdateBookAsync(string,Book,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5904,7 +5931,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBook public void UpdateBook1() { - // Snippet: UpdateBook(BookNameOneof,Book,CallSettings) + // Snippet: UpdateBook(string,Book,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5918,8 +5945,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookAsync public async Task UpdateBookAsync2() { - // Snippet: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5936,7 +5963,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBook public void UpdateBook2() { - // Snippet: UpdateBook(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -5988,8 +6015,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MoveBookAsync public async Task MoveBookAsync() { - // Snippet: MoveBookAsync(BookNameOneof,ShelfName,CallSettings) - // Additional: MoveBookAsync(BookNameOneof,ShelfName,CancellationToken) + // Snippet: MoveBookAsync(string,string,CallSettings) + // Additional: MoveBookAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6003,7 +6030,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for MoveBook public void MoveBook() { - // Snippet: MoveBook(BookNameOneof,ShelfName,CallSettings) + // Snippet: MoveBook(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6400,8 +6427,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for AddCommentsAsync public async Task AddCommentsAsync() { - // Snippet: AddCommentsAsync(BookNameOneof,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(BookNameOneof,IEnumerable,CancellationToken) + // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6423,7 +6450,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for AddComments public void AddComments() { - // Snippet: AddComments(BookNameOneof,IEnumerable,CallSettings) + // Snippet: AddComments(string,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6496,8 +6523,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync() { - // Snippet: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CallSettings) - // Additional: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CancellationToken) + // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) + // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6511,7 +6538,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromArchive public void GetBookFromArchive() { - // Snippet: GetBookFromArchive(ArchivedBookName,ProjectName,CallSettings) + // Snippet: GetBookFromArchive(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6560,8 +6587,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync() { - // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) - // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CancellationToken) + // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) + // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6577,7 +6604,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAnywhere public void GetBookFromAnywhere() { - // Snippet: GetBookFromAnywhere(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) + // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6632,8 +6659,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync() { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) + // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6646,7 +6673,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for GetBookFromAbsolutelyAnywhere public void GetBookFromAbsolutelyAnywhere() { - // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) + // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6692,8 +6719,8 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync() { - // Snippet: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CancellationToken) + // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6711,7 +6738,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for UpdateBookIndex public void UpdateBookIndex() { - // Snippet: UpdateBookIndex(BookNameOneof,string,IDictionary,CallSettings) + // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -7487,10 +7514,33 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync() + public async Task TestOptionalRequiredFlatteningParamsAsync1() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams1() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync2() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -7622,9 +7672,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams() + public void TestOptionalRequiredFlatteningParams2() { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -7909,10 +7959,10 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync1() + public async Task MoveBooksAsync() { - // Snippet: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CancellationToken) + // Snippet: MoveBooksAsync(string,string,IEnumerable,string,CallSettings) + // Additional: MoveBooksAsync(string,string,IEnumerable,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -7926,211 +7976,13 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBooks - public void MoveBooks1() - { - // Snippet: MoveBooks(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync2() - { - // Snippet: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks2() - { - // Snippet: MoveBooks(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync3() - { - // Snippet: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks3() + public void MoveBooks() { - // Snippet: MoveBooks(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Snippet: MoveBooks(string,string,IEnumerable,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) ArchiveName source = new ArchiveName("[ARCHIVE]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync4() - { - // Snippet: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks4() - { - // Snippet: MoveBooks(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync5() - { - // Snippet: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks5() - { - // Snippet: MoveBooks(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync6() - { - // Snippet: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks6() - { - // Snippet: MoveBooks(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync7() - { - // Snippet: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks7() - { - // Snippet: MoveBooks(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); ArchiveName destination = new ArchiveName("[ARCHIVE]"); IEnumerable publishers = new List(); ProjectName project = new ProjectName("[PROJECT]"); @@ -8139,72 +7991,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync8() - { - // Snippet: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks8() - { - // Snippet: MoveBooks(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync9() - { - // Snippet: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks9() - { - // Snippet: MoveBooks(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - /// Snippet for MoveBooksAsync public async Task MoveBooksAsync_RequestObject() { @@ -8233,10 +8019,10 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync1() + public async Task ArchiveBooksAsync() { - // Snippet: ArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) - // Additional: ArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) + // Snippet: ArchiveBooksAsync(string,string,CallSettings) + // Additional: ArchiveBooksAsync(string,string,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -8248,9 +8034,9 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ArchiveBooks - public void ArchiveBooks1() + public void ArchiveBooks() { - // Snippet: ArchiveBooks(ArchiveName,ArchiveName,CallSettings) + // Snippet: ArchiveBooks(string,string,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -8261,64 +8047,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync2() - { - // Snippet: ArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) - // Additional: ArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooks - public void ArchiveBooks2() - { - // Snippet: ArchiveBooks(ShelfName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync3() - { - // Snippet: ArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) - // Additional: ArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooks - public void ArchiveBooks3() - { - // Snippet: ArchiveBooks(ProjectName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); - // End snippet - } - /// Snippet for ArchiveBooksAsync public async Task ArchiveBooksAsync_RequestObject() { @@ -8721,6 +8449,29 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for PrivateListShelvesAsync + public async Task PrivateListShelvesAsync() + { + // Snippet: PrivateListShelvesAsync(CallSettings) + // Additional: PrivateListShelvesAsync(CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Make the request + Book response = await libraryServiceClient.PrivateListShelvesAsync(); + // End snippet + } + + /// Snippet for PrivateListShelves + public void PrivateListShelves() + { + // Snippet: PrivateListShelves(CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Make the request + Book response = libraryServiceClient.PrivateListShelves(); + // End snippet + } + /// Snippet for PrivateListShelvesAsync public async Task PrivateListShelvesAsync_RequestObject() { From 6452ad50af9a7f1bb79d331c43b7ccb9c9d5e67b Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 13:39:25 +0800 Subject: [PATCH 26/36] twice more... --- .../testdata/csharp/csharp_library.baseline | 318 +---------- ...amplegen_config_migration_library.baseline | 318 +---------- .../testdata/csharp_library.baseline | 523 +----------------- 3 files changed, 23 insertions(+), 1136 deletions(-) diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index b867b7fab7..28613007bd 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -5535,97 +5535,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync1() - { - // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Book item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooks - public void ListBooks1() - { - // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedEnumerable response = - libraryServiceClient.ListBooks(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Book item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooksAsync - public async Task ListBooksAsync2() + public async Task ListBooksAsync() { // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) // Create client @@ -5670,7 +5580,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks2() + public void ListBooks() { // Snippet: ListBooks(string,string,string,int?,CallSettings) // Create client @@ -6119,94 +6029,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStringsAsync public async Task ListStringsAsync2() - { - // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(name); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings2() - { - // Snippet: ListStrings(IResourceName,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(name); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStringsAsync - public async Task ListStringsAsync3() { // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client @@ -6250,7 +6072,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings3() + public void ListStrings2() { // Snippet: ListStrings(string,string,int?,CallSettings) // Create client @@ -7112,72 +6934,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync1() - { - // Snippet: GetBigBookAsync(BookName,CallSettings) - // Additional: GetBigBookAsync(BookName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - await libraryServiceClient.GetBigBookAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigBookAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBook - public void GetBigBook1() - { - // Snippet: GetBigBook(BookName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - libraryServiceClient.GetBigBook(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigBook(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync2() + public async Task GetBigBookAsync() { // Snippet: GetBigBookAsync(string,CallSettings) // Additional: GetBigBookAsync(string,CancellationToken) @@ -7210,7 +6967,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook2() + public void GetBigBook() { // Snippet: GetBigBook(string,CallSettings) // Create client @@ -7312,68 +7069,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync1() - { - // Snippet: GetBigNothingAsync(BookName,CallSettings) - // Additional: GetBigNothingAsync(BookName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - await libraryServiceClient.GetBigNothingAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothing - public void GetBigNothing1() - { - // Snippet: GetBigNothing(BookName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - libraryServiceClient.GetBigNothing(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigNothing(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync2() + public async Task GetBigNothingAsync() { // Snippet: GetBigNothingAsync(string,CallSettings) // Additional: GetBigNothingAsync(string,CancellationToken) @@ -7404,7 +7100,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing2() + public void GetBigNothing() { // Snippet: GetBigNothing(string,CallSettings) // Create client diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 3e98b081b6..d69df0eb31 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -2372,97 +2372,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync1() - { - // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Book item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooks - public void ListBooks1() - { - // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedEnumerable response = - libraryServiceClient.ListBooks(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Book item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooksAsync - public async Task ListBooksAsync2() + public async Task ListBooksAsync() { // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) // Create client @@ -2507,7 +2417,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks2() + public void ListBooks() { // Snippet: ListBooks(string,string,string,int?,CallSettings) // Create client @@ -2956,94 +2866,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStringsAsync public async Task ListStringsAsync2() - { - // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(name); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings2() - { - // Snippet: ListStrings(IResourceName,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IResourceName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(name); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStringsAsync - public async Task ListStringsAsync3() { // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client @@ -3087,7 +2909,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings3() + public void ListStrings2() { // Snippet: ListStrings(string,string,int?,CallSettings) // Create client @@ -3937,72 +3759,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync1() - { - // Snippet: GetBigBookAsync(BookName,CallSettings) - // Additional: GetBigBookAsync(BookName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - await libraryServiceClient.GetBigBookAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigBookAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBook - public void GetBigBook1() - { - // Snippet: GetBigBook(BookName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - libraryServiceClient.GetBigBook(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigBook(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync2() + public async Task GetBigBookAsync() { // Snippet: GetBigBookAsync(string,CallSettings) // Additional: GetBigBookAsync(string,CancellationToken) @@ -4035,7 +3792,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook2() + public void GetBigBook() { // Snippet: GetBigBook(string,CallSettings) // Create client @@ -4137,68 +3894,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync1() - { - // Snippet: GetBigNothingAsync(BookName,CallSettings) - // Additional: GetBigNothingAsync(BookName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - await libraryServiceClient.GetBigNothingAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothing - public void GetBigNothing1() - { - // Snippet: GetBigNothing(BookName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - libraryServiceClient.GetBigNothing(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigNothing(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync2() + public async Task GetBigNothingAsync() { // Snippet: GetBigNothingAsync(string,CallSettings) // Additional: GetBigNothingAsync(string,CancellationToken) @@ -4229,7 +3925,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing2() + public void GetBigNothing() { // Snippet: GetBigNothing(string,CallSettings) // Create client diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index 90bb1f186d..0754fa22f1 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -5578,97 +5578,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooksAsync - public async Task ListBooksAsync1() - { - // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListBooksAsync(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((Book item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListBooksResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooks - public void ListBooks1() - { - // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - string filter = "book-filter-string"; - // Make the request - PagedEnumerable response = - libraryServiceClient.ListBooks(name, filter); - - // Iterate over all response items, lazily performing RPCs as required - foreach (Book item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListBooksResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (Book item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (Book item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListBooksAsync - public async Task ListBooksAsync2() + public async Task ListBooksAsync() { // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) // Create client @@ -5713,7 +5623,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListBooks - public void ListBooks2() + public void ListBooks() { // Snippet: ListBooks(string,string,string,int?,CallSettings) // Create client @@ -6162,94 +6072,6 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStringsAsync public async Task ListStringsAsync2() - { - // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - IResourceName name = new ArchiveName("[ARCHIVE]"); - // Make the request - PagedAsyncEnumerable response = - libraryServiceClient.ListStringsAsync(name); - - // Iterate over all response items, lazily performing RPCs as required - await response.ForEachAsync((IResourceName item) => - { - // Do something with each item - Console.WriteLine(item); - }); - - // Or iterate over pages (of server-defined size), performing one RPC per page - await response.AsRawResponses().ForEachAsync((ListStringsResponse page) => - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - }); - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = await response.ReadPageAsync(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStrings - public void ListStrings2() - { - // Snippet: ListStrings(IResourceName,string,int?,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - IResourceName name = new ArchiveName("[ARCHIVE]"); - // Make the request - PagedEnumerable response = - libraryServiceClient.ListStrings(name); - - // Iterate over all response items, lazily performing RPCs as required - foreach (IResourceName item in response) - { - // Do something with each item - Console.WriteLine(item); - } - - // Or iterate over pages (of server-defined size), performing one RPC per page - foreach (ListStringsResponse page in response.AsRawResponses()) - { - // Do something with each page of items - Console.WriteLine("A page of results:"); - foreach (IResourceName item in page) - { - Console.WriteLine(item); - } - } - - // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required - int pageSize = 10; - Page singlePage = response.ReadPage(pageSize); - // Do something with the page of items - Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); - foreach (IResourceName item in singlePage) - { - Console.WriteLine(item); - } - // Store the pageToken, for when the next page is required. - string nextPageToken = singlePage.NextPageToken; - // End snippet - } - - /// Snippet for ListStringsAsync - public async Task ListStringsAsync3() { // Snippet: ListStringsAsync(string,string,int?,CallSettings) // Create client @@ -6293,7 +6115,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ListStrings - public void ListStrings3() + public void ListStrings2() { // Snippet: ListStrings(string,string,int?,CallSettings) // Create client @@ -7126,72 +6948,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync1() - { - // Snippet: GetBigBookAsync(BookNameOneof,CallSettings) - // Additional: GetBigBookAsync(BookNameOneof,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Operation response = - await libraryServiceClient.GetBigBookAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigBookAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBook - public void GetBigBook1() - { - // Snippet: GetBigBook(BookNameOneof,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Operation response = - libraryServiceClient.GetBigBook(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigBook(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync2() + public async Task GetBigBookAsync() { // Snippet: GetBigBookAsync(string,CallSettings) // Additional: GetBigBookAsync(string,CancellationToken) @@ -7224,7 +6981,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook2() + public void GetBigBook() { // Snippet: GetBigBook(string,CallSettings) // Create client @@ -7326,68 +7083,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync1() - { - // Snippet: GetBigNothingAsync(BookNameOneof,CallSettings) - // Additional: GetBigNothingAsync(BookNameOneof,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Operation response = - await libraryServiceClient.GetBigNothingAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothing - public void GetBigNothing1() - { - // Snippet: GetBigNothing(BookNameOneof,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Operation response = - libraryServiceClient.GetBigNothing(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigNothing(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync2() + public async Task GetBigNothingAsync() { // Snippet: GetBigNothingAsync(string,CallSettings) // Additional: GetBigNothingAsync(string,CancellationToken) @@ -7418,7 +7114,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing2() + public void GetBigNothing() { // Snippet: GetBigNothing(string,CallSettings) // Create client @@ -8075,208 +7771,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync1() - { - // Snippet: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) - // Additional: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks1() - { - // Snippet: LongRunningArchiveBooks(ArchiveName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync2() - { - // Snippet: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) - // Additional: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks2() - { - // Snippet: LongRunningArchiveBooks(ShelfName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync3() - { - // Snippet: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) - // Additional: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks3() - { - // Snippet: LongRunningArchiveBooks(ProjectName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync4() + public async Task LongRunningArchiveBooksAsync() { // Snippet: LongRunningArchiveBooksAsync(string,string,CallSettings) // Additional: LongRunningArchiveBooksAsync(string,string,CancellationToken) @@ -8310,7 +7805,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks4() + public void LongRunningArchiveBooks() { // Snippet: LongRunningArchiveBooks(string,string,CallSettings) // Create client From 725a63baf3ecd0b9affffc477b8828e4a2a82d99 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 13:51:51 +0800 Subject: [PATCH 27/36] thrice more --- .../csharp/CSharpApiMethodTransformer.java | 20 - .../testdata/csharp/csharp_library.baseline | 3834 +---------- ...amplegen_config_migration_library.baseline | 3215 +-------- .../testdata/csharp_library.baseline | 5921 ++--------------- 4 files changed, 900 insertions(+), 12090 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpApiMethodTransformer.java index f5f6ab5cfb..875da7f8e3 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpApiMethodTransformer.java @@ -145,13 +145,6 @@ public List generateApiMethods(InterfaceContext interfa apiMethods.add( generateGrpcStreamingFlattenedMethod( methodContext, csharpCommonTransformer.callSettingsParam(), null)); - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - apiMethods.add( - generateGrpcStreamingFlattenedMethod( - methodContext.withResourceNamesInSamplesOnly(), - csharpCommonTransformer.callSettingsParam(), - null)); - } } } requestMethodContext = @@ -167,10 +160,6 @@ public List generateApiMethods(InterfaceContext interfa GapicMethodContext methodContext = context.asFlattenedMethodContext(requestMethodContext, flatteningGroup); apiMethods.addAll(generateFlattenedLroMethods(methodContext)); - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - apiMethods.addAll( - generateFlattenedLroMethods(methodContext.withResourceNamesInSamplesOnly())); - } } } apiMethods.add( @@ -195,11 +184,6 @@ public List generateApiMethods(InterfaceContext interfa context.asFlattenedMethodContext(requestMethodContext, flatteningGroup); apiMethods.addAll( generatePageStreamingFlattenedMethods(methodContext, pagedMethodAdditionalParams)); - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - apiMethods.addAll( - generatePageStreamingFlattenedMethods( - methodContext.withResourceNamesInSamplesOnly(), pagedMethodAdditionalParams)); - } } } apiMethods.add( @@ -228,10 +212,6 @@ public List generateApiMethods(InterfaceContext interfa GapicMethodContext methodContext = context.asFlattenedMethodContext(requestMethodContext, flatteningGroup); apiMethods.addAll(generateNormalFlattenedMethods(methodContext)); - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - apiMethods.addAll( - generateNormalFlattenedMethods(methodContext.withResourceNamesInSamplesOnly())); - } } } apiMethods.add( diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 28613007bd..853f9f9da9 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -12336,66 +12336,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Gets a shelf. /// @@ -12546,81 +12486,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - /// /// Gets a shelf. /// @@ -12801,96 +12666,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - stringBuilder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - /// /// Gets a shelf. /// @@ -13158,8 +12933,8 @@ namespace Google.Example.Library.V1 /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -13168,19 +12943,17 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + DeleteShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -13189,71 +12962,16 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteShelfAsync( - string name, + DeleteShelfRequest request, st::CancellationToken cancellationToken) => DeleteShelfAsync( - name, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void DeleteShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelf( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - st::CancellationToken cancellationToken) => DeleteShelfAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -13427,87 +13145,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MergeShelvesAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf MergeShelves( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelves( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - /// /// Merges two shelves by adding all books from the shelf named /// `other_shelf_name` to shelf `name`, and deletes @@ -13720,81 +13357,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - st::CancellationToken cancellationToken) => CreateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book CreateBook( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBook( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - /// /// Creates a book. /// @@ -14135,8 +13697,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -14145,19 +13707,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Gets a book. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -14166,16 +13726,16 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookAsync( - string name, + GetBookRequest request, st::CancellationToken cancellationToken) => GetBookAsync( - name, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -14184,75 +13744,17 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book GetBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// - /// Gets a book. + /// Lists books in a shelf. /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - GetBookRequest request, - st::CancellationToken cancellationToken) => GetBookAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book GetBook( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// The name of the shelf whose books we'd like to list. /// /// /// To test python built-in wrapping. @@ -14400,82 +13902,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. - /// - /// - /// To test python built-in wrapping. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListBooksAsync( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( - new ListBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. - /// - /// - /// To test python built-in wrapping. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListBooks( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooks( - new ListBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - /// /// Lists books in a shelf. /// @@ -14628,63 +14054,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - string name, - st::CancellationToken cancellationToken) => DeleteBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void DeleteBook( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBook( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Deletes a book. /// @@ -14894,9 +14263,18 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// + /// + /// An optional foo. + /// /// /// The book to update with. /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// /// /// If not null, applies overrides to this RPC call. /// @@ -14904,13 +14282,19 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, + string optionalFoo, Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional }, callSettings); @@ -14920,9 +14304,18 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// + /// + /// An optional foo. + /// /// /// The book to update with. /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// /// /// A to use for this RPC. /// @@ -14930,11 +14323,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, + string optionalFoo, Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, st::CancellationToken cancellationToken) => UpdateBookAsync( name, + optionalFoo, book, + updateMask, + physicalMask, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -14943,9 +14342,18 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// + /// + /// An optional foo. + /// /// /// The book to update with. /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// /// /// If not null, applies overrides to this RPC call. /// @@ -14953,13 +14361,19 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book UpdateBook( - string name, + BookName name, + string optionalFoo, Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBook( new UpdateBookRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional }, callSettings); @@ -14988,7 +14402,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, + string name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -14996,7 +14410,7 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), UpdateMask = updateMask, // Optional @@ -15029,7 +14443,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, + string name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -15067,7 +14481,7 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book UpdateBook( - BookName name, + string name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -15075,7 +14489,7 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings callSettings = null) => UpdateBook( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), UpdateMask = updateMask, // Optional @@ -15086,248 +14500,8 @@ namespace Google.Example.Library.V1 /// /// Updates a book. /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - optionalFoo, - book, - updateMask, - physicalMask, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - optionalFoo, - book, - updateMask, - physicalMask, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -15532,83 +14706,8 @@ namespace Google.Example.Library.V1 /// /// Moves a book to another shelf, and returns the new book. /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MoveBookAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book MoveBook( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBook( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -15848,72 +14947,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListStrings( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStrings( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - /// /// Lists a primitive resource. To test go page streaming. /// @@ -16096,78 +15129,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - st::CancellationToken cancellationToken) => AddCommentsAsync( - name, - comments, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void AddComments( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddComments( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - /// /// Adds comments to a book /// @@ -16374,11 +15335,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -16387,24 +15345,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - string name, - string parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), - }, - callSettings); + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -16413,21 +15364,16 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - string name, - string parent, + GetBookFromArchiveRequest request, st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - name, - parent, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -16436,71 +15382,11 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual BookFromArchive GetBookFromArchive( - string name, - string parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), - }, - callSettings); - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromArchive GetBookFromArchive( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Gets a book from a shelf or archive. @@ -16718,114 +15604,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - string place, - string folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), - Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), - }, - callSettings); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - string place, - string folder, - st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( - name, - altBookName, - place, - folder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAnywhere( - string name, - string altBookName, - string place, - string folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), - Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), - }, - callSettings); - /// /// Gets a book from a shelf or archive. /// @@ -17002,66 +15780,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test proper OneOf-Any resource name mapping /// @@ -17295,14 +16013,8 @@ namespace Google.Example.Library.V1 /// /// Updates the index of a book. /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -17311,98 +16023,17 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Updates the index of a book. /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - name, - indexName, - indexMap, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void UpdateBookIndex( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -17476,28 +16107,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test server streaming - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The name of the shelf to stream. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The server stream. - /// - public virtual StreamShelvesStream StreamShelves( - string name, - gaxgrpc::CallSettings callSettings = null) => StreamShelves( - new StreamShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test server streaming /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. @@ -17968,66 +16577,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - st::CancellationToken cancellationToken) => GetBigBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test long-running operations /// @@ -18220,66 +16769,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test long-running operations with empty return type. /// @@ -18317,1958 +16806,83 @@ namespace Google.Example.Library.V1 /// /// /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// The long-running operations client for GetBigNothing. - /// - public virtual lro::OperationsClient GetBigNothingOperationsClient - { - get { throw new sys::NotImplementedException(); } - } - - /// - /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. - /// - /// The name of a previously invoked operation. Must not be null or empty. - /// If not null, applies overrides to this RPC call. - /// The result of polling the operation. - public virtual lro::Operation PollOnceGetBigNothing( - string operationName, - gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( - gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), - GetBigNothingOperationsClient, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest - { - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( - new TestOptionalRequiredFlatteningParamsRequest - { - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), - RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), - RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), - RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), - RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), - RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), - RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), - RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), - RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), - RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), - RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), - RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), - RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), - RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), - RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), - RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), - RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, - RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, - RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, - RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, - RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, - RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, - RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, - RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, - RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, - RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, - RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, - RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, - RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, - RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, - RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, - RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - requiredSingularInt32, - requiredSingularInt64, - requiredSingularFloat, - requiredSingularDouble, - requiredSingularBool, - requiredSingularEnum, - requiredSingularString, - requiredSingularBytes, - requiredSingularMessage, - requiredSingularResourceName, - requiredSingularResourceNameOneof, - requiredSingularResourceNameCommon, - requiredSingularFixed32, - requiredSingularFixed64, - requiredRepeatedInt32, - requiredRepeatedInt64, - requiredRepeatedFloat, - requiredRepeatedDouble, - requiredRepeatedBool, - requiredRepeatedEnum, - requiredRepeatedString, - requiredRepeatedBytes, - requiredRepeatedMessage, - requiredRepeatedResourceName, - requiredRepeatedResourceNameOneof, - requiredRepeatedResourceNameCommon, - requiredRepeatedFixed32, - requiredRepeatedFixed64, - requiredMap, - requiredAnyValue, - requiredStructValue, - requiredValueValue, - requiredListValueValue, - requiredTimeValue, - requiredDurationValue, - requiredFieldMaskValue, - requiredInt32Value, - requiredUint32Value, - requiredInt64Value, - requiredUint64Value, - requiredFloatValue, - requiredDoubleValue, - requiredStringValue, - requiredBoolValue, - requiredBytesValue, - requiredRepeatedAnyValue, - requiredRepeatedStructValue, - requiredRepeatedValueValue, - requiredRepeatedListValueValue, - requiredRepeatedTimeValue, - requiredRepeatedDurationValue, - requiredRepeatedFieldMaskValue, - requiredRepeatedInt32Value, - requiredRepeatedUint32Value, - requiredRepeatedInt64Value, - requiredRepeatedUint64Value, - requiredRepeatedFloatValue, - requiredRepeatedDoubleValue, - requiredRepeatedStringValue, - requiredRepeatedBoolValue, - requiredRepeatedBytesValue, - optionalSingularInt32, - optionalSingularInt64, - optionalSingularFloat, - optionalSingularDouble, - optionalSingularBool, - optionalSingularEnum, - optionalSingularString, - optionalSingularBytes, - optionalSingularMessage, - optionalSingularResourceName, - optionalSingularResourceNameOneof, - optionalSingularResourceNameCommon, - optionalSingularFixed32, - optionalSingularFixed64, - optionalRepeatedInt32, - optionalRepeatedInt64, - optionalRepeatedFloat, - optionalRepeatedDouble, - optionalRepeatedBool, - optionalRepeatedEnum, - optionalRepeatedString, - optionalRepeatedBytes, - optionalRepeatedMessage, - optionalRepeatedResourceName, - optionalRepeatedResourceNameOneof, - optionalRepeatedResourceNameCommon, - optionalRepeatedFixed32, - optionalRepeatedFixed64, - optionalMap, - anyValue, - structValue, - valueValue, - listValueValue, - timeValue, - durationValue, - fieldMaskValue, - int32Value, - uint32Value, - int64Value, - uint64Value, - floatValue, - doubleValue, - stringValue, - boolValue, - bytesValue, - repeatedAnyValue, - repeatedStructValue, - repeatedValueValue, - repeatedListValueValue, - repeatedTimeValue, - repeatedDurationValue, - repeatedFieldMaskValue, - repeatedInt32Value, - repeatedUint32Value, - repeatedInt64Value, - repeatedUint64Value, - repeatedFloatValue, - repeatedDoubleValue, - repeatedStringValue, - repeatedBoolValue, - repeatedBytesValue, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual lro::Operation GetBigNothing( + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// The long-running operations client for GetBigNothing. + /// + public virtual lro::OperationsClient GetBigNothingOperationsClient + { + get { throw new sys::NotImplementedException(); } + } + + /// + /// Poll an operation once, using an operationName from a previous invocation of GetBigNothing. + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceGetBigNothing( + string operationName, + gaxgrpc::CallSettings callSettings = null) => lro::Operation.PollOnceFromName( + gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), + GetBigNothingOperationsClient, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( + new TestOptionalRequiredFlatteningParamsRequest + { + }, + callSettings); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// A to use for this RPC. + /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// The RPC response. + /// + public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( new TestOptionalRequiredFlatteningParamsRequest { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), - RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), - RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), - RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), - RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), - RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), - RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), - RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), - RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), - RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), - RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), - RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), - RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), - RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), - RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), - RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), - RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, - RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, - RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, - RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, - RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, - RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, - RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, - RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, - RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, - RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, - RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, - RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, - RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, - RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, - RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, - RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); @@ -20657,9 +17271,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -20718,9 +17332,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -20782,9 +17396,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -20843,9 +17457,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional @@ -21283,9 +17897,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -21344,9 +17958,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -21906,9 +18520,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -21967,9 +18581,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -22031,9 +18645,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -22092,9 +18706,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index d69df0eb31..9620131c5d 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -8823,66 +8823,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Gets a shelf. /// @@ -9033,81 +8973,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - /// /// Gets a shelf. /// @@ -9288,96 +9153,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - stringBuilder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - /// /// Gets a shelf. /// @@ -9645,8 +9420,8 @@ namespace Google.Example.Library.V1 /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -9655,19 +9430,17 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + DeleteShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -9676,71 +9449,16 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteShelfAsync( - string name, + DeleteShelfRequest request, st::CancellationToken cancellationToken) => DeleteShelfAsync( - name, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void DeleteShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelf( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - st::CancellationToken cancellationToken) => DeleteShelfAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -9914,87 +9632,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MergeShelvesAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf MergeShelves( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelves( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - /// /// Merges two shelves by adding all books from the shelf named /// `other_shelf_name` to shelf `name`, and deletes @@ -10207,81 +9844,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - st::CancellationToken cancellationToken) => CreateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book CreateBook( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBook( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - /// /// Creates a book. /// @@ -10622,8 +10184,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -10632,19 +10194,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Gets a book. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -10653,16 +10213,16 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookAsync( - string name, + GetBookRequest request, st::CancellationToken cancellationToken) => GetBookAsync( - name, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -10671,75 +10231,17 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book GetBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + GetBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// - /// Gets a book. + /// Lists books in a shelf. /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - GetBookRequest request, - st::CancellationToken cancellationToken) => GetBookAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book GetBook( - GetBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. + /// + /// The name of the shelf whose books we'd like to list. /// /// /// To test python built-in wrapping. @@ -10887,82 +10389,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. - /// - /// - /// To test python built-in wrapping. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListBooksAsync( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( - new ListBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. - /// - /// - /// To test python built-in wrapping. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListBooks( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooks( - new ListBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - /// /// Lists books in a shelf. /// @@ -11115,63 +10541,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - string name, - st::CancellationToken cancellationToken) => DeleteBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void DeleteBook( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBook( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Deletes a book. /// @@ -11381,9 +10750,18 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// + /// + /// An optional foo. + /// /// /// The book to update with. /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// /// /// If not null, applies overrides to this RPC call. /// @@ -11391,13 +10769,19 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, + string optionalFoo, Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional }, callSettings); @@ -11407,9 +10791,18 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// + /// + /// An optional foo. + /// /// /// The book to update with. /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// /// /// A to use for this RPC. /// @@ -11417,11 +10810,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - string name, + BookName name, + string optionalFoo, Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, st::CancellationToken cancellationToken) => UpdateBookAsync( name, + optionalFoo, book, + updateMask, + physicalMask, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -11430,9 +10829,18 @@ namespace Google.Example.Library.V1 /// /// The name of the book to update. /// + /// + /// An optional foo. + /// /// /// The book to update with. /// + /// + /// A field mask to apply, rendered as an HTTP parameter. + /// + /// + /// To test Python import clash resolution. + /// /// /// If not null, applies overrides to this RPC call. /// @@ -11440,13 +10848,19 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book UpdateBook( - string name, + BookName name, + string optionalFoo, Book book, + pbwkt::FieldMask updateMask, + FieldMask physicalMask, gaxgrpc::CallSettings callSettings = null) => UpdateBook( new UpdateBookRequest { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), + UpdateMask = updateMask, // Optional + PhysicalMask = physicalMask, // Optional }, callSettings); @@ -11475,7 +10889,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, + string name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -11483,7 +10897,7 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), UpdateMask = updateMask, // Optional @@ -11516,7 +10930,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task UpdateBookAsync( - BookName name, + string name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -11554,7 +10968,7 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual Book UpdateBook( - BookName name, + string name, string optionalFoo, Book book, pbwkt::FieldMask updateMask, @@ -11562,7 +10976,7 @@ namespace Google.Example.Library.V1 gaxgrpc::CallSettings callSettings = null) => UpdateBook( new UpdateBookRequest { - BookName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), OptionalFoo = optionalFoo ?? "", // Optional Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), UpdateMask = updateMask, // Optional @@ -11573,248 +10987,8 @@ namespace Google.Example.Library.V1 /// /// Updates a book. /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - optionalFoo, - book, - updateMask, - physicalMask, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - optionalFoo, - book, - updateMask, - physicalMask, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -12019,83 +11193,8 @@ namespace Google.Example.Library.V1 /// /// Moves a book to another shelf, and returns the new book. /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MoveBookAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book MoveBook( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBook( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -12335,72 +11434,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListStrings( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStrings( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - /// /// Lists a primitive resource. To test go page streaming. /// @@ -12583,78 +11616,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - st::CancellationToken cancellationToken) => AddCommentsAsync( - name, - comments, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void AddComments( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddComments( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - /// /// Adds comments to a book /// @@ -12831,8 +11792,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -12841,19 +11802,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -12862,16 +11821,16 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - string name, + GetBookFromArchiveRequest request, st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - name, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -12880,79 +11839,21 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual BookFromArchive GetBookFromArchive( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// - /// Gets a book from an archive. + /// Gets a book from a shelf or archive. /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromArchive GetBookFromArchive( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. + /// + /// The name of the book to retrieve. + /// + /// + /// An alternate book name, used to test restricting flattened field to a + /// single resource name type in a oneof. /// /// /// If not null, applies overrides to this RPC call. @@ -13100,84 +12001,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - }, - callSettings); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( - name, - altBookName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAnywhere( - string name, - string altBookName, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - }, - callSettings); - /// /// Gets a book from a shelf or archive. /// @@ -13354,66 +12177,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test proper OneOf-Any resource name mapping /// @@ -13647,14 +12410,8 @@ namespace Google.Example.Library.V1 /// /// Updates the index of a book. /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -13663,29 +12420,17 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Updates the index of a book. /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -13694,85 +12439,16 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, + UpdateBookIndexRequest request, st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - name, - indexName, - indexMap, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Updates the index of a book. /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void UpdateBookIndex( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -13828,28 +12504,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test server streaming - /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. - /// - /// - /// The name of the shelf to stream. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The server stream. - /// - public virtual StreamShelvesStream StreamShelves( - string name, - gaxgrpc::CallSettings callSettings = null) => StreamShelves( - new StreamShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test server streaming /// gRPC streaming methods don't have an HTTP equivalent and don't need to have the google.api.http option. @@ -14320,66 +12974,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - st::CancellationToken cancellationToken) => GetBigBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test long-running operations /// @@ -14572,66 +13166,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test long-running operations with empty return type. /// @@ -14719,1238 +13253,23 @@ namespace Google.Example.Library.V1 { }, callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( - new TestOptionalRequiredFlatteningParamsRequest - { - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - requiredSingularInt32, - requiredSingularInt64, - requiredSingularFloat, - requiredSingularDouble, - requiredSingularBool, - requiredSingularEnum, - requiredSingularString, - requiredSingularBytes, - requiredSingularMessage, - requiredSingularResourceName, - requiredSingularResourceNameOneof, - requiredSingularResourceNameCommon, - requiredSingularFixed32, - requiredSingularFixed64, - requiredRepeatedInt32, - requiredRepeatedInt64, - requiredRepeatedFloat, - requiredRepeatedDouble, - requiredRepeatedBool, - requiredRepeatedEnum, - requiredRepeatedString, - requiredRepeatedBytes, - requiredRepeatedMessage, - requiredRepeatedResourceName, - requiredRepeatedResourceNameOneof, - requiredRepeatedResourceNameCommon, - requiredRepeatedFixed32, - requiredRepeatedFixed64, - requiredMap, - optionalSingularInt32, - optionalSingularInt64, - optionalSingularFloat, - optionalSingularDouble, - optionalSingularBool, - optionalSingularEnum, - optionalSingularString, - optionalSingularBytes, - optionalSingularMessage, - optionalSingularResourceName, - optionalSingularResourceNameOneof, - optionalSingularResourceNameCommon, - optionalSingularFixed32, - optionalSingularFixed64, - optionalRepeatedInt32, - optionalRepeatedInt64, - optionalRepeatedFloat, - optionalRepeatedDouble, - optionalRepeatedBool, - optionalRepeatedEnum, - optionalRepeatedString, - optionalRepeatedBytes, - optionalRepeatedMessage, - optionalRepeatedResourceName, - optionalRepeatedResourceNameOneof, - optionalRepeatedResourceNameCommon, - optionalRepeatedFixed32, - optionalRepeatedFixed64, - optionalMap, - anyValue, - structValue, - valueValue, - listValueValue, - timeValue, - durationValue, - fieldMaskValue, - int32Value, - uint32Value, - int64Value, - uint64Value, - floatValue, - doubleValue, - stringValue, - boolValue, - bytesValue, - repeatedAnyValue, - repeatedStructValue, - repeatedValueValue, - repeatedListValueValue, - repeatedTimeValue, - repeatedDurationValue, - repeatedFieldMaskValue, - repeatedInt32Value, - repeatedUint32Value, - repeatedInt64Value, - repeatedUint64Value, - repeatedFloatValue, - repeatedDoubleValue, - repeatedStringValue, - repeatedBoolValue, - repeatedBytesValue, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// + + /// + /// Test optional flattening parameters of all types + /// + /// + /// A to use for this RPC. /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types + /// /// /// If not null, applies overrides to this RPC call. /// @@ -15958,189 +13277,9 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - BookName requiredSingularResourceName, - BookNameOneof requiredSingularResourceNameOneof, - gaxres::ProjectName requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - BookName optionalSingularResourceName, - BookNameOneof optionalSingularResourceNameOneof, - gaxres::ProjectName optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( new TestOptionalRequiredFlatteningParamsRequest { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional - OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional - OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional }, callSettings); @@ -16433,9 +13572,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -16462,9 +13601,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -16526,9 +13665,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -16555,9 +13694,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional @@ -16899,9 +14038,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -16928,9 +14067,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -17362,9 +14501,9 @@ namespace Google.Example.Library.V1 string requiredSingularString, pb::ByteString requiredSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, + BookName requiredSingularResourceName, + BookNameOneof requiredSingularResourceNameOneof, + gaxres::ProjectName requiredSingularResourceNameCommon, int requiredSingularFixed32, long requiredSingularFixed64, scg::IEnumerable requiredRepeatedInt32, @@ -17391,9 +14530,9 @@ namespace Google.Example.Library.V1 string optionalSingularString, pb::ByteString optionalSingularBytes, TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, + BookName optionalSingularResourceName, + BookNameOneof optionalSingularResourceNameOneof, + gaxres::ProjectName optionalSingularResourceNameCommon, int? optionalSingularFixed32, long? optionalSingularFixed64, scg::IEnumerable optionalRepeatedInt32, @@ -17455,9 +14594,9 @@ namespace Google.Example.Library.V1 RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), + RequiredSingularResourceNameAsBookName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceName, nameof(requiredSingularResourceName)), + RequiredSingularResourceNameOneofAsBookNameOneof = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), + RequiredSingularResourceNameCommonAsProjectName = gax::GaxPreconditions.CheckNotNull(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), RequiredSingularFixed32 = requiredSingularFixed32, RequiredSingularFixed64 = requiredSingularFixed64, RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, @@ -17484,9 +14623,9 @@ namespace Google.Example.Library.V1 OptionalSingularString = optionalSingularString ?? "", // Optional OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional + OptionalSingularResourceNameAsBookName = optionalSingularResourceName, // Optional + OptionalSingularResourceNameOneofAsBookNameOneof = optionalSingularResourceNameOneof, // Optional + OptionalSingularResourceNameCommonAsProjectName = optionalSingularResourceNameCommon, // Optional OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index 0754fa22f1..bf33535d39 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -12685,66 +12685,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Gets a shelf. /// @@ -12895,81 +12835,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - }, - callSettings); - /// /// Gets a shelf. /// @@ -13150,96 +13015,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelfAsync( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetShelfAsync( - string name, - SomeMessage message, - StringBuilder stringBuilder, - st::CancellationToken cancellationToken) => GetShelfAsync( - name, - message, - stringBuilder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a shelf. - /// - /// - /// The name of the shelf to retrieve. - /// - /// - /// Field to verify that message-type query parameter gets flattened. - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf GetShelf( - string name, - SomeMessage message, - StringBuilder stringBuilder, - gaxgrpc::CallSettings callSettings = null) => GetShelf( - new GetShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Message = message, // Optional - StringBuilder = stringBuilder, // Optional - }, - callSettings); - /// /// Gets a shelf. /// @@ -13507,8 +13282,8 @@ namespace Google.Example.Library.V1 /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -13517,19 +13292,17 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteShelfAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelfAsync( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + DeleteShelfRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -13538,71 +13311,16 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteShelfAsync( - string name, + DeleteShelfRequest request, st::CancellationToken cancellationToken) => DeleteShelfAsync( - name, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Deletes a shelf. /// - /// - /// The name of the shelf to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void DeleteShelf( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteShelf( - new DeleteShelfRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteShelfAsync( - DeleteShelfRequest request, - st::CancellationToken cancellationToken) => DeleteShelfAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a shelf. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -13776,87 +13494,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelvesAsync( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MergeShelvesAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MergeShelvesAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Merges two shelves by adding all books from the shelf named - /// `other_shelf_name` to shelf `name`, and deletes - /// `other_shelf_name`. Returns the updated shelf. - /// - /// - /// The name of the shelf we're adding books to. - /// - /// - /// The name of the shelf we're removing books from and deleting. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Shelf MergeShelves( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MergeShelves( - new MergeShelvesRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - /// /// Merges two shelves by adding all books from the shelf named /// `other_shelf_name` to shelf `name`, and deletes @@ -14069,81 +13706,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBookAsync( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task CreateBookAsync( - string name, - Book book, - st::CancellationToken cancellationToken) => CreateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a book. - /// - /// - /// The name of the shelf in which the book is created. - /// - /// - /// The book to create. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book CreateBook( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => CreateBook( - new CreateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - /// /// Creates a book. /// @@ -14443,20 +14005,8 @@ namespace Google.Example.Library.V1 /// /// Creates a series of books. /// - /// - /// The shelf in which the series is created. - /// - /// - /// The books to publish in the series. - /// - /// - /// The edition of the series - /// - /// - /// Uniquely identifies the series to the publishing house. - /// - /// - /// The publisher of the series. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -14465,128 +14015,20 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task PublishSeriesAsync( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - string publisher, - gaxgrpc::CallSettings callSettings = null) => PublishSeriesAsync( - new PublishSeriesRequest - { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), - Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, - Edition = edition ?? 0, // Optional - SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), - Publisher = publisher ?? "", // Optional - }, - callSettings); + PublishSeriesRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Creates a series of books. /// - /// - /// The shelf in which the series is created. - /// - /// - /// The books to publish in the series. + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// The edition of the series - /// - /// - /// Uniquely identifies the series to the publishing house. - /// - /// - /// The publisher of the series. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - string publisher, - st::CancellationToken cancellationToken) => PublishSeriesAsync( - shelf, - books, - edition, - seriesUuid, - publisher, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Creates a series of books. - /// - /// - /// The shelf in which the series is created. - /// - /// - /// The books to publish in the series. - /// - /// - /// The edition of the series - /// - /// - /// Uniquely identifies the series to the publishing house. - /// - /// - /// The publisher of the series. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual PublishSeriesResponse PublishSeries( - Shelf shelf, - scg::IEnumerable books, - uint? edition, - SeriesUuid seriesUuid, - string publisher, - gaxgrpc::CallSettings callSettings = null) => PublishSeries( - new PublishSeriesRequest - { - Shelf = gax::GaxPreconditions.CheckNotNull(shelf, nameof(shelf)), - Books = { gax::GaxPreconditions.CheckNotNull(books, nameof(books)) }, - Edition = edition ?? 0, // Optional - SeriesUuid = gax::GaxPreconditions.CheckNotNull(seriesUuid, nameof(seriesUuid)), - Publisher = publisher ?? "", // Optional - }, - callSettings); - - /// - /// Creates a series of books. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task PublishSeriesAsync( - PublishSeriesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Creates a series of books. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. + /// + /// A to use for this RPC. /// /// /// A Task containing the RPC response. @@ -14736,66 +14178,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookAsync( - string name, - st::CancellationToken cancellationToken) => GetBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book GetBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Gets a book. /// @@ -15004,82 +14386,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. - /// - /// - /// To test python built-in wrapping. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListBooksAsync( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooksAsync( - new ListBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists books in a shelf. - /// - /// - /// The name of the shelf whose books we'd like to list. - /// - /// - /// To test python built-in wrapping. - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListBooks( - string name, - string filter, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListBooks( - new ListBooksRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Filter = filter ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - /// /// Lists books in a shelf. /// @@ -15235,8 +14541,8 @@ namespace Google.Example.Library.V1 /// /// Deletes a book. /// - /// - /// The name of the book to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -15245,19 +14551,17 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBookAsync( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); + DeleteBookRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Deletes a book. /// - /// - /// The name of the book to delete. + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -15266,64 +14570,9 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task DeleteBookAsync( - string name, + DeleteBookRequest request, st::CancellationToken cancellationToken) => DeleteBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Deletes a book. - /// - /// - /// The name of the book to delete. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void DeleteBook( - string name, - gaxgrpc::CallSettings callSettings = null) => DeleteBook( - new DeleteBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Deletes a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - DeleteBookRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Deletes a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task DeleteBookAsync( - DeleteBookRequest request, - st::CancellationToken cancellationToken) => DeleteBookAsync( - request, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -15492,81 +14741,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// The book to update with. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// The book to update with. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - Book book, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - book, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// The book to update with. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - Book book, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - }, - callSettings); - /// /// Updates a book. /// @@ -15807,126 +14981,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBookAsync( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task UpdateBookAsync( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - st::CancellationToken cancellationToken) => UpdateBookAsync( - name, - optionalFoo, - book, - updateMask, - physicalMask, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates a book. - /// - /// - /// The name of the book to update. - /// - /// - /// An optional foo. - /// - /// - /// The book to update with. - /// - /// - /// A field mask to apply, rendered as an HTTP parameter. - /// - /// - /// To test Python import clash resolution. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book UpdateBook( - string name, - string optionalFoo, - Book book, - pbwkt::FieldMask updateMask, - FieldMask physicalMask, - gaxgrpc::CallSettings callSettings = null) => UpdateBook( - new UpdateBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OptionalFoo = optionalFoo ?? "", // Optional - Book = gax::GaxPreconditions.CheckNotNull(book, nameof(book)), - UpdateMask = updateMask, // Optional - PhysicalMask = physicalMask, // Optional - }, - callSettings); - /// /// Updates a book. /// @@ -16136,83 +15190,8 @@ namespace Google.Example.Library.V1 /// /// Moves a book to another shelf, and returns the new book. /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBookAsync( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBookAsync( - string name, - string otherShelfName, - st::CancellationToken cancellationToken) => MoveBookAsync( - name, - otherShelfName, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The name of the book to move. - /// - /// - /// The name of the destination shelf. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual Book MoveBook( - string name, - string otherShelfName, - gaxgrpc::CallSettings callSettings = null) => MoveBook( - new MoveBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - OtherShelfName = gax::GaxPreconditions.CheckNotNullOrEmpty(otherShelfName, nameof(otherShelfName)), - }, - callSettings); - - /// - /// Moves a book to another shelf, and returns the new book. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -16452,72 +15431,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable asynchronous sequence of resources. - /// - public virtual gax::PagedAsyncEnumerable ListStringsAsync( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStringsAsync( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - - /// - /// Lists a primitive resource. To test go page streaming. - /// - /// - /// - /// - /// - /// The token returned from the previous request. - /// A value of null or an empty string retrieves the first page. - /// - /// - /// The size of page to request. The response will not be larger than this, but may be smaller. - /// A value of null or 0 uses a server-defined page size. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A pageable sequence of resources. - /// - public virtual gax::PagedEnumerable ListStrings( - string name, - string pageToken = null, - int? pageSize = null, - gaxgrpc::CallSettings callSettings = null) => ListStrings( - new ListStringsRequest - { - Name = name ?? "", // Optional - PageToken = pageToken ?? "", - PageSize = pageSize ?? 0, - }, - callSettings); - /// /// Lists a primitive resource. To test go page streaming. /// @@ -16700,78 +15613,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddCommentsAsync( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task AddCommentsAsync( - string name, - scg::IEnumerable comments, - st::CancellationToken cancellationToken) => AddCommentsAsync( - name, - comments, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Adds comments to a book - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void AddComments( - string name, - scg::IEnumerable comments, - gaxgrpc::CallSettings callSettings = null) => AddComments( - new AddCommentsRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Comments = { gax::GaxPreconditions.CheckNotNull(comments, nameof(comments)) }, - }, - callSettings); - /// /// Adds comments to a book /// @@ -16978,11 +15819,8 @@ namespace Google.Example.Library.V1 /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -16991,24 +15829,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - string name, - string parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchiveAsync( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), - }, - callSettings); + GetBookFromArchiveRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -17017,81 +15848,16 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task GetBookFromArchiveAsync( - string name, - string parent, + GetBookFromArchiveRequest request, st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - name, - parent, + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// Gets a book from an archive. /// - /// - /// The name of the book to retrieve. - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromArchive GetBookFromArchive( - string name, - string parent, - gaxgrpc::CallSettings callSettings = null) => GetBookFromArchive( - new GetBookFromArchiveRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), - }, - callSettings); - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromArchiveAsync( - GetBookFromArchiveRequest request, - st::CancellationToken cancellationToken) => GetBookFromArchiveAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from an archive. - /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -17322,114 +16088,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - string place, - string folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhereAsync( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), - Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), - }, - callSettings); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAnywhereAsync( - string name, - string altBookName, - string place, - string folder, - st::CancellationToken cancellationToken) => GetBookFromAnywhereAsync( - name, - altBookName, - place, - folder, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Gets a book from a shelf or archive. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// An alternate book name, used to test restricting flattened field to a - /// single resource name type in a oneof. - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAnywhere( - string name, - string altBookName, - string place, - string folder, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAnywhere( - new GetBookFromAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - AltBookName = gax::GaxPreconditions.CheckNotNullOrEmpty(altBookName, nameof(altBookName)), - Place = gax::GaxPreconditions.CheckNotNullOrEmpty(place, nameof(place)), - Folder = gax::GaxPreconditions.CheckNotNullOrEmpty(folder, nameof(folder)), - }, - callSettings); - /// /// Gets a book from a shelf or archive. /// @@ -17606,66 +16264,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhereAsync( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task GetBookFromAbsolutelyAnywhereAsync( - string name, - st::CancellationToken cancellationToken) => GetBookFromAbsolutelyAnywhereAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test proper OneOf-Any resource name mapping - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual BookFromAnywhere GetBookFromAbsolutelyAnywhere( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBookFromAbsolutelyAnywhere( - new GetBookFromAbsolutelyAnywhereRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test proper OneOf-Any resource name mapping /// @@ -17899,14 +16497,8 @@ namespace Google.Example.Library.V1 /// /// Updates the index of a book. /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -17915,101 +16507,20 @@ namespace Google.Example.Library.V1 /// A Task that completes when the RPC has completed. /// public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndexAsync( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); + UpdateBookIndexRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// Updates the index of a book. /// - /// - /// The name of the book to update. + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - string name, - string indexName, - scg::IDictionary indexMap, - st::CancellationToken cancellationToken) => UpdateBookIndexAsync( - name, - indexName, - indexMap, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Updates the index of a book. - /// - /// - /// The name of the book to update. - /// - /// - /// The name of the index for the book - /// - /// - /// The index to update the book with - /// - /// - /// If not null, applies overrides to this RPC call. - /// - public virtual void UpdateBookIndex( - string name, - string indexName, - scg::IDictionary indexMap, - gaxgrpc::CallSettings callSettings = null) => UpdateBookIndex( - new UpdateBookIndexRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - IndexName = gax::GaxPreconditions.CheckNotNullOrEmpty(indexName, nameof(indexName)), - IndexMap = { gax::GaxPreconditions.CheckNotNull(indexMap, nameof(indexMap)) }, - }, - callSettings); - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task that completes when the RPC has completed. - /// - public virtual stt::Task UpdateBookIndexAsync( - UpdateBookIndexRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Updates the index of a book. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. + /// + /// A to use for this RPC. /// /// /// A Task that completes when the RPC has completed. @@ -18134,17 +16645,6 @@ namespace Google.Example.Library.V1 /// *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - /// - /// Test bidi-streaming. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The client-server stream. - /// - *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - /// /// Test bidi-streaming. /// @@ -18461,66 +16961,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBookAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigBookAsync( - string name, - st::CancellationToken cancellationToken) => GetBigBookAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigBook( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigBook( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test long-running operations /// @@ -18713,66 +17153,6 @@ namespace Google.Example.Library.V1 }, callSettings); - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothingAsync( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task> GetBigNothingAsync( - string name, - st::CancellationToken cancellationToken) => GetBigNothingAsync( - name, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test long-running operations with empty return type. - /// - /// - /// The name of the book to retrieve. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual lro::Operation GetBigNothing( - string name, - gaxgrpc::CallSettings callSettings = null) => GetBigNothing( - new GetBookRequest - { - Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), - }, - callSettings); - /// /// Test long-running operations with empty return type. /// @@ -22643,3193 +21023,58 @@ namespace Google.Example.Library.V1 /// /// Test optional flattening parameters of all types /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// + /// + /// If not null, applies overrides to this RPC call. /// - /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + TestOptionalRequiredFlatteningParamsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } + + /// + /// Test optional flattening parameters of all types + /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// + /// + /// A to use for this RPC. /// - /// - /// + /// + /// A Task containing the RPC response. + /// + public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( + TestOptionalRequiredFlatteningParamsRequest request, + st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( + request, + gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Test optional flattening parameters of all types + /// + /// + /// The request object containing all of the parameters for the API call. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParamsAsync( - new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), - RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), - RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), - RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), - RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), - RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), - RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), - RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), - RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), - RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), - RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), - RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), - RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), - RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), - RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), - RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), - RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, - RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, - RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, - RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, - RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, - RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, - RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, - RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, - RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, - RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, - RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, - RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, - RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, - RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, - RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, - RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - requiredSingularInt32, - requiredSingularInt64, - requiredSingularFloat, - requiredSingularDouble, - requiredSingularBool, - requiredSingularEnum, - requiredSingularString, - requiredSingularBytes, - requiredSingularMessage, - requiredSingularResourceName, - requiredSingularResourceNameOneof, - requiredSingularResourceNameCommon, - requiredSingularFixed32, - requiredSingularFixed64, - requiredRepeatedInt32, - requiredRepeatedInt64, - requiredRepeatedFloat, - requiredRepeatedDouble, - requiredRepeatedBool, - requiredRepeatedEnum, - requiredRepeatedString, - requiredRepeatedBytes, - requiredRepeatedMessage, - requiredRepeatedResourceName, - requiredRepeatedResourceNameOneof, - requiredRepeatedResourceNameCommon, - requiredRepeatedFixed32, - requiredRepeatedFixed64, - requiredMap, - requiredAnyValue, - requiredStructValue, - requiredValueValue, - requiredListValueValue, - requiredTimeValue, - requiredDurationValue, - requiredFieldMaskValue, - requiredInt32Value, - requiredUint32Value, - requiredInt64Value, - requiredUint64Value, - requiredFloatValue, - requiredDoubleValue, - requiredStringValue, - requiredBoolValue, - requiredBytesValue, - requiredRepeatedAnyValue, - requiredRepeatedStructValue, - requiredRepeatedValueValue, - requiredRepeatedListValueValue, - requiredRepeatedTimeValue, - requiredRepeatedDurationValue, - requiredRepeatedFieldMaskValue, - requiredRepeatedInt32Value, - requiredRepeatedUint32Value, - requiredRepeatedInt64Value, - requiredRepeatedUint64Value, - requiredRepeatedFloatValue, - requiredRepeatedDoubleValue, - requiredRepeatedStringValue, - requiredRepeatedBoolValue, - requiredRepeatedBytesValue, - optionalSingularInt32, - optionalSingularInt64, - optionalSingularFloat, - optionalSingularDouble, - optionalSingularBool, - optionalSingularEnum, - optionalSingularString, - optionalSingularBytes, - optionalSingularMessage, - optionalSingularResourceName, - optionalSingularResourceNameOneof, - optionalSingularResourceNameCommon, - optionalSingularFixed32, - optionalSingularFixed64, - optionalRepeatedInt32, - optionalRepeatedInt64, - optionalRepeatedFloat, - optionalRepeatedDouble, - optionalRepeatedBool, - optionalRepeatedEnum, - optionalRepeatedString, - optionalRepeatedBytes, - optionalRepeatedMessage, - optionalRepeatedResourceName, - optionalRepeatedResourceNameOneof, - optionalRepeatedResourceNameCommon, - optionalRepeatedFixed32, - optionalRepeatedFixed64, - optionalMap, - anyValue, - structValue, - valueValue, - listValueValue, - timeValue, - durationValue, - fieldMaskValue, - int32Value, - uint32Value, - int64Value, - uint64Value, - floatValue, - doubleValue, - stringValue, - boolValue, - bytesValue, - repeatedAnyValue, - repeatedStructValue, - repeatedValueValue, - repeatedListValueValue, - repeatedTimeValue, - repeatedDurationValue, - repeatedFieldMaskValue, - repeatedInt32Value, - repeatedUint32Value, - repeatedInt64Value, - repeatedUint64Value, - repeatedFloatValue, - repeatedDoubleValue, - repeatedStringValue, - repeatedBoolValue, - repeatedBytesValue, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - int requiredSingularInt32, - long requiredSingularInt64, - float requiredSingularFloat, - double requiredSingularDouble, - bool requiredSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum, - string requiredSingularString, - pb::ByteString requiredSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage, - string requiredSingularResourceName, - string requiredSingularResourceNameOneof, - string requiredSingularResourceNameCommon, - int requiredSingularFixed32, - long requiredSingularFixed64, - scg::IEnumerable requiredRepeatedInt32, - scg::IEnumerable requiredRepeatedInt64, - scg::IEnumerable requiredRepeatedFloat, - scg::IEnumerable requiredRepeatedDouble, - scg::IEnumerable requiredRepeatedBool, - scg::IEnumerable requiredRepeatedEnum, - scg::IEnumerable requiredRepeatedString, - scg::IEnumerable requiredRepeatedBytes, - scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, - scg::IEnumerable requiredRepeatedFixed32, - scg::IEnumerable requiredRepeatedFixed64, - scg::IDictionary requiredMap, - pbwkt::Any requiredAnyValue, - pbwkt::Struct requiredStructValue, - pbwkt::Value requiredValueValue, - pbwkt::ListValue requiredListValueValue, - pbwkt::Timestamp requiredTimeValue, - pbwkt::Duration requiredDurationValue, - pbwkt::FieldMask requiredFieldMaskValue, - int? requiredInt32Value, - uint? requiredUint32Value, - long? requiredInt64Value, - ulong? requiredUint64Value, - float? requiredFloatValue, - double? requiredDoubleValue, - string requiredStringValue, - bool? requiredBoolValue, - pb::ByteString requiredBytesValue, - scg::IEnumerable requiredRepeatedAnyValue, - scg::IEnumerable requiredRepeatedStructValue, - scg::IEnumerable requiredRepeatedValueValue, - scg::IEnumerable requiredRepeatedListValueValue, - scg::IEnumerable requiredRepeatedTimeValue, - scg::IEnumerable requiredRepeatedDurationValue, - scg::IEnumerable requiredRepeatedFieldMaskValue, - scg::IEnumerable requiredRepeatedInt32Value, - scg::IEnumerable requiredRepeatedUint32Value, - scg::IEnumerable requiredRepeatedInt64Value, - scg::IEnumerable requiredRepeatedUint64Value, - scg::IEnumerable requiredRepeatedFloatValue, - scg::IEnumerable requiredRepeatedDoubleValue, - scg::IEnumerable requiredRepeatedStringValue, - scg::IEnumerable requiredRepeatedBoolValue, - scg::IEnumerable requiredRepeatedBytesValue, - int? optionalSingularInt32, - long? optionalSingularInt64, - float? optionalSingularFloat, - double? optionalSingularDouble, - bool? optionalSingularBool, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum? optionalSingularEnum, - string optionalSingularString, - pb::ByteString optionalSingularBytes, - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage, - string optionalSingularResourceName, - string optionalSingularResourceNameOneof, - string optionalSingularResourceNameCommon, - int? optionalSingularFixed32, - long? optionalSingularFixed64, - scg::IEnumerable optionalRepeatedInt32, - scg::IEnumerable optionalRepeatedInt64, - scg::IEnumerable optionalRepeatedFloat, - scg::IEnumerable optionalRepeatedDouble, - scg::IEnumerable optionalRepeatedBool, - scg::IEnumerable optionalRepeatedEnum, - scg::IEnumerable optionalRepeatedString, - scg::IEnumerable optionalRepeatedBytes, - scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, - scg::IEnumerable optionalRepeatedFixed32, - scg::IEnumerable optionalRepeatedFixed64, - scg::IDictionary optionalMap, - pbwkt::Any anyValue, - pbwkt::Struct structValue, - pbwkt::Value valueValue, - pbwkt::ListValue listValueValue, - pbwkt::Timestamp timeValue, - pbwkt::Duration durationValue, - pbwkt::FieldMask fieldMaskValue, - int? int32Value, - uint? uint32Value, - long? int64Value, - ulong? uint64Value, - float? floatValue, - double? doubleValue, - string stringValue, - bool? boolValue, - pb::ByteString bytesValue, - scg::IEnumerable repeatedAnyValue, - scg::IEnumerable repeatedStructValue, - scg::IEnumerable repeatedValueValue, - scg::IEnumerable repeatedListValueValue, - scg::IEnumerable repeatedTimeValue, - scg::IEnumerable repeatedDurationValue, - scg::IEnumerable repeatedFieldMaskValue, - scg::IEnumerable repeatedInt32Value, - scg::IEnumerable repeatedUint32Value, - scg::IEnumerable repeatedInt64Value, - scg::IEnumerable repeatedUint64Value, - scg::IEnumerable repeatedFloatValue, - scg::IEnumerable repeatedDoubleValue, - scg::IEnumerable repeatedStringValue, - scg::IEnumerable repeatedBoolValue, - scg::IEnumerable repeatedBytesValue, - gaxgrpc::CallSettings callSettings = null) => TestOptionalRequiredFlatteningParams( - new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = requiredSingularInt32, - RequiredSingularInt64 = requiredSingularInt64, - RequiredSingularFloat = requiredSingularFloat, - RequiredSingularDouble = requiredSingularDouble, - RequiredSingularBool = requiredSingularBool, - RequiredSingularEnum = requiredSingularEnum, - RequiredSingularString = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularString, nameof(requiredSingularString)), - RequiredSingularBytes = gax::GaxPreconditions.CheckNotNull(requiredSingularBytes, nameof(requiredSingularBytes)), - RequiredSingularMessage = gax::GaxPreconditions.CheckNotNull(requiredSingularMessage, nameof(requiredSingularMessage)), - RequiredSingularResourceName = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceName, nameof(requiredSingularResourceName)), - RequiredSingularResourceNameOneof = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameOneof, nameof(requiredSingularResourceNameOneof)), - RequiredSingularResourceNameCommon = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredSingularResourceNameCommon, nameof(requiredSingularResourceNameCommon)), - RequiredSingularFixed32 = requiredSingularFixed32, - RequiredSingularFixed64 = requiredSingularFixed64, - RequiredRepeatedInt32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32, nameof(requiredRepeatedInt32)) }, - RequiredRepeatedInt64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64, nameof(requiredRepeatedInt64)) }, - RequiredRepeatedFloat = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloat, nameof(requiredRepeatedFloat)) }, - RequiredRepeatedDouble = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDouble, nameof(requiredRepeatedDouble)) }, - RequiredRepeatedBool = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBool, nameof(requiredRepeatedBool)) }, - RequiredRepeatedEnum = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedEnum, nameof(requiredRepeatedEnum)) }, - RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, - RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, - RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, - RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, - RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, - RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, - RequiredAnyValue = gax::GaxPreconditions.CheckNotNull(requiredAnyValue, nameof(requiredAnyValue)), - RequiredStructValue = gax::GaxPreconditions.CheckNotNull(requiredStructValue, nameof(requiredStructValue)), - RequiredValueValue = gax::GaxPreconditions.CheckNotNull(requiredValueValue, nameof(requiredValueValue)), - RequiredListValueValue = gax::GaxPreconditions.CheckNotNull(requiredListValueValue, nameof(requiredListValueValue)), - RequiredTimeValue = gax::GaxPreconditions.CheckNotNull(requiredTimeValue, nameof(requiredTimeValue)), - RequiredDurationValue = gax::GaxPreconditions.CheckNotNull(requiredDurationValue, nameof(requiredDurationValue)), - RequiredFieldMaskValue = gax::GaxPreconditions.CheckNotNull(requiredFieldMaskValue, nameof(requiredFieldMaskValue)), - RequiredInt32Value = requiredInt32Value ?? throw new sys::ArgumentNullException(nameof(requiredInt32Value)), - RequiredUint32Value = requiredUint32Value ?? throw new sys::ArgumentNullException(nameof(requiredUint32Value)), - RequiredInt64Value = requiredInt64Value ?? throw new sys::ArgumentNullException(nameof(requiredInt64Value)), - RequiredUint64Value = requiredUint64Value ?? throw new sys::ArgumentNullException(nameof(requiredUint64Value)), - RequiredFloatValue = requiredFloatValue ?? throw new sys::ArgumentNullException(nameof(requiredFloatValue)), - RequiredDoubleValue = requiredDoubleValue ?? throw new sys::ArgumentNullException(nameof(requiredDoubleValue)), - RequiredStringValue = gax::GaxPreconditions.CheckNotNullOrEmpty(requiredStringValue, nameof(requiredStringValue)), - RequiredBoolValue = requiredBoolValue ?? throw new sys::ArgumentNullException(nameof(requiredBoolValue)), - RequiredBytesValue = gax::GaxPreconditions.CheckNotNull(requiredBytesValue, nameof(requiredBytesValue)), - RequiredRepeatedAnyValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedAnyValue, nameof(requiredRepeatedAnyValue)) }, - RequiredRepeatedStructValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStructValue, nameof(requiredRepeatedStructValue)) }, - RequiredRepeatedValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedValueValue, nameof(requiredRepeatedValueValue)) }, - RequiredRepeatedListValueValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedListValueValue, nameof(requiredRepeatedListValueValue)) }, - RequiredRepeatedTimeValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedTimeValue, nameof(requiredRepeatedTimeValue)) }, - RequiredRepeatedDurationValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDurationValue, nameof(requiredRepeatedDurationValue)) }, - RequiredRepeatedFieldMaskValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFieldMaskValue, nameof(requiredRepeatedFieldMaskValue)) }, - RequiredRepeatedInt32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt32Value, nameof(requiredRepeatedInt32Value)) }, - RequiredRepeatedUint32Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint32Value, nameof(requiredRepeatedUint32Value)) }, - RequiredRepeatedInt64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedInt64Value, nameof(requiredRepeatedInt64Value)) }, - RequiredRepeatedUint64Value = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedUint64Value, nameof(requiredRepeatedUint64Value)) }, - RequiredRepeatedFloatValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFloatValue, nameof(requiredRepeatedFloatValue)) }, - RequiredRepeatedDoubleValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedDoubleValue, nameof(requiredRepeatedDoubleValue)) }, - RequiredRepeatedStringValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedStringValue, nameof(requiredRepeatedStringValue)) }, - RequiredRepeatedBoolValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBoolValue, nameof(requiredRepeatedBoolValue)) }, - RequiredRepeatedBytesValue = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytesValue, nameof(requiredRepeatedBytesValue)) }, - OptionalSingularInt32 = optionalSingularInt32 ?? 0, // Optional - OptionalSingularInt64 = optionalSingularInt64 ?? 0L, // Optional - OptionalSingularFloat = optionalSingularFloat ?? 0.0f, // Optional - OptionalSingularDouble = optionalSingularDouble ?? 0.0, // Optional - OptionalSingularBool = optionalSingularBool ?? false, // Optional - OptionalSingularEnum = optionalSingularEnum ?? TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, // Optional - OptionalSingularString = optionalSingularString ?? "", // Optional - OptionalSingularBytes = optionalSingularBytes ?? pb::ByteString.Empty, // Optional - OptionalSingularMessage = optionalSingularMessage, // Optional - OptionalSingularResourceName = optionalSingularResourceName ?? "", // Optional - OptionalSingularResourceNameOneof = optionalSingularResourceNameOneof ?? "", // Optional - OptionalSingularResourceNameCommon = optionalSingularResourceNameCommon ?? "", // Optional - OptionalSingularFixed32 = optionalSingularFixed32 ?? 0, // Optional - OptionalSingularFixed64 = optionalSingularFixed64 ?? 0L, // Optional - OptionalRepeatedInt32 = { optionalRepeatedInt32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedInt64 = { optionalRepeatedInt64 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFloat = { optionalRepeatedFloat ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedDouble = { optionalRepeatedDouble ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBool = { optionalRepeatedBool ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedEnum = { optionalRepeatedEnum ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional - OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional - AnyValue = anyValue, // Optional - StructValue = structValue, // Optional - ValueValue = valueValue, // Optional - ListValueValue = listValueValue, // Optional - TimeValue = timeValue, // Optional - DurationValue = durationValue, // Optional - FieldMaskValue = fieldMaskValue, // Optional - Int32Value = int32Value, // Optional - Uint32Value = uint32Value, // Optional - Int64Value = int64Value, // Optional - Uint64Value = uint64Value, // Optional - FloatValue = floatValue, // Optional - DoubleValue = doubleValue, // Optional - StringValue = stringValue, // Optional - BoolValue = boolValue, // Optional - BytesValue = bytesValue, // Optional - RepeatedAnyValue = { repeatedAnyValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStructValue = { repeatedStructValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedValueValue = { repeatedValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedListValueValue = { repeatedListValueValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedTimeValue = { repeatedTimeValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDurationValue = { repeatedDurationValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedFieldMaskValue = { repeatedFieldMaskValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt32Value = { repeatedInt32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint32Value = { repeatedUint32Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedInt64Value = { repeatedInt64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedUint64Value = { repeatedUint64Value ?? linq::Enumerable.Empty() }, // Optional - RepeatedFloatValue = { repeatedFloatValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedDoubleValue = { repeatedDoubleValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedStringValue = { repeatedStringValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBoolValue = { repeatedBoolValue ?? linq::Enumerable.Empty() }, // Optional - RepeatedBytesValue = { repeatedBytesValue ?? linq::Enumerable.Empty() }, // Optional - }, - callSettings); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - TestOptionalRequiredFlatteningParamsRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Test optional flattening parameters of all types - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task TestOptionalRequiredFlatteningParamsAsync( - TestOptionalRequiredFlatteningParamsRequest request, - st::CancellationToken cancellationToken) => TestOptionalRequiredFlatteningParamsAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Test optional flattening parameters of all types - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( - TestOptionalRequiredFlatteningParamsRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ArchiveName source, - ArchiveName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - SourceAsArchiveName = source, // Optional - DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ArchiveName source, - ArchiveName destination, - scg::IEnumerable publishers, - ProjectName project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - ArchiveName source, - ArchiveName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - SourceAsArchiveName = source, // Optional - DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ArchiveName source, - ShelfName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - SourceAsArchiveName = source, // Optional - DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ArchiveName source, - ShelfName destination, - scg::IEnumerable publishers, - ProjectName project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - ArchiveName source, - ShelfName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - SourceAsArchiveName = source, // Optional - DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ArchiveName source, - ProjectName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - SourceAsArchiveName = source, // Optional - DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ArchiveName source, - ProjectName destination, - scg::IEnumerable publishers, - ProjectName project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - ArchiveName source, - ProjectName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - SourceAsArchiveName = source, // Optional - DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ShelfName source, - ArchiveName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - SourceAsShelfName = source, // Optional - DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ShelfName source, - ArchiveName destination, - scg::IEnumerable publishers, - ProjectName project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - ShelfName source, - ArchiveName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - SourceAsShelfName = source, // Optional - DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ShelfName source, - ShelfName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - SourceAsShelfName = source, // Optional - DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ShelfName source, - ShelfName destination, - scg::IEnumerable publishers, - ProjectName project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - ShelfName source, - ShelfName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - SourceAsShelfName = source, // Optional - DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ShelfName source, - ProjectName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - SourceAsShelfName = source, // Optional - DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ShelfName source, - ProjectName destination, - scg::IEnumerable publishers, - ProjectName project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - ShelfName source, - ProjectName destination, - scg::IEnumerable publishers, - ProjectName project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - SourceAsShelfName = source, // Optional - DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - ProjectAsProjectName = project, // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. + /// + /// If not null, applies overrides to this RPC call. /// /// /// The RPC response. /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); + public virtual TestOptionalRequiredFlatteningParamsResponse TestOptionalRequiredFlatteningParams( + TestOptionalRequiredFlatteningParamsRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// @@ -25853,14 +21098,14 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - ProjectName source, + ArchiveName source, ArchiveName destination, scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { - SourceAsProjectName = source, // Optional + SourceAsArchiveName = source, // Optional DestinationAsArchiveName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional @@ -25889,7 +21134,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - ProjectName source, + ArchiveName source, ArchiveName destination, scg::IEnumerable publishers, ProjectName project, @@ -25922,14 +21167,14 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual MoveBooksResponse MoveBooks( - ProjectName source, + ArchiveName source, ArchiveName destination, scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { - SourceAsProjectName = source, // Optional + SourceAsArchiveName = source, // Optional DestinationAsArchiveName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional @@ -25958,119 +21203,14 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, - scg::IEnumerable publishers, - string project, - st::CancellationToken cancellationToken) => MoveBooksAsync( - source, - destination, - publishers, - project, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - string source, - string destination, - scg::IEnumerable publishers, - string project, - gaxgrpc::CallSettings callSettings = null) => MoveBooks( - new MoveBooksRequest - { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional - }, - callSettings); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - ProjectName source, + ArchiveName source, ShelfName destination, scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { - SourceAsProjectName = source, // Optional + SourceAsArchiveName = source, // Optional DestinationAsShelfName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional @@ -26099,7 +21239,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - ProjectName source, + ArchiveName source, ShelfName destination, scg::IEnumerable publishers, ProjectName project, @@ -26132,14 +21272,14 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual MoveBooksResponse MoveBooks( - ProjectName source, + ArchiveName source, ShelfName destination, scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { - SourceAsProjectName = source, // Optional + SourceAsArchiveName = source, // Optional DestinationAsShelfName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional @@ -26168,17 +21308,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - string source, - string destination, + ArchiveName source, + ProjectName destination, scg::IEnumerable publishers, - string project, + ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional + SourceAsArchiveName = source, // Optional + DestinationAsProjectName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26204,10 +21344,10 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - string source, - string destination, + ArchiveName source, + ProjectName destination, scg::IEnumerable publishers, - string project, + ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, destination, @@ -26237,17 +21377,17 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual MoveBooksResponse MoveBooks( - string source, - string destination, + ArchiveName source, + ProjectName destination, scg::IEnumerable publishers, - string project, + ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional + SourceAsArchiveName = source, // Optional + DestinationAsProjectName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26273,15 +21413,15 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - ProjectName source, - ProjectName destination, + ShelfName source, + ArchiveName destination, scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { - SourceAsProjectName = source, // Optional - DestinationAsProjectName = destination, // Optional + SourceAsShelfName = source, // Optional + DestinationAsArchiveName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, @@ -26309,8 +21449,8 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - ProjectName source, - ProjectName destination, + ShelfName source, + ArchiveName destination, scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( @@ -26342,15 +21482,15 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual MoveBooksResponse MoveBooks( - ProjectName source, - ProjectName destination, + ShelfName source, + ArchiveName destination, scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { - SourceAsProjectName = source, // Optional - DestinationAsProjectName = destination, // Optional + SourceAsShelfName = source, // Optional + DestinationAsArchiveName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, @@ -26378,17 +21518,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - string source, - string destination, + ShelfName source, + ShelfName destination, scg::IEnumerable publishers, - string project, + ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional + SourceAsShelfName = source, // Optional + DestinationAsShelfName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26413,11 +21553,11 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task MoveBooksAsync( - string source, - string destination, + public virtual stt::Task MoveBooksAsync( + ShelfName source, + ShelfName destination, scg::IEnumerable publishers, - string project, + ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, destination, @@ -26447,17 +21587,17 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual MoveBooksResponse MoveBooks( - string source, - string destination, + ShelfName source, + ShelfName destination, scg::IEnumerable publishers, - string project, + ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional + SourceAsShelfName = source, // Optional + DestinationAsShelfName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26483,17 +21623,17 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - string source, - string destination, + ShelfName source, + ProjectName destination, scg::IEnumerable publishers, - string project, + ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional + SourceAsShelfName = source, // Optional + DestinationAsProjectName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26519,10 +21659,10 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task MoveBooksAsync( - string source, - string destination, + ShelfName source, + ProjectName destination, scg::IEnumerable publishers, - string project, + ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, destination, @@ -26552,83 +21692,33 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual MoveBooksResponse MoveBooks( - string source, - string destination, + ShelfName source, + ProjectName destination, scg::IEnumerable publishers, - string project, + ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { - Source = source ?? "", // Optional - Destination = destination ?? "", // Optional + SourceAsShelfName = source, // Optional + DestinationAsProjectName = destination, // Optional Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional - Project = project ?? "", // Optional + ProjectAsProjectName = project, // Optional }, callSettings); /// /// /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - MoveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// + /// /// - /// - /// - /// The request object containing all of the parameters for the API call. /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task MoveBooksAsync( - MoveBooksRequest request, - st::CancellationToken cancellationToken) => MoveBooksAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// + /// /// - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. /// - /// - /// The RPC response. - /// - public virtual MoveBooksResponse MoveBooks( - MoveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// - /// - /// + /// /// /// - /// + /// /// /// /// @@ -26637,14 +21727,18 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - ArchiveName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( - new ArchiveBooksRequest + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest { - SourceAsArchiveName = source, // Optional - ArchiveAsArchiveName = archive, // Optional + SourceAsProjectName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26654,7 +21748,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26663,12 +21763,16 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - ArchiveName source, - ArchiveName archive, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( source, - archive, + destination, + publishers, + project, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -26677,49 +21781,33 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// /// /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual ArchiveBooksResponse ArchiveBooks( - ArchiveName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( - new ArchiveBooksRequest - { - SourceAsArchiveName = source, // Optional - ArchiveAsArchiveName = archive, // Optional - }, - callSettings); - - /// - /// - /// - /// + /// /// /// - /// + /// /// /// /// /// If not null, applies overrides to this RPC call. /// /// - /// A Task containing the RPC response. + /// The RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( - new ArchiveBooksRequest + public virtual MoveBooksResponse MoveBooks( + ProjectName source, + ArchiveName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + DestinationAsArchiveName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26729,46 +21817,33 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// /// /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( - source, - archive, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// - /// - /// + /// /// /// - /// + /// /// /// /// /// If not null, applies overrides to this RPC call. /// /// - /// The RPC response. + /// A Task containing the RPC response. /// - public virtual ArchiveBooksResponse ArchiveBooks( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( - new ArchiveBooksRequest + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26778,33 +21853,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task ArchiveBooksAsync( - ShelfName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( - new ArchiveBooksRequest - { - SourceAsShelfName = source, // Optional - ArchiveAsArchiveName = archive, // Optional - }, - callSettings); - - /// + /// /// - /// - /// + /// + /// /// /// - /// + /// /// /// /// @@ -26813,12 +21868,16 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - ShelfName source, - ArchiveName archive, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( source, - archive, + destination, + publishers, + project, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -26827,7 +21886,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26836,14 +21901,18 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual ArchiveBooksResponse ArchiveBooks( - ShelfName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( - new ArchiveBooksRequest + public virtual MoveBooksResponse MoveBooks( + ProjectName source, + ShelfName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest { - SourceAsShelfName = source, // Optional - ArchiveAsArchiveName = archive, // Optional + SourceAsProjectName = source, // Optional + DestinationAsShelfName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26853,7 +21922,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26862,14 +21937,18 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( - new ArchiveBooksRequest + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26879,7 +21958,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26888,12 +21973,16 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( + public virtual stt::Task MoveBooksAsync( + ProjectName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + st::CancellationToken cancellationToken) => MoveBooksAsync( source, - archive, + destination, + publishers, + project, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -26902,7 +21991,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26911,14 +22006,18 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual ArchiveBooksResponse ArchiveBooks( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( - new ArchiveBooksRequest + public virtual MoveBooksResponse MoveBooks( + ProjectName source, + ProjectName destination, + scg::IEnumerable publishers, + ProjectName project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + DestinationAsProjectName = destination, // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + ProjectAsProjectName = project, // Optional }, callSettings); @@ -26928,7 +22027,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26937,14 +22042,18 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - ProjectName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( - new ArchiveBooksRequest + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( + new MoveBooksRequest { - SourceAsProjectName = source, // Optional - ArchiveAsArchiveName = archive, // Optional + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional }, callSettings); @@ -26954,7 +22063,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26963,12 +22078,16 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - ProjectName source, - ArchiveName archive, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( + public virtual stt::Task MoveBooksAsync( + string source, + string destination, + scg::IEnumerable publishers, + string project, + st::CancellationToken cancellationToken) => MoveBooksAsync( source, - archive, + destination, + publishers, + project, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -26977,7 +22096,13 @@ namespace Google.Example.Library.V1 /// /// /// - /// + /// + /// + /// + /// + /// + /// + /// /// /// /// @@ -26986,25 +22111,26 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual ArchiveBooksResponse ArchiveBooks( - ProjectName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( - new ArchiveBooksRequest + public virtual MoveBooksResponse MoveBooks( + string source, + string destination, + scg::IEnumerable publishers, + string project, + gaxgrpc::CallSettings callSettings = null) => MoveBooks( + new MoveBooksRequest { - SourceAsProjectName = source, // Optional - ArchiveAsArchiveName = archive, // Optional + Source = source ?? "", // Optional + Destination = destination ?? "", // Optional + Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + Project = project ?? "", // Optional }, callSettings); /// /// /// - /// - /// - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -27012,25 +22138,18 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( - new ArchiveBooksRequest - { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional - }, - callSettings); + public virtual stt::Task MoveBooksAsync( + MoveBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// /// - /// - /// - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -27038,22 +22157,17 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, - st::CancellationToken cancellationToken) => ArchiveBooksAsync( - source, - archive, + public virtual stt::Task MoveBooksAsync( + MoveBooksRequest request, + st::CancellationToken cancellationToken) => MoveBooksAsync( + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// /// - /// - /// - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -27061,16 +22175,12 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual ArchiveBooksResponse ArchiveBooks( - string source, - string archive, - gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( - new ArchiveBooksRequest - { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional - }, - callSettings); + public virtual MoveBooksResponse MoveBooks( + MoveBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// @@ -27088,13 +22198,13 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, + ArchiveName source, + ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27114,8 +22224,8 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task ArchiveBooksAsync( - string source, - string archive, + ArchiveName source, + ArchiveName archive, st::CancellationToken cancellationToken) => ArchiveBooksAsync( source, archive, @@ -27137,21 +22247,24 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual ArchiveBooksResponse ArchiveBooks( - string source, - string archive, + ArchiveName source, + ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -27160,17 +22273,24 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task ArchiveBooksAsync( - ArchiveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + ShelfName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( + new ArchiveBooksRequest + { + SourceAsShelfName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// A to use for this RPC. @@ -27179,16 +22299,21 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task ArchiveBooksAsync( - ArchiveBooksRequest request, + ShelfName source, + ArchiveName archive, st::CancellationToken cancellationToken) => ArchiveBooksAsync( - request, + source, + archive, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// /// - /// - /// The request object containing all of the parameters for the API call. + /// + /// + /// + /// + /// /// /// /// If not null, applies overrides to this RPC call. @@ -27197,11 +22322,15 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual ArchiveBooksResponse ArchiveBooks( - ArchiveBooksRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } + ShelfName source, + ArchiveName archive, + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( + new ArchiveBooksRequest + { + SourceAsShelfName = source, // Optional + ArchiveAsArchiveName = archive, // Optional + }, + callSettings); /// /// @@ -27218,13 +22347,13 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task> LongRunningArchiveBooksAsync( - ArchiveName source, + public virtual stt::Task ArchiveBooksAsync( + ProjectName source, ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( new ArchiveBooksRequest { - SourceAsArchiveName = source, // Optional + SourceAsProjectName = source, // Optional ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27244,10 +22373,10 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task> LongRunningArchiveBooksAsync( - ArchiveName source, + public virtual stt::Task ArchiveBooksAsync( + ProjectName source, ArchiveName archive, - st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( + st::CancellationToken cancellationToken) => ArchiveBooksAsync( source, archive, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); @@ -27267,13 +22396,13 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual lro::Operation LongRunningArchiveBooks( - ArchiveName source, + public virtual ArchiveBooksResponse ArchiveBooks( + ProjectName source, ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( new ArchiveBooksRequest { - SourceAsArchiveName = source, // Optional + SourceAsProjectName = source, // Optional ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27293,10 +22422,10 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task> LongRunningArchiveBooksAsync( + public virtual stt::Task ArchiveBooksAsync( string source, string archive, - gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( + gaxgrpc::CallSettings callSettings = null) => ArchiveBooksAsync( new ArchiveBooksRequest { Source = source ?? "", // Optional @@ -27319,10 +22448,10 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task> LongRunningArchiveBooksAsync( + public virtual stt::Task ArchiveBooksAsync( string source, string archive, - st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( + st::CancellationToken cancellationToken) => ArchiveBooksAsync( source, archive, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); @@ -27342,10 +22471,10 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual lro::Operation LongRunningArchiveBooks( + public virtual ArchiveBooksResponse ArchiveBooks( string source, string archive, - gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( + gaxgrpc::CallSettings callSettings = null) => ArchiveBooks( new ArchiveBooksRequest { Source = source ?? "", // Optional @@ -27356,11 +22485,8 @@ namespace Google.Example.Library.V1 /// /// /// - /// - /// - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -27368,25 +22494,18 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task> LongRunningArchiveBooksAsync( - ShelfName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( - new ArchiveBooksRequest - { - SourceAsShelfName = source, // Optional - ArchiveAsArchiveName = archive, // Optional - }, - callSettings); + public virtual stt::Task ArchiveBooksAsync( + ArchiveBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// /// - /// - /// - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// A to use for this RPC. @@ -27394,22 +22513,17 @@ namespace Google.Example.Library.V1 /// /// A Task containing the RPC response. /// - public virtual stt::Task> LongRunningArchiveBooksAsync( - ShelfName source, - ArchiveName archive, - st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( - source, - archive, + public virtual stt::Task ArchiveBooksAsync( + ArchiveBooksRequest request, + st::CancellationToken cancellationToken) => ArchiveBooksAsync( + request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// /// /// - /// - /// - /// - /// - /// + /// + /// The request object containing all of the parameters for the API call. /// /// /// If not null, applies overrides to this RPC call. @@ -27417,16 +22531,12 @@ namespace Google.Example.Library.V1 /// /// The RPC response. /// - public virtual lro::Operation LongRunningArchiveBooks( - ShelfName source, - ArchiveName archive, - gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( - new ArchiveBooksRequest - { - SourceAsShelfName = source, // Optional - ArchiveAsArchiveName = archive, // Optional - }, - callSettings); + public virtual ArchiveBooksResponse ArchiveBooks( + ArchiveBooksRequest request, + gaxgrpc::CallSettings callSettings = null) + { + throw new sys::NotImplementedException(); + } /// /// @@ -27444,13 +22554,13 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task> LongRunningArchiveBooksAsync( - string source, - string archive, + ArchiveName source, + ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27470,8 +22580,8 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task> LongRunningArchiveBooksAsync( - string source, - string archive, + ArchiveName source, + ArchiveName archive, st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( source, archive, @@ -27493,13 +22603,13 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual lro::Operation LongRunningArchiveBooks( - string source, - string archive, + ArchiveName source, + ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsArchiveName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27519,12 +22629,12 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task> LongRunningArchiveBooksAsync( - ProjectName source, + ShelfName source, ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( new ArchiveBooksRequest { - SourceAsProjectName = source, // Optional + SourceAsShelfName = source, // Optional ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27545,7 +22655,7 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task> LongRunningArchiveBooksAsync( - ProjectName source, + ShelfName source, ArchiveName archive, st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( source, @@ -27568,12 +22678,12 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual lro::Operation LongRunningArchiveBooks( - ProjectName source, + ShelfName source, ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( new ArchiveBooksRequest { - SourceAsProjectName = source, // Optional + SourceAsShelfName = source, // Optional ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27594,13 +22704,13 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task> LongRunningArchiveBooksAsync( - string source, - string archive, + ProjectName source, + ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooksAsync( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27620,8 +22730,8 @@ namespace Google.Example.Library.V1 /// A Task containing the RPC response. /// public virtual stt::Task> LongRunningArchiveBooksAsync( - string source, - string archive, + ProjectName source, + ArchiveName archive, st::CancellationToken cancellationToken) => LongRunningArchiveBooksAsync( source, archive, @@ -27643,13 +22753,13 @@ namespace Google.Example.Library.V1 /// The RPC response. /// public virtual lro::Operation LongRunningArchiveBooks( - string source, - string archive, + ProjectName source, + ArchiveName archive, gaxgrpc::CallSettings callSettings = null) => LongRunningArchiveBooks( new ArchiveBooksRequest { - Source = source ?? "", // Optional - Archive = archive ?? "", // Optional + SourceAsProjectName = source, // Optional + ArchiveAsArchiveName = archive, // Optional }, callSettings); @@ -27844,39 +22954,6 @@ namespace Google.Example.Library.V1 /// *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The client-server stream. - /// - *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The client-server stream. - /// - *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - - /// - /// - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The client-server stream. - /// - *** ERROR: Cannot handle streaming type 'BidiStreaming' *** - /// /// /// From 705dea8ec20eb49cc6a43febadd76833d1dc18e5 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 15:37:41 +0800 Subject: [PATCH 28/36] fourth --- .../api/codegen/config/FlatteningConfig.java | 69 ++++++++++++++++--- .../java/JavaApiMethodTransformer.java | 12 +++- .../java/JavaSurfaceTestTransformer.java | 4 +- 3 files changed, 72 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index df5a95e8c4..e6abe25767 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -45,6 +45,24 @@ public abstract class FlatteningConfig { // Maps the name of the parameter in this flattening to its FieldConfig. public abstract ImmutableMap getFlattenedFieldConfigs(); + // Returns the map from field names to the respective resource entity name, or empty string if the + // field + // is a repeated field or is not a resource type. + public Map getFieldResourceNameMap() { + return getFlattenedFieldConfigs() + .entrySet() + .stream() + .collect( + ImmutableMap.toImmutableMap( + entry -> entry.getKey(), + entry -> + entry.getValue().getField().isRepeated() + ? "" + : (entry.getValue().getResourceNameConfig() == null + ? "" + : entry.getValue().getResourceNameConfig().getEntityId()))); + } + /** * Appends to a map of a string representing a list of the fields in a flattening, to the * flattening config created from a method in the gapic config. @@ -328,15 +346,6 @@ private static List> collectFieldConfigs( for (Map flattening : flatteningConfigs) { for (FieldConfig fieldConfig : fieldConfigs) { Map newFlattening = new LinkedHashMap<>(flattening); - - // Types like List will have the same erasure as List, - // so we ignore resource name types on repeated field from API surfaces in Java and - // treat them as normal strings - if (fieldConfig.isRepeatedResourceNameTypeField()) { - newFlattening.put(parameter, fieldConfig.withResourceNameInSampleOnly()); - newFlatteningConfigs.add(newFlattening); - break; - } newFlattening.put(parameter, fieldConfig); newFlatteningConfigs.add(newFlattening); } @@ -448,6 +457,48 @@ public static boolean hasAnyResourceNameParameter(FlatteningConfig flatteningGro return hasAnyResourceNameParameter(flatteningGroup.getFlattenedFieldConfigs()); } + /** + * Convert all repeated fields to use resource name configs in samples only, and remove any + * possible duplicates during the process. + */ + public static List withRepeatedResourceInSampleOnly( + List flatteningConfigs) { + // This method removes all flattening configs that have the same method signature + // with another method after type erasure. + // + // For example, listFoos(List parent) and listFoos(List parent) + // will have the same method signature after type erasure in Java. In such cases + // we only keep the one that takes raw strings. + Set> existingTypeErasures = new HashSet<>(); + ImmutableList.Builder newFlattenings = ImmutableList.builder(); + for (FlatteningConfig flattening : flatteningConfigs) { + if (!hasAnyRepeatedResourceNameParameter(flattening)) { + newFlattenings.add(flattening); + continue; + } + Map erasure = flattening.getFieldResourceNameMap(); + if (!existingTypeErasures.contains(erasure)) { + existingTypeErasures.add(erasure); + newFlattenings.add(withRepeatedResourceInSampleOnly(flattening)); + } + } + return newFlattenings.build(); + } + + private static FlatteningConfig withRepeatedResourceInSampleOnly( + FlatteningConfig flatteningGroup) { + ImmutableMap.Builder newFlattening = ImmutableMap.builder(); + for (Map.Entry entry : + flatteningGroup.getFlattenedFieldConfigs().entrySet()) { + FieldConfig fieldConfig = entry.getValue(); + if (fieldConfig.isRepeatedResourceNameTypeField()) { + fieldConfig = fieldConfig.withResourceNameInSampleOnly(); + } + newFlattening.put(entry.getKey(), fieldConfig); + } + return new AutoValue_FlatteningConfig(newFlattening.build()); + } + private static boolean hasAnyResourceNameParameter( List> flatteningGroups) { return flatteningGroups.stream().anyMatch(FlatteningConfig::hasAnyResourceNameParameter); diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java index 4995eb25cf..32d6619d11 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaApiMethodTransformer.java @@ -113,7 +113,9 @@ private List generateUnaryMethods( InterfaceContext interfaceContext = methodContext.getSurfaceInterfaceContext(); MethodConfig methodConfig = methodContext.getMethodConfig(); if (methodConfig.isFlattening()) { - for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { + List flatteningConfigs = + FlatteningConfig.withRepeatedResourceInSampleOnly(methodConfig.getFlatteningConfigs()); + for (FlatteningConfig flatteningGroup : flatteningConfigs) { MethodContext flattenedMethodContext = interfaceContext.asFlattenedMethodContext(methodContext, flatteningGroup); @@ -175,7 +177,9 @@ private List generateLongRunningMethods( .saveNicknameFor("com.google.api.gax.rpc.OperationCallable"); MethodConfig methodConfig = methodContext.getMethodConfig(); if (methodConfig.isFlattening()) { - for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { + List flatteningConfigs = + FlatteningConfig.withRepeatedResourceInSampleOnly(methodConfig.getFlatteningConfigs()); + for (FlatteningConfig flatteningGroup : flatteningConfigs) { MethodContext flattenedMethodContext = interfaceContext .asFlattenedMethodContext(methodContext, flatteningGroup) @@ -207,7 +211,9 @@ private List generatePagedStreamingMethods( InterfaceContext interfaceContext = methodContext.getSurfaceInterfaceContext(); MethodConfig methodConfig = methodContext.getMethodConfig(); if (methodConfig.isFlattening()) { - for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { + List flatteningConfigs = + FlatteningConfig.withRepeatedResourceInSampleOnly(methodConfig.getFlatteningConfigs()); + for (FlatteningConfig flatteningGroup : flatteningConfigs) { MethodContext flattenedMethodContext = interfaceContext .asFlattenedMethodContext(methodContext, flatteningGroup) diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index 6fc33287db..7aec9ad8aa 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -300,7 +300,9 @@ private List createTestCaseViews(InterfaceContext context) { } else { clientMethodType = ClientMethodType.FlattenedMethod; } - for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { + for (FlatteningConfig flatteningGroup : + FlatteningConfig.withRepeatedResourceInSampleOnly( + methodConfig.getFlatteningConfigs())) { MethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); // We only generate tests against the overload that does not expose resource name From 6930276082ce1d816c16b348f4dc1f92085c809f Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 10:45:28 -0800 Subject: [PATCH 29/36] five --- .../api/codegen/config/FlatteningConfig.java | 55 +++-- .../testdata/csharp/csharp_library.baseline | 136 +++++++++--- ...amplegen_config_migration_library.baseline | 136 +++++++++--- .../testdata/csharp_library.baseline | 206 ++++++++++++------ 4 files changed, 379 insertions(+), 154 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index e6abe25767..1ca17ed42b 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -45,24 +45,6 @@ public abstract class FlatteningConfig { // Maps the name of the parameter in this flattening to its FieldConfig. public abstract ImmutableMap getFlattenedFieldConfigs(); - // Returns the map from field names to the respective resource entity name, or empty string if the - // field - // is a repeated field or is not a resource type. - public Map getFieldResourceNameMap() { - return getFlattenedFieldConfigs() - .entrySet() - .stream() - .collect( - ImmutableMap.toImmutableMap( - entry -> entry.getKey(), - entry -> - entry.getValue().getField().isRepeated() - ? "" - : (entry.getValue().getResourceNameConfig() == null - ? "" - : entry.getValue().getResourceNameConfig().getEntityId()))); - } - /** * Appends to a map of a string representing a list of the fields in a flattening, to the * flattening config created from a method in the gapic config. @@ -263,9 +245,6 @@ private static FlatteningConfig createFlatteningFromConfigProto( if (fieldConfig == null) { missing = true; } else { - if (fieldConfig.isRepeatedResourceNameTypeField()) { - fieldConfig = fieldConfig.withResourceNameInSampleOnly(); - } flattenedFieldConfigBuilder.put(parameter, fieldConfig); } } @@ -314,7 +293,7 @@ static List createFlatteningsFromProtoFile( // We also generate an overload that all singular resource names are treated as strings, // if there is at least one singular resource name field in the method surface. Note repeated // resource name fields are always treated as strings. - if (hasSingularResourceNameParameters(flatteningConfigs)) { + if (hasAnyResourceNameParameter(flatteningConfigs)) { flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0))); } return flatteningConfigs @@ -469,22 +448,40 @@ public static List withRepeatedResourceInSampleOnly( // For example, listFoos(List parent) and listFoos(List parent) // will have the same method signature after type erasure in Java. In such cases // we only keep the one that takes raw strings. - Set> existingTypeErasures = new HashSet<>(); + Set> existingSignatures = new HashSet<>(); ImmutableList.Builder newFlattenings = ImmutableList.builder(); for (FlatteningConfig flattening : flatteningConfigs) { - if (!hasAnyRepeatedResourceNameParameter(flattening)) { - newFlattenings.add(flattening); + Map signature = flattening.getFieldResourceNameMap(); + if (existingSignatures.contains(signature)) { continue; } - Map erasure = flattening.getFieldResourceNameMap(); - if (!existingTypeErasures.contains(erasure)) { - existingTypeErasures.add(erasure); - newFlattenings.add(withRepeatedResourceInSampleOnly(flattening)); + existingSignatures.add(signature); + if (hasAnyRepeatedResourceNameParameter(flattening)) { + flattening = withRepeatedResourceInSampleOnly(flattening); } + newFlattenings.add(flattening); } return newFlattenings.build(); } + // Returns the map from field names to resource entity names, or empty string if the + // field has no resource name config, uses resource config in samples only, or is + // a repeated field. + private Map getFieldResourceNameMap() { + ImmutableMap.Builder builder = ImmutableMap.builder(); + for (Map.Entry entry : getFlattenedFieldConfigs().entrySet()) { + FieldConfig fieldConfig = entry.getValue(); + if (fieldConfig.getField().isRepeated() + || fieldConfig.getResourceNameConfig() == null + || fieldConfig.useResourceNameTypeInSampleOnly()) { + builder.put(entry.getKey(), ""); + continue; + } + builder.put(entry.getKey(), fieldConfig.getResourceNameConfig().getEntityId()); + } + return builder.build(); + } + private static FlatteningConfig withRepeatedResourceInSampleOnly( FlatteningConfig flatteningGroup) { ImmutableMap.Builder newFlattening = ImmutableMap.builder(); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 853f9f9da9..dbfcff493c 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -16209,6 +16209,82 @@ namespace Google.Example.Library.V1 { } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + /// /// /// @@ -17285,9 +17361,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -17346,9 +17422,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -17410,9 +17486,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -17471,9 +17547,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -17911,9 +17987,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -17972,9 +18048,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -18534,9 +18610,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -18595,9 +18671,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -18659,9 +18735,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -18720,9 +18796,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 9620131c5d..ad2790b4b1 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -12606,6 +12606,82 @@ namespace Google.Example.Library.V1 { } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + BookNames = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + /// /// /// @@ -13586,9 +13662,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -13615,9 +13691,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -13679,9 +13755,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -13708,9 +13784,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional @@ -14052,9 +14128,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -14081,9 +14157,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -14515,9 +14591,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, - scg::IEnumerable requiredRepeatedResourceNameCommon, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, scg::IDictionary requiredMap, @@ -14544,9 +14620,9 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, - scg::IEnumerable optionalRepeatedResourceNameCommon, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, scg::IDictionary optionalMap, @@ -14608,9 +14684,9 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, - RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, + RequiredRepeatedResourceNameAsBookNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameCommonAsProjectNames = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, RequiredMap = { gax::GaxPreconditions.CheckNotNull(requiredMap, nameof(requiredMap)) }, @@ -14637,9 +14713,9 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNames = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameCommonAsProjectNames = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional OptionalMap = { optionalMap ?? gax::EmptyDictionary.Instance }, // Optional diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index bf33535d39..b2d409da3e 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -16671,6 +16671,82 @@ namespace Google.Example.Library.V1 { } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable asynchronous sequence of resources. + /// + public virtual gax::PagedAsyncEnumerable FindRelatedBooksAsync( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooksAsync( + new FindRelatedBooksRequest + { + BookNameOneofs = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The token returned from the previous request. + /// A value of null or an empty string retrieves the first page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. + /// A value of null or 0 uses a server-defined page size. + /// + /// + /// If not null, applies overrides to this RPC call. + /// + /// + /// A pageable sequence of resources. + /// + public virtual gax::PagedEnumerable FindRelatedBooks( + scg::IEnumerable names, + scg::IEnumerable shelves, + string pageToken = null, + int? pageSize = null, + gaxgrpc::CallSettings callSettings = null) => FindRelatedBooks( + new FindRelatedBooksRequest + { + BookNameOneofs = { gax::GaxPreconditions.CheckNotNull(names, nameof(names)) }, + ShelvesAsShelfNames = { gax::GaxPreconditions.CheckNotNull(shelves, nameof(shelves)) }, + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, + callSettings); + /// /// /// @@ -17669,8 +17745,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, @@ -17730,8 +17806,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, @@ -17794,8 +17870,8 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, @@ -17855,8 +17931,8 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNameOneofs = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional @@ -18295,8 +18371,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, @@ -18356,8 +18432,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, @@ -18918,8 +18994,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable requiredRepeatedString, scg::IEnumerable requiredRepeatedBytes, scg::IEnumerable requiredRepeatedMessage, - scg::IEnumerable requiredRepeatedResourceName, - scg::IEnumerable requiredRepeatedResourceNameOneof, + scg::IEnumerable requiredRepeatedResourceName, + scg::IEnumerable requiredRepeatedResourceNameOneof, scg::IEnumerable requiredRepeatedResourceNameCommon, scg::IEnumerable requiredRepeatedFixed32, scg::IEnumerable requiredRepeatedFixed64, @@ -18979,8 +19055,8 @@ namespace Google.Example.Library.V1 scg::IEnumerable optionalRepeatedString, scg::IEnumerable optionalRepeatedBytes, scg::IEnumerable optionalRepeatedMessage, - scg::IEnumerable optionalRepeatedResourceName, - scg::IEnumerable optionalRepeatedResourceNameOneof, + scg::IEnumerable optionalRepeatedResourceName, + scg::IEnumerable optionalRepeatedResourceNameOneof, scg::IEnumerable optionalRepeatedResourceNameCommon, scg::IEnumerable optionalRepeatedFixed32, scg::IEnumerable optionalRepeatedFixed64, @@ -19043,8 +19119,8 @@ namespace Google.Example.Library.V1 RequiredRepeatedString = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedString, nameof(requiredRepeatedString)) }, RequiredRepeatedBytes = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedBytes, nameof(requiredRepeatedBytes)) }, RequiredRepeatedMessage = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedMessage, nameof(requiredRepeatedMessage)) }, - RequiredRepeatedResourceName = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, - RequiredRepeatedResourceNameOneof = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, + RequiredRepeatedResourceNameAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceName, nameof(requiredRepeatedResourceName)) }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameOneof, nameof(requiredRepeatedResourceNameOneof)) }, RequiredRepeatedResourceNameCommon = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedResourceNameCommon, nameof(requiredRepeatedResourceNameCommon)) }, RequiredRepeatedFixed32 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed32, nameof(requiredRepeatedFixed32)) }, RequiredRepeatedFixed64 = { gax::GaxPreconditions.CheckNotNull(requiredRepeatedFixed64, nameof(requiredRepeatedFixed64)) }, @@ -19104,8 +19180,8 @@ namespace Google.Example.Library.V1 OptionalRepeatedString = { optionalRepeatedString ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedBytes = { optionalRepeatedBytes ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedMessage = { optionalRepeatedMessage ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceName = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional - OptionalRepeatedResourceNameOneof = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameAsBookNameOneofs = { optionalRepeatedResourceName ?? linq::Enumerable.Empty() }, // Optional + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { optionalRepeatedResourceNameOneof ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedResourceNameCommon = { optionalRepeatedResourceNameCommon ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed32 = { optionalRepeatedFixed32 ?? linq::Enumerable.Empty() }, // Optional OptionalRepeatedFixed64 = { optionalRepeatedFixed64 ?? linq::Enumerable.Empty() }, // Optional @@ -21100,14 +21176,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ArchiveName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsArchiveName = source, // Optional DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21136,7 +21212,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ArchiveName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21169,14 +21245,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ArchiveName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsArchiveName = source, // Optional DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21205,14 +21281,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ArchiveName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsArchiveName = source, // Optional DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21241,7 +21317,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ArchiveName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21274,14 +21350,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ArchiveName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsArchiveName = source, // Optional DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21310,14 +21386,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ArchiveName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsArchiveName = source, // Optional DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21346,7 +21422,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ArchiveName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21379,14 +21455,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ArchiveName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsArchiveName = source, // Optional DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21415,14 +21491,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ShelfName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsShelfName = source, // Optional DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21451,7 +21527,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ShelfName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21484,14 +21560,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ShelfName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsShelfName = source, // Optional DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21520,14 +21596,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ShelfName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsShelfName = source, // Optional DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21556,7 +21632,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ShelfName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21589,14 +21665,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ShelfName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsShelfName = source, // Optional DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21625,14 +21701,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ShelfName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsShelfName = source, // Optional DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21661,7 +21737,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ShelfName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21694,14 +21770,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ShelfName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsShelfName = source, // Optional DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21730,14 +21806,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ProjectName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsProjectName = source, // Optional DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21766,7 +21842,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ProjectName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21799,14 +21875,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ProjectName source, ArchiveName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsProjectName = source, // Optional DestinationAsArchiveName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21835,14 +21911,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ProjectName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsProjectName = source, // Optional DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21871,7 +21947,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ProjectName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -21904,14 +21980,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ProjectName source, ShelfName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsProjectName = source, // Optional DestinationAsShelfName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21940,14 +22016,14 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ProjectName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooksAsync( new MoveBooksRequest { SourceAsProjectName = source, // Optional DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); @@ -21976,7 +22052,7 @@ namespace Google.Example.Library.V1 public virtual stt::Task MoveBooksAsync( ProjectName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, st::CancellationToken cancellationToken) => MoveBooksAsync( source, @@ -22009,14 +22085,14 @@ namespace Google.Example.Library.V1 public virtual MoveBooksResponse MoveBooks( ProjectName source, ProjectName destination, - scg::IEnumerable publishers, + scg::IEnumerable publishers, ProjectName project, gaxgrpc::CallSettings callSettings = null) => MoveBooks( new MoveBooksRequest { SourceAsProjectName = source, // Optional DestinationAsProjectName = destination, // Optional - Publishers = { publishers ?? linq::Enumerable.Empty() }, // Optional + PublishersAsPublisherNames = { publishers ?? linq::Enumerable.Empty() }, // Optional ProjectAsProjectName = project, // Optional }, callSettings); From e5c25a11ba04a2f29a8b8bb06c5ee10910914983 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 12:50:17 -0800 Subject: [PATCH 30/36] six --- .../api/codegen/config/FlatteningConfig.java | 29 ++++ .../transformer/InitCodeTransformer.java | 8 +- .../CSharpGapicUnitTestTransformer.java | 19 ++- .../java/JavaSurfaceTestTransformer.java | 21 ++- .../testdata/csharp/csharp_library.baseline | 136 ++++++++-------- ...amplegen_config_migration_library.baseline | 124 +++++++-------- .../gapic/testdata/java/java_library.baseline | 18 +-- ...amplegen_config_migration_library.baseline | 18 +-- .../testdata/csharp_library.baseline | 148 +++++++++--------- .../testdata/java_library.baseline | 14 +- .../java_library_no_gapic_config.baseline | 46 +++--- ..._library_with_grpc_service_config.baseline | 14 +- 12 files changed, 319 insertions(+), 276 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 1ca17ed42b..cf2cdc2988 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -25,6 +25,7 @@ import com.google.api.tools.framework.model.SimpleLocation; import com.google.auto.value.AutoValue; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; @@ -35,7 +36,9 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; +import java.util.stream.Collectors; import javax.annotation.Nullable; /** FlatteningConfig represents a specific flattening configuration for a method. */ @@ -389,6 +392,32 @@ public Iterable getFlattenedFields() { return FieldConfig.toFieldTypeIterable(getFlattenedFieldConfigs().values()); } + /** Returns a multimap from google.api.method_signature string to flattening configs. */ + public static ImmutableListMultimap groupByMethodSignature( + List flatteningConfigs) { + return flatteningConfigs + .stream() + .collect( + ImmutableListMultimap.toImmutableListMultimap( + FlatteningConfig::getMethodSignature, f -> f)); + } + + /** + * Returns a flattening config for samples. Choose one with resource name types in API surface if + * possible. + */ + public static FlatteningConfig getFlatteningConfigForUnitTests( + List flatteningConfigs) { + Preconditions.checkArgument(flatteningConfigs.size() > 0, "empty flattening configs"); + Optional flattening = + flatteningConfigs.stream().filter(FlatteningConfig::hasAnyResourceNameParameter).findAny(); + return flattening.isPresent() ? flattening.get() : flatteningConfigs.get(0); + } + + private String getMethodSignature() { + return getFlattenedFieldConfigs().keySet().stream().collect(Collectors.joining(",")); + } + public FlatteningConfig withResourceNamesInSamplesOnly() { ImmutableMap newFlattenedFieldConfigs = withResourceNamesInSamplesOnly(getFlattenedFieldConfigs()); diff --git a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java index 3d02f8a5c1..c9114e5f23 100644 --- a/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/InitCodeTransformer.java @@ -179,9 +179,7 @@ List generateRequestAssertViews( String expectedValueIdentifier = getVariableName(methodContext, fieldItemTree); String expectedTransformFunction = null; String actualTransformFunction = null; - if (methodContext - .getFeatureConfig() - .useResourceNameFormatOptionInSample(methodContext, fieldConfig)) { + if (methodContext.getFeatureConfig().useResourceNameFormatOption(fieldConfig)) { if (fieldConfig.requiresParamTransformationFromAny()) { expectedTransformFunction = namer.getToStringMethod(); actualTransformFunction = namer.getToStringMethod(); @@ -192,9 +190,7 @@ List generateRequestAssertViews( expectedTransformFunction = namer.getResourceOneofCreateMethod(methodContext.getTypeTable(), fieldConfig); } - } else if (methodContext - .getFeatureConfig() - .useResourceNameConvertersInSample(methodContext, fieldConfig)) { + } else if (methodContext.getFeatureConfig().useResourceNameConverters(fieldConfig)) { if (fieldConfig.getField().isRepeated()) { actualTransformFunction = namer.getResourceTypeParseListMethodName(methodContext.getTypeTable(), fieldConfig); diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java index c528a509f7..140cc0f756 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java @@ -48,6 +48,8 @@ import com.google.api.codegen.viewmodel.testing.ClientTestClassView; import com.google.api.codegen.viewmodel.testing.ClientTestFileView; import com.google.api.codegen.viewmodel.testing.TestCaseView; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Multimaps; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -178,10 +180,9 @@ private List createTestCaseViews(GapicInterfaceContext context) { continue; } GapicMethodContext requestContext = context.asRequestMethodContext(method); - for (FlatteningConfig flatteningGroup : methodConfig.getFlatteningConfigs()) { - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - continue; - } + for (FlatteningConfig flatteningGroup : + getFlatteningConfigsForTests(methodConfig.getFlatteningConfigs())) { + GapicMethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); testCaseViews.add( @@ -290,4 +291,14 @@ private TestCaseView createFlattenedTestCase( initCodeRequestObjectContext, requestContext); } + + private static List getFlatteningConfigsForTests( + List flatteningConfigs) { + Collection> flatteningGroups = + Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); + return flatteningGroups + .stream() + .map(FlatteningConfig::getFlatteningConfigForUnitTests) + .collect(ImmutableList.toImmutableList()); + } } diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index 7aec9ad8aa..6ac1edac06 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -54,7 +54,10 @@ import com.google.api.codegen.viewmodel.testing.MockServiceView; import com.google.api.codegen.viewmodel.testing.SmokeTestClassView; import com.google.api.codegen.viewmodel.testing.TestCaseView; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Multimaps; import java.util.ArrayList; +import java.util.Collection; import java.util.List; /** A subclass of ModelToViewTransformer which translates an ApiModel into API tests in Java. */ @@ -301,15 +304,9 @@ private List createTestCaseViews(InterfaceContext context) { clientMethodType = ClientMethodType.FlattenedMethod; } for (FlatteningConfig flatteningGroup : - FlatteningConfig.withRepeatedResourceInSampleOnly( - methodConfig.getFlatteningConfigs())) { + getFlatteningConfigsForTests(methodConfig.getFlatteningConfigs())) { MethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); - // We only generate tests against the overload that does not expose resource name - // types on the surface to avoid combinatorial explosion of generated tests - if (FlatteningConfig.hasAnyResourceNameParameter(flatteningGroup)) { - continue; - } InitCodeContext initCodeContext = initCodeTransformer.createRequestInitCodeContext( methodContext, @@ -508,4 +505,14 @@ private void addGrpcStreamingTestImports( } } } + + private static List getFlatteningConfigsForTests( + List flatteningConfigs) { + Collection> flatteningGroups = + Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); + return flatteningGroups + .stream() + .map(FlatteningConfig::getFlatteningConfigForUnitTests) + .collect(ImmutableList.toImmutableList()); + } } diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index dbfcff493c..107535d97f 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -8037,7 +8037,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8064,7 +8064,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8091,7 +8091,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf @@ -8120,7 +8120,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf @@ -8149,7 +8149,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), StringBuilder = new StringBuilder(), }; @@ -8180,7 +8180,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), StringBuilder = new StringBuilder(), }; @@ -8265,7 +8265,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) @@ -8286,7 +8286,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) @@ -8347,8 +8347,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8376,8 +8376,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8459,7 +8459,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); CreateBookRequest expectedRequest = new CreateBookRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8489,7 +8489,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); CreateBookRequest expectedRequest = new CreateBookRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8719,7 +8719,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Book expectedResponse = new Book { @@ -8747,7 +8747,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Book expectedResponse = new Book { @@ -8829,7 +8829,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteBookRequest expectedRequest = new DeleteBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) @@ -8850,7 +8850,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteBookRequest expectedRequest = new DeleteBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) @@ -8911,7 +8911,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8941,7 +8941,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8971,7 +8971,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), OptionalFoo = "optionalFoo1822578535", Book = new Book(), UpdateMask = new FieldMask(), @@ -9007,7 +9007,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), OptionalFoo = "optionalFoo1822578535", Book = new Book(), UpdateMask = new FieldMask(), @@ -9099,8 +9099,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), - OtherShelfName = new ShelfName("[SHELF]"), + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -9129,8 +9129,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), - OtherShelfName = new ShelfName("[SHELF]"), + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -9215,7 +9215,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -9254,7 +9254,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -9351,8 +9351,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - Parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + ParentAsLocationParentNameOneof = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -9381,8 +9381,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), - Parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + ParentAsLocationParentNameOneof = LocationParentNameOneof.From(new ProjectName("[PROJECT]")), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -9467,10 +9467,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Place = new LocationName("[PROJECT]", "[LOCATION]"), - Folder = new FolderName("[FOLDER]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9501,10 +9501,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Place = new LocationName("[PROJECT]", "[LOCATION]"), - Folder = new FolderName("[FOLDER]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9595,7 +9595,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9623,7 +9623,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9705,7 +9705,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -9736,7 +9736,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -9864,9 +9864,9 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -9878,9 +9878,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -9925,9 +9925,9 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, OptionalRepeatedInt32 = { }, @@ -9939,9 +9939,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -10128,9 +10128,9 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -10142,9 +10142,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -10189,9 +10189,9 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, OptionalRepeatedInt32 = { }, @@ -10203,9 +10203,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index ad2790b4b1..538f85158a 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -4734,7 +4734,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -4761,7 +4761,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -4788,7 +4788,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf @@ -4817,7 +4817,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf @@ -4846,7 +4846,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), StringBuilder = new StringBuilder(), }; @@ -4877,7 +4877,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), StringBuilder = new StringBuilder(), }; @@ -4962,7 +4962,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) @@ -4983,7 +4983,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) @@ -5044,8 +5044,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -5073,8 +5073,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -5156,7 +5156,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); CreateBookRequest expectedRequest = new CreateBookRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -5186,7 +5186,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); CreateBookRequest expectedRequest = new CreateBookRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -5416,7 +5416,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Book expectedResponse = new Book { @@ -5444,7 +5444,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Book expectedResponse = new Book { @@ -5526,7 +5526,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteBookRequest expectedRequest = new DeleteBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) @@ -5547,7 +5547,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteBookRequest expectedRequest = new DeleteBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) @@ -5608,7 +5608,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -5638,7 +5638,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Book = new Book(), }; Book expectedResponse = new Book @@ -5668,7 +5668,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), OptionalFoo = "optionalFoo1822578535", Book = new Book(), UpdateMask = new FieldMask(), @@ -5704,7 +5704,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), OptionalFoo = "optionalFoo1822578535", Book = new Book(), UpdateMask = new FieldMask(), @@ -5796,8 +5796,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), - OtherShelfName = new ShelfName("[SHELF]"), + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -5826,8 +5826,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - Name = new BookName("[SHELF]", "[BOOK]"), - OtherShelfName = new ShelfName("[SHELF]"), + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -5912,7 +5912,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -5951,7 +5951,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), Comments = { new Comment @@ -6048,7 +6048,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -6076,7 +6076,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - Name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), + ArchivedBookName = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -6158,8 +6158,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -6188,8 +6188,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -6274,7 +6274,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -6302,7 +6302,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -6384,7 +6384,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -6415,7 +6415,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - Name = new BookName("[SHELF]", "[BOOK]"), + BookName = new BookName("[SHELF]", "[BOOK]"), IndexName = "default index", IndexMap = { @@ -6543,9 +6543,9 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -6557,9 +6557,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -6572,9 +6572,9 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, OptionalRepeatedInt32 = { }, @@ -6586,9 +6586,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, @@ -6743,9 +6743,9 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = new ProjectName("[PROJECT]"), + RequiredSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, RequiredRepeatedInt32 = { }, @@ -6757,9 +6757,9 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, - RequiredRepeatedResourceNameCommon = { }, + RequiredRepeatedResourceNameAsBookNames = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, + RequiredRepeatedResourceNameCommonAsProjectNames = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, RequiredMap = { }, @@ -6772,9 +6772,9 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameCommon = new ProjectName("[PROJECT]"), + OptionalSingularResourceNameAsBookName = new BookName("[SHELF]", "[BOOK]"), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameCommonAsProjectName = new ProjectName("[PROJECT]"), OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, OptionalRepeatedInt32 = { }, @@ -6786,9 +6786,9 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, - OptionalRepeatedResourceNameCommon = { }, + OptionalRepeatedResourceNameAsBookNames = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, + OptionalRepeatedResourceNameCommonAsProjectNames = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, OptionalMap = { }, diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline index c83570549c..d44df98145 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline @@ -15065,7 +15065,7 @@ public class LibraryClientTest { GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(BookName.from(altBookName), actualRequest.getAltBookName()); + Assert.assertEquals(Objects.toString(altBookName), actualRequest.getAltBookName()); Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); Assert.assertTrue( @@ -15384,8 +15384,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(formattedNames, ShelfBookName.parseList(actualRequest.getNamesList())); + Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15751,9 +15751,9 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, ShelfBookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getRequiredRepeatedResourceNameCommonList())); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); @@ -15812,9 +15812,9 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, ShelfBookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getOptionalRepeatedResourceNameCommonList())); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline index 7b40d31fd9..8c79e0979f 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline @@ -12548,7 +12548,7 @@ public class LibraryClientTest { GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); - Assert.assertEquals(BookName.from(altBookName), actualRequest.getAltBookName()); + Assert.assertEquals(Objects.toString(altBookName), actualRequest.getAltBookName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -12863,8 +12863,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(formattedNames, ShelfBookName.parseList(actualRequest.getNamesList())); + Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -13198,9 +13198,9 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, ShelfBookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getRequiredRepeatedResourceNameCommonList())); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); @@ -13227,9 +13227,9 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, ShelfBookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getOptionalRepeatedResourceNameCommonList())); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index b2d409da3e..0e98283da2 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -8239,7 +8239,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8266,7 +8266,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8293,7 +8293,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf @@ -8322,7 +8322,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), }; Shelf expectedResponse = new Shelf @@ -8351,7 +8351,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), StringBuilder = new StringBuilder(), }; @@ -8382,7 +8382,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetShelfRequest expectedRequest = new GetShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Message = new SomeMessage(), StringBuilder = new StringBuilder(), }; @@ -8467,7 +8467,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteShelf(expectedRequest, It.IsAny())) @@ -8488,7 +8488,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteShelfRequest expectedRequest = new DeleteShelfRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteShelfAsync(expectedRequest, It.IsAny())) @@ -8549,8 +8549,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8578,8 +8578,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MergeShelvesRequest expectedRequest = new MergeShelvesRequest { - Name = new ShelfName("[SHELF]"), - OtherShelfName = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Shelf expectedResponse = new Shelf { @@ -8661,7 +8661,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); CreateBookRequest expectedRequest = new CreateBookRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8691,7 +8691,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); CreateBookRequest expectedRequest = new CreateBookRequest { - Name = new ShelfName("[SHELF]"), + ShelfName = new ShelfName("[SHELF]"), Book = new Book(), }; Book expectedResponse = new Book @@ -8784,7 +8784,7 @@ namespace Google.Example.Library.V1.Tests { SeriesString = "foobar", }, - Publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), + PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), }; PublishSeriesResponse expectedResponse = new PublishSeriesResponse { @@ -8826,7 +8826,7 @@ namespace Google.Example.Library.V1.Tests { SeriesString = "foobar", }, - Publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), + PublisherAsPublisherName = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"), }; PublishSeriesResponse expectedResponse = new PublishSeriesResponse { @@ -8925,7 +8925,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Book expectedResponse = new Book { @@ -8953,7 +8953,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookRequest expectedRequest = new GetBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Book expectedResponse = new Book { @@ -9035,7 +9035,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteBookRequest expectedRequest = new DeleteBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteBook(expectedRequest, It.IsAny())) @@ -9056,7 +9056,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); DeleteBookRequest expectedRequest = new DeleteBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteBookAsync(expectedRequest, It.IsAny())) @@ -9117,7 +9117,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), Book = new Book(), }; Book expectedResponse = new Book @@ -9147,7 +9147,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), Book = new Book(), }; Book expectedResponse = new Book @@ -9177,7 +9177,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), OptionalFoo = "optionalFoo1822578535", Book = new Book(), UpdateMask = new FieldMask(), @@ -9213,7 +9213,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookRequest expectedRequest = new UpdateBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), OptionalFoo = "optionalFoo1822578535", Book = new Book(), UpdateMask = new FieldMask(), @@ -9305,8 +9305,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfName = new ShelfName("[SHELF]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -9335,8 +9335,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBookRequest expectedRequest = new MoveBookRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfName = new ShelfName("[SHELF]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), }; Book expectedResponse = new Book { @@ -9421,7 +9421,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), Comments = { new Comment @@ -9460,7 +9460,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); AddCommentsRequest expectedRequest = new AddCommentsRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), Comments = { new Comment @@ -9557,8 +9557,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - Name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Parent = new ProjectName("[PROJECT]"), + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + ParentAsProjectName = new ProjectName("[PROJECT]"), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -9587,8 +9587,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromArchiveRequest expectedRequest = new GetBookFromArchiveRequest { - Name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), - Parent = new ProjectName("[PROJECT]"), + ArchivedBookName = new ArchivedBookName("[ARCHIVE]", "[BOOK]"), + ParentAsProjectName = new ProjectName("[PROJECT]"), }; BookFromArchive expectedResponse = new BookFromArchive { @@ -9673,10 +9673,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Place = new LocationName("[PROJECT]", "[LOCATION]"), - Folder = new FolderName("[FOLDER]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9707,10 +9707,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAnywhereRequest expectedRequest = new GetBookFromAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - AltBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Place = new LocationName("[PROJECT]", "[LOCATION]"), - Folder = new FolderName("[FOLDER]"), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + AltBookNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + PlaceAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), + FolderAsFolderName = new FolderName("[FOLDER]"), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9801,7 +9801,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9829,7 +9829,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); GetBookFromAbsolutelyAnywhereRequest expectedRequest = new GetBookFromAbsolutelyAnywhereRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), }; BookFromAnywhere expectedResponse = new BookFromAnywhere { @@ -9911,7 +9911,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), IndexName = "default index", IndexMap = { @@ -9942,7 +9942,7 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); UpdateBookIndexRequest expectedRequest = new UpdateBookIndexRequest { - Name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), IndexName = "default index", IndexMap = { @@ -10070,8 +10070,8 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, @@ -10084,8 +10084,8 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameAsBookNameOneofs = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, @@ -10131,8 +10131,8 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, @@ -10145,8 +10145,8 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameAsBookNameOneofs = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, OptionalRepeatedResourceNameCommon = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, @@ -10334,8 +10334,8 @@ namespace Google.Example.Library.V1.Tests RequiredSingularString = "requiredSingularString-1949894503", RequiredSingularBytes = ByteString.CopyFromUtf8("-29"), RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), RequiredSingularResourceNameCommon = "requiredSingularResourceNameCommon-1126805002", RequiredSingularFixed32 = 720656715, RequiredSingularFixed64 = 720656810, @@ -10348,8 +10348,8 @@ namespace Google.Example.Library.V1.Tests RequiredRepeatedString = { }, RequiredRepeatedBytes = { }, RequiredRepeatedMessage = { }, - RequiredRepeatedResourceName = { }, - RequiredRepeatedResourceNameOneof = { }, + RequiredRepeatedResourceNameAsBookNameOneofs = { }, + RequiredRepeatedResourceNameOneofAsBookNameOneofs = { }, RequiredRepeatedResourceNameCommon = { }, RequiredRepeatedFixed32 = { }, RequiredRepeatedFixed64 = { }, @@ -10395,8 +10395,8 @@ namespace Google.Example.Library.V1.Tests OptionalSingularString = "optionalSingularString1852995162", OptionalSingularBytes = ByteString.CopyFromUtf8("2"), OptionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - OptionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OptionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OptionalSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), OptionalSingularResourceNameCommon = "optionalSingularResourceNameCommon-108123657", OptionalSingularFixed32 = 1648847958, OptionalSingularFixed64 = 1648847863, @@ -10409,8 +10409,8 @@ namespace Google.Example.Library.V1.Tests OptionalRepeatedString = { }, OptionalRepeatedBytes = { }, OptionalRepeatedMessage = { }, - OptionalRepeatedResourceName = { }, - OptionalRepeatedResourceNameOneof = { }, + OptionalRepeatedResourceNameAsBookNameOneofs = { }, + OptionalRepeatedResourceNameOneofAsBookNameOneofs = { }, OptionalRepeatedResourceNameCommon = { }, OptionalRepeatedFixed32 = { }, OptionalRepeatedFixed64 = { }, @@ -10751,10 +10751,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBooksRequest expectedRequest = new MoveBooksRequest { - Source = new ArchiveName("[ARCHIVE]"), - Destination = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - Project = new ProjectName("[PROJECT]"), + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + PublishersAsPublisherNames = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), }; MoveBooksResponse expectedResponse = new MoveBooksResponse { @@ -10782,10 +10782,10 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); MoveBooksRequest expectedRequest = new MoveBooksRequest { - Source = new ArchiveName("[ARCHIVE]"), - Destination = new ArchiveName("[ARCHIVE]"), - Publishers = { }, - Project = new ProjectName("[PROJECT]"), + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + DestinationAsArchiveName = new ArchiveName("[ARCHIVE]"), + PublishersAsPublisherNames = { }, + ProjectAsProjectName = new ProjectName("[PROJECT]"), }; MoveBooksResponse expectedResponse = new MoveBooksResponse { @@ -10855,8 +10855,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest { - Source = new ArchiveName("[ARCHIVE]"), - Archive = new ArchiveName("[ARCHIVE]"), + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), }; ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse { @@ -10882,8 +10882,8 @@ namespace Google.Example.Library.V1.Tests .Returns(new Mock().Object); ArchiveBooksRequest expectedRequest = new ArchiveBooksRequest { - Source = new ArchiveName("[ARCHIVE]"), - Archive = new ArchiveName("[ARCHIVE]"), + SourceAsArchiveName = new ArchiveName("[ARCHIVE]"), + ArchiveAsArchiveName = new ArchiveName("[ARCHIVE]"), }; ArchiveBooksResponse expectedResponse = new ArchiveBooksResponse { diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 031dd67044..4338be6a2f 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -16176,8 +16176,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(formattedNames, BookName.parseList(actualRequest.getNamesList())); + Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16501,8 +16501,8 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); @@ -16562,8 +16562,8 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); @@ -16767,7 +16767,7 @@ public class LibraryClientTest { Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(formattedPublishers, PublisherName.parseList(actualRequest.getPublishersList())); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline index ff3b4a1445..8daaddd3cc 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline @@ -10398,7 +10398,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10485,7 +10485,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); DeleteBookRequest actualRequest = (DeleteBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10534,7 +10534,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -10588,7 +10588,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookRequest actualRequest = (UpdateBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(optionalFoo, actualRequest.getOptionalFoo()); Assert.assertEquals(book, actualRequest.getBook()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -10645,7 +10645,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); MoveBookRequest actualRequest = (MoveBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(otherShelfName, ShelfName.parse(actualRequest.getOtherShelfName())); Assert.assertTrue( channelProvider.isHeaderSent( @@ -10782,7 +10782,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); AddCommentsRequest actualRequest = (AddCommentsRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(comments, actualRequest.getCommentsList()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -10886,8 +10886,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromAnywhereRequest actualRequest = (GetBookFromAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(altBookName, actualRequest.getAltBookName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); + Assert.assertEquals(altBookName, BookNames.parse(actualRequest.getAltBookName())); Assert.assertEquals(place, LocationName.parse(actualRequest.getPlace())); Assert.assertEquals(folder, FolderName.parse(actualRequest.getFolder())); Assert.assertTrue( @@ -10940,7 +10940,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookFromAbsolutelyAnywhereRequest actualRequest = (GetBookFromAbsolutelyAnywhereRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -10979,7 +10979,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); UpdateBookIndexRequest actualRequest = (UpdateBookIndexRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertEquals(indexName, actualRequest.getIndexName()); Assert.assertEquals(indexMap, actualRequest.getIndexMapMap()); Assert.assertTrue( @@ -11197,8 +11197,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(names, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(names, BookName.parseList(actualRequest.getNamesList())); + Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -11295,7 +11295,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -11343,7 +11343,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); GetBookRequest actualRequest = (GetBookRequest)actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(name, BookNames.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -11393,7 +11393,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(formattedPublishers, PublisherName.parseList(actualRequest.getPublishersList())); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( @@ -11750,8 +11750,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(requiredSingularString, actualRequest.getRequiredSingularString()); Assert.assertEquals(requiredSingularBytes, actualRequest.getRequiredSingularBytes()); Assert.assertEquals(requiredSingularMessage, actualRequest.getRequiredSingularMessage()); - Assert.assertEquals(requiredSingularResourceName, actualRequest.getRequiredSingularResourceName()); - Assert.assertEquals(requiredSingularResourceNameOneof, actualRequest.getRequiredSingularResourceNameOneof()); + Assert.assertEquals(requiredSingularResourceName, BookNames.parse(actualRequest.getRequiredSingularResourceName())); + Assert.assertEquals(requiredSingularResourceNameOneof, BookNames.parse(actualRequest.getRequiredSingularResourceNameOneof())); Assert.assertEquals(requiredSingularResourceNameCommon, actualRequest.getRequiredSingularResourceNameCommon()); Assert.assertEquals(requiredSingularFixed32, actualRequest.getRequiredSingularFixed32()); Assert.assertEquals(requiredSingularFixed64, actualRequest.getRequiredSingularFixed64()); @@ -11764,8 +11764,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(requiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(requiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(requiredRepeatedResourceName, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); + Assert.assertEquals(requiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); @@ -11811,8 +11811,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(optionalSingularString, actualRequest.getOptionalSingularString()); Assert.assertEquals(optionalSingularBytes, actualRequest.getOptionalSingularBytes()); Assert.assertEquals(optionalSingularMessage, actualRequest.getOptionalSingularMessage()); - Assert.assertEquals(optionalSingularResourceName, actualRequest.getOptionalSingularResourceName()); - Assert.assertEquals(optionalSingularResourceNameOneof, actualRequest.getOptionalSingularResourceNameOneof()); + Assert.assertEquals(optionalSingularResourceName, BookNames.parse(actualRequest.getOptionalSingularResourceName())); + Assert.assertEquals(optionalSingularResourceNameOneof, BookNames.parse(actualRequest.getOptionalSingularResourceNameOneof())); Assert.assertEquals(optionalSingularResourceNameCommon, actualRequest.getOptionalSingularResourceNameCommon()); Assert.assertEquals(optionalSingularFixed32, actualRequest.getOptionalSingularFixed32()); Assert.assertEquals(optionalSingularFixed64, actualRequest.getOptionalSingularFixed64()); @@ -11825,8 +11825,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(optionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(optionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(optionalRepeatedResourceName, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); + Assert.assertEquals(optionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline index 6d4dfc9df6..f180279141 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline @@ -16180,8 +16180,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, actualRequest.getNamesList()); - Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); + Assert.assertEquals(formattedNames, BookName.parseList(actualRequest.getNamesList())); + Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16505,8 +16505,8 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedRequiredRepeatedResourceName, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); @@ -16566,8 +16566,8 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedOptionalRepeatedResourceName, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); @@ -16771,7 +16771,7 @@ public class LibraryClientTest { Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); + Assert.assertEquals(formattedPublishers, PublisherName.parseList(actualRequest.getPublishersList())); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( From 52928a4513facdf8cc22a80e4b874e733719bf4d Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 13:10:48 -0800 Subject: [PATCH 31/36] seven --- .../java/JavaSurfaceTestTransformer.java | 1 + .../gapic/testdata/java/java_library.baseline | 16 ++++++++-------- ...a_samplegen_config_migration_library.baseline | 16 ++++++++-------- .../testdata/java_library.baseline | 14 +++++++------- .../java_library_no_gapic_config.baseline | 14 +++++++------- ...ava_library_with_grpc_service_config.baseline | 14 +++++++------- 6 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index 6ac1edac06..0d35fa86ff 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -508,6 +508,7 @@ private void addGrpcStreamingTestImports( private static List getFlatteningConfigsForTests( List flatteningConfigs) { + flatteningConfigs = FlatteningConfig.withRepeatedResourceInSampleOnly(flatteningConfigs); Collection> flatteningGroups = Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); return flatteningGroups diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline index d44df98145..ac3aa90e86 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_library.baseline @@ -15384,8 +15384,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, ShelfBookName.parseList(actualRequest.getNamesList())); - Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); + Assert.assertEquals(formattedNames, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -15751,9 +15751,9 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, ShelfBookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); - Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getRequiredRepeatedResourceNameCommonList())); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); @@ -15812,9 +15812,9 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, ShelfBookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); - Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getOptionalRepeatedResourceNameCommonList())); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline index 8c79e0979f..244eff919d 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/java/java_samplegen_config_migration_library.baseline @@ -12863,8 +12863,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, ShelfBookName.parseList(actualRequest.getNamesList())); - Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); + Assert.assertEquals(formattedNames, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -13198,9 +13198,9 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, ShelfBookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); - Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getRequiredRepeatedResourceNameCommonList())); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); Assert.assertEquals(requiredMap, actualRequest.getRequiredMapMap()); @@ -13227,9 +13227,9 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, ShelfBookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); - Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, ProjectName.parseList(actualRequest.getOptionalRepeatedResourceNameCommonList())); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); Assert.assertEquals(optionalMap, actualRequest.getOptionalMapMap()); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline index 4338be6a2f..031dd67044 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library.baseline @@ -16176,8 +16176,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, BookName.parseList(actualRequest.getNamesList())); - Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); + Assert.assertEquals(formattedNames, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16501,8 +16501,8 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); @@ -16562,8 +16562,8 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); @@ -16767,7 +16767,7 @@ public class LibraryClientTest { Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedPublishers, PublisherName.parseList(actualRequest.getPublishersList())); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline index 8daaddd3cc..64297ee011 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_no_gapic_config.baseline @@ -11197,8 +11197,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(names, BookName.parseList(actualRequest.getNamesList())); - Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); + Assert.assertEquals(names, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -11393,7 +11393,7 @@ public class LibraryServiceClientTest { Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedPublishers, PublisherName.parseList(actualRequest.getPublishersList())); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( @@ -11764,8 +11764,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(requiredRepeatedResourceName, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); - Assert.assertEquals(requiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); + Assert.assertEquals(requiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(requiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); @@ -11825,8 +11825,8 @@ public class LibraryServiceClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(optionalRepeatedResourceName, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); - Assert.assertEquals(optionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); + Assert.assertEquals(optionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(optionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline index f180279141..6d4dfc9df6 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/java_library_with_grpc_service_config.baseline @@ -16180,8 +16180,8 @@ public class LibraryClientTest { Assert.assertEquals(1, actualRequests.size()); FindRelatedBooksRequest actualRequest = (FindRelatedBooksRequest)actualRequests.get(0); - Assert.assertEquals(formattedNames, BookName.parseList(actualRequest.getNamesList())); - Assert.assertEquals(formattedShelves, ShelfName.parseList(actualRequest.getShelvesList())); + Assert.assertEquals(formattedNames, actualRequest.getNamesList()); + Assert.assertEquals(formattedShelves, actualRequest.getShelvesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -16505,8 +16505,8 @@ public class LibraryClientTest { Assert.assertEquals(requiredRepeatedString, actualRequest.getRequiredRepeatedStringList()); Assert.assertEquals(requiredRepeatedBytes, actualRequest.getRequiredRepeatedBytesList()); Assert.assertEquals(requiredRepeatedMessage, actualRequest.getRequiredRepeatedMessageList()); - Assert.assertEquals(formattedRequiredRepeatedResourceName, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameList())); - Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, BookName.parseList(actualRequest.getRequiredRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedRequiredRepeatedResourceName, actualRequest.getRequiredRepeatedResourceNameList()); + Assert.assertEquals(formattedRequiredRepeatedResourceNameOneof, actualRequest.getRequiredRepeatedResourceNameOneofList()); Assert.assertEquals(requiredRepeatedResourceNameCommon, actualRequest.getRequiredRepeatedResourceNameCommonList()); Assert.assertEquals(requiredRepeatedFixed32, actualRequest.getRequiredRepeatedFixed32List()); Assert.assertEquals(requiredRepeatedFixed64, actualRequest.getRequiredRepeatedFixed64List()); @@ -16566,8 +16566,8 @@ public class LibraryClientTest { Assert.assertEquals(optionalRepeatedString, actualRequest.getOptionalRepeatedStringList()); Assert.assertEquals(optionalRepeatedBytes, actualRequest.getOptionalRepeatedBytesList()); Assert.assertEquals(optionalRepeatedMessage, actualRequest.getOptionalRepeatedMessageList()); - Assert.assertEquals(formattedOptionalRepeatedResourceName, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameList())); - Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, BookName.parseList(actualRequest.getOptionalRepeatedResourceNameOneofList())); + Assert.assertEquals(formattedOptionalRepeatedResourceName, actualRequest.getOptionalRepeatedResourceNameList()); + Assert.assertEquals(formattedOptionalRepeatedResourceNameOneof, actualRequest.getOptionalRepeatedResourceNameOneofList()); Assert.assertEquals(optionalRepeatedResourceNameCommon, actualRequest.getOptionalRepeatedResourceNameCommonList()); Assert.assertEquals(optionalRepeatedFixed32, actualRequest.getOptionalRepeatedFixed32List()); Assert.assertEquals(optionalRepeatedFixed64, actualRequest.getOptionalRepeatedFixed64List()); @@ -16771,7 +16771,7 @@ public class LibraryClientTest { Assert.assertEquals(source, ArchiveName.parse(actualRequest.getSource())); Assert.assertEquals(destination, ArchiveName.parse(actualRequest.getDestination())); - Assert.assertEquals(formattedPublishers, PublisherName.parseList(actualRequest.getPublishersList())); + Assert.assertEquals(formattedPublishers, actualRequest.getPublishersList()); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( From 341481c751fb42dbb72c45a968fb10e1f82740c0 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 14:12:55 -0800 Subject: [PATCH 32/36] hachi --- .../api/codegen/config/FlatteningConfig.java | 6 +- .../CSharpGapicSnippetsTransformer.java | 25 +- .../CSharpGapicUnitTestTransformer.java | 2 +- .../java/JavaSurfaceTestTransformer.java | 2 +- .../testdata/csharp/csharp_library.baseline | 146 +++++++- ...amplegen_config_migration_library.baseline | 146 +++++++- .../testdata/csharp_library.baseline | 351 +++++++++++++++++- 7 files changed, 630 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index cf2cdc2988..41b0dbd471 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -403,10 +403,10 @@ public static ImmutableListMultimap groupByMethodSigna } /** - * Returns a flattening config for samples. Choose one with resource name types in API surface if - * possible. + * Returns a flattening config for samples and unit tests. Choose one with resource name types in + * API surface if possible. */ - public static FlatteningConfig getFlatteningConfigForUnitTests( + public static FlatteningConfig getFlatteningConfigForSnippetsOrUnitTests( List flatteningConfigs) { Preconditions.checkArgument(flatteningConfigs.size() > 0, "empty flattening configs"); Optional flattening = diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index 4a85729fea..16153b1619 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -43,6 +43,7 @@ import com.google.api.codegen.viewmodel.StaticLangApiMethodView; import com.google.api.codegen.viewmodel.ViewModel; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Multimaps; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -132,11 +133,7 @@ private List generateMethods(InterfaceContext co } else if (methodContext.isLongRunningMethodContext()) { if (methodConfig.isFlattening()) { ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); - flatteningGroups = - flatteningGroups - .stream() - .filter(f -> !FlatteningConfig.hasAnyResourceNameParameter(f)) - .collect(ImmutableList.toImmutableList()); + boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { FlatteningConfig flatteningGroup = flatteningGroups.get(i); @@ -151,12 +148,8 @@ private List generateMethods(InterfaceContext co methods.add(generateOperationRequestMethod(methodContext)); } else if (methodConfig.isPageStreaming()) { if (methodConfig.isFlattening()) { - ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); - flatteningGroups = - flatteningGroups - .stream() - .filter(f -> !FlatteningConfig.hasAnyResourceNameParameter(f)) - .collect(ImmutableList.toImmutableList()); + List flatteningGroups = + getFlatteningConfigsForSnippets(methodConfig.getFlatteningConfigs()); // Find flattenings that have ambiguous parameters, and mark them to use named arguments. // Ambiguity occurs in a page-stream flattening that has one or two extra string // parameters (that are not resource-names) compared to any other flattening of this same @@ -545,4 +538,14 @@ private StaticLangApiMethodView generateInitCode( builder, context, fieldConfigs, initCodeOutputType, Arrays.asList(callingForm)); return builder.build(); } + + private static List getFlatteningConfigsForSnippets( + List flatteningConfigs) { + Collection> flatteningGroups = + Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); + return flatteningGroups + .stream() + .map(FlatteningConfig::getFlatteningConfigForSnippetsOrUnitTests) + .collect(ImmutableList.toImmutableList()); + } } diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java index 140cc0f756..d2da5fb805 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java @@ -298,7 +298,7 @@ private static List getFlatteningConfigsForTests( Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); return flatteningGroups .stream() - .map(FlatteningConfig::getFlatteningConfigForUnitTests) + .map(FlatteningConfig::getFlatteningConfigForSnippetsOrUnitTests) .collect(ImmutableList.toImmutableList()); } } diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index 0d35fa86ff..dc7c665074 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -513,7 +513,7 @@ private static List getFlatteningConfigsForTests( Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); return flatteningGroups .stream() - .map(FlatteningConfig::getFlatteningConfigForUnitTests) + .map(FlatteningConfig::getFlatteningConfigForSnippetsOrUnitTests) .collect(ImmutableList.toImmutableList()); } } diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 107535d97f..964860d795 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -5537,7 +5537,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListBooksAsync public async Task ListBooksAsync() { - // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) + // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5582,7 +5582,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListBooks public void ListBooks() { - // Snippet: ListBooks(string,string,string,int?,CallSettings) + // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6030,7 +6030,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStringsAsync public async Task ListStringsAsync2() { - // Snippet: ListStringsAsync(string,string,int?,CallSettings) + // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6074,7 +6074,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStrings public void ListStrings2() { - // Snippet: ListStrings(string,string,int?,CallSettings) + // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6674,7 +6674,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync() { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6722,7 +6722,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooks public void FindRelatedBooks() { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6934,7 +6934,72 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync() + public async Task GetBigBookAsync1() + { + // Snippet: GetBigBookAsync(BookName,CallSettings) + // Additional: GetBigBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + await libraryServiceClient.GetBigBookAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigBookAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBook + public void GetBigBook1() + { + // Snippet: GetBigBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigBook(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigBook(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBookAsync + public async Task GetBigBookAsync2() { // Snippet: GetBigBookAsync(string,CallSettings) // Additional: GetBigBookAsync(string,CancellationToken) @@ -6967,7 +7032,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook() + public void GetBigBook2() { // Snippet: GetBigBook(string,CallSettings) // Create client @@ -7069,7 +7134,68 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync() + public async Task GetBigNothingAsync1() + { + // Snippet: GetBigNothingAsync(BookName,CallSettings) + // Additional: GetBigNothingAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + await libraryServiceClient.GetBigNothingAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothing + public void GetBigNothing1() + { + // Snippet: GetBigNothing(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigNothing(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigNothing(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothingAsync + public async Task GetBigNothingAsync2() { // Snippet: GetBigNothingAsync(string,CallSettings) // Additional: GetBigNothingAsync(string,CancellationToken) @@ -7100,7 +7226,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing() + public void GetBigNothing2() { // Snippet: GetBigNothing(string,CallSettings) // Create client diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 538f85158a..6d84dc7a9e 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -2374,7 +2374,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListBooksAsync public async Task ListBooksAsync() { - // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) + // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2419,7 +2419,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListBooks public void ListBooks() { - // Snippet: ListBooks(string,string,string,int?,CallSettings) + // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -2867,7 +2867,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStringsAsync public async Task ListStringsAsync2() { - // Snippet: ListStringsAsync(string,string,int?,CallSettings) + // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -2911,7 +2911,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStrings public void ListStrings2() { - // Snippet: ListStrings(string,string,int?,CallSettings) + // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3499,7 +3499,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync() { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -3547,7 +3547,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooks public void FindRelatedBooks() { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -3759,7 +3759,72 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync() + public async Task GetBigBookAsync1() + { + // Snippet: GetBigBookAsync(BookName,CallSettings) + // Additional: GetBigBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + await libraryServiceClient.GetBigBookAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigBookAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBook + public void GetBigBook1() + { + // Snippet: GetBigBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigBook(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigBook(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBookAsync + public async Task GetBigBookAsync2() { // Snippet: GetBigBookAsync(string,CallSettings) // Additional: GetBigBookAsync(string,CancellationToken) @@ -3792,7 +3857,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook() + public void GetBigBook2() { // Snippet: GetBigBook(string,CallSettings) // Create client @@ -3894,7 +3959,68 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync() + public async Task GetBigNothingAsync1() + { + // Snippet: GetBigNothingAsync(BookName,CallSettings) + // Additional: GetBigNothingAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + await libraryServiceClient.GetBigNothingAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothing + public void GetBigNothing1() + { + // Snippet: GetBigNothing(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Operation response = + libraryServiceClient.GetBigNothing(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigNothing(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothingAsync + public async Task GetBigNothingAsync2() { // Snippet: GetBigNothingAsync(string,CallSettings) // Additional: GetBigNothingAsync(string,CancellationToken) @@ -3925,7 +4051,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing() + public void GetBigNothing2() { // Snippet: GetBigNothing(string,CallSettings) // Create client diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index 0e98283da2..c0d8c85b9d 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -5580,7 +5580,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListBooksAsync public async Task ListBooksAsync() { - // Snippet: ListBooksAsync(string,string,string,int?,CallSettings) + // Snippet: ListBooksAsync(ShelfName,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -5625,7 +5625,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListBooks public void ListBooks() { - // Snippet: ListBooks(string,string,string,int?,CallSettings) + // Snippet: ListBooks(ShelfName,string,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6073,7 +6073,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStringsAsync public async Task ListStringsAsync2() { - // Snippet: ListStringsAsync(string,string,int?,CallSettings) + // Snippet: ListStringsAsync(IResourceName,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6117,7 +6117,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for ListStrings public void ListStrings2() { - // Snippet: ListStrings(string,string,int?,CallSettings) + // Snippet: ListStrings(IResourceName,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6717,7 +6717,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooksAsync public async Task FindRelatedBooksAsync() { - // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooksAsync(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6765,7 +6765,7 @@ namespace Google.Example.Library.V1.Snippets /// Snippet for FindRelatedBooks public void FindRelatedBooks() { - // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) + // Snippet: FindRelatedBooks(IEnumerable,IEnumerable,string,int?,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6948,7 +6948,72 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync() + public async Task GetBigBookAsync1() + { + // Snippet: GetBigBookAsync(BookNameOneof,CallSettings) + // Additional: GetBigBookAsync(BookNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + await libraryServiceClient.GetBigBookAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigBookAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBook + public void GetBigBook1() + { + // Snippet: GetBigBook(BookNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + libraryServiceClient.GetBigBook(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + Book result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigBook(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Book retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for GetBigBookAsync + public async Task GetBigBookAsync2() { // Snippet: GetBigBookAsync(string,CallSettings) // Additional: GetBigBookAsync(string,CancellationToken) @@ -6981,7 +7046,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook() + public void GetBigBook2() { // Snippet: GetBigBook(string,CallSettings) // Create client @@ -7083,7 +7148,68 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync() + public async Task GetBigNothingAsync1() + { + // Snippet: GetBigNothingAsync(BookNameOneof,CallSettings) + // Additional: GetBigNothingAsync(BookNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + await libraryServiceClient.GetBigNothingAsync(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothing + public void GetBigNothing1() + { + // Snippet: GetBigNothing(BookNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Operation response = + libraryServiceClient.GetBigNothing(name); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // The long-running operation is now complete. + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceGetBigNothing(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // The long-running operation is now complete. + } + // End snippet + } + + /// Snippet for GetBigNothingAsync + public async Task GetBigNothingAsync2() { // Snippet: GetBigNothingAsync(string,CallSettings) // Additional: GetBigNothingAsync(string,CancellationToken) @@ -7114,7 +7240,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing() + public void GetBigNothing2() { // Snippet: GetBigNothing(string,CallSettings) // Create client @@ -7771,7 +7897,208 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync() + public async Task LongRunningArchiveBooksAsync1() + { + // Snippet: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) + // Additional: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks1() + { + // Snippet: LongRunningArchiveBooks(ArchiveName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync2() + { + // Snippet: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) + // Additional: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks2() + { + // Snippet: LongRunningArchiveBooks(ShelfName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync3() + { + // Snippet: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) + // Additional: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + await response.PollUntilCompletedAsync(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for LongRunningArchiveBooks + public void LongRunningArchiveBooks3() + { + // Snippet: LongRunningArchiveBooks(ProjectName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + Operation response = + libraryServiceClient.LongRunningArchiveBooks(source, archive); + + // Poll until the returned long-running operation is complete + Operation completedResponse = + response.PollUntilCompleted(); + // Retrieve the operation result + ArchiveBooksResponse result = completedResponse.Result; + + // Or get the name of the operation + string operationName = response.Name; + // This name can be stored, then the long-running operation retrieved later by name + Operation retrievedResponse = + libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + ArchiveBooksResponse retrievedResult = retrievedResponse.Result; + } + // End snippet + } + + /// Snippet for LongRunningArchiveBooksAsync + public async Task LongRunningArchiveBooksAsync4() { // Snippet: LongRunningArchiveBooksAsync(string,string,CallSettings) // Additional: LongRunningArchiveBooksAsync(string,string,CancellationToken) @@ -7805,7 +8132,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks() + public void LongRunningArchiveBooks4() { // Snippet: LongRunningArchiveBooks(string,string,CallSettings) // Create client From b0a23e8b374e551b93ca90b830b11278b10c42b3 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 14:35:31 -0800 Subject: [PATCH 33/36] neun --- .../api/codegen/config/FlatteningConfig.java | 21 +- .../CSharpGapicSnippetsTransformer.java | 9 +- .../CSharpGapicUnitTestTransformer.java | 2 +- .../java/JavaSurfaceTestTransformer.java | 2 +- .../testdata/csharp/csharp_library.baseline | 953 +------------- ...amplegen_config_migration_library.baseline | 859 +------------ .../testdata/csharp_library.baseline | 1145 +---------------- 7 files changed, 127 insertions(+), 2864 deletions(-) diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index 41b0dbd471..c8abc29255 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -403,10 +403,10 @@ public static ImmutableListMultimap groupByMethodSigna } /** - * Returns a flattening config for samples and unit tests. Choose one with resource name types in - * API surface if possible. + * Returns a flattening config for unit tests. Choose one with resource name types in API surface + * if possible. */ - public static FlatteningConfig getFlatteningConfigForSnippetsOrUnitTests( + public static FlatteningConfig getFlatteningConfigForUnitTests( List flatteningConfigs) { Preconditions.checkArgument(flatteningConfigs.size() > 0, "empty flattening configs"); Optional flattening = @@ -414,6 +414,21 @@ public static FlatteningConfig getFlatteningConfigForSnippetsOrUnitTests( return flattening.isPresent() ? flattening.get() : flatteningConfigs.get(0); } + /** + * Returns flattening configs for samples. Eliminate those will only raw strings if there are + * other flattenings with resource name types that have the same method signature. + */ + public static List getFlatteningConfigsForSnippets( + List flatteningConfigs) { + Preconditions.checkArgument(flatteningConfigs.size() > 0, "empty flattening configs"); + List flatteningWithResourceTypes = + flatteningConfigs + .stream() + .filter(FlatteningConfig::hasAnyResourceNameParameter) + .collect(ImmutableList.toImmutableList()); + return flatteningWithResourceTypes.isEmpty() ? flatteningConfigs : flatteningWithResourceTypes; + } + private String getMethodSignature() { return getFlattenedFieldConfigs().keySet().stream().collect(Collectors.joining(",")); } diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index 16153b1619..3daebc4836 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -132,7 +132,8 @@ private List generateMethods(InterfaceContext co methods.add(generateGrpcStreamingRequestMethod(methodContext)); } else if (methodContext.isLongRunningMethodContext()) { if (methodConfig.isFlattening()) { - ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); + List flatteningGroups = + getFlatteningConfigsForSnippets(methodConfig.getFlatteningConfigs()); boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { @@ -205,7 +206,8 @@ private List generateMethods(InterfaceContext co methods.add(generatePagedRequestMethod(methodContext)); } else { if (methodConfig.isFlattening()) { - ImmutableList flatteningGroups = methodConfig.getFlatteningConfigs(); + List flatteningGroups = + getFlatteningConfigsForSnippets(methodConfig.getFlatteningConfigs()); flatteningGroups = flatteningGroups .stream() @@ -545,7 +547,8 @@ private static List getFlatteningConfigsForSnippets( Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); return flatteningGroups .stream() - .map(FlatteningConfig::getFlatteningConfigForSnippetsOrUnitTests) + .map(FlatteningConfig::getFlatteningConfigsForSnippets) + .flatMap(List::stream) .collect(ImmutableList.toImmutableList()); } } diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java index d2da5fb805..140cc0f756 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java @@ -298,7 +298,7 @@ private static List getFlatteningConfigsForTests( Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); return flatteningGroups .stream() - .map(FlatteningConfig::getFlatteningConfigForSnippetsOrUnitTests) + .map(FlatteningConfig::getFlatteningConfigForUnitTests) .collect(ImmutableList.toImmutableList()); } } diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index dc7c665074..0d35fa86ff 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -513,7 +513,7 @@ private static List getFlatteningConfigsForTests( Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); return flatteningGroups .stream() - .map(FlatteningConfig::getFlatteningConfigForSnippetsOrUnitTests) + .map(FlatteningConfig::getFlatteningConfigForUnitTests) .collect(ImmutableList.toImmutableList()); } } diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 964860d795..9a49f029bb 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -4910,93 +4910,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetShelfAsync - public async Task GetShelfAsync1() - { - // Snippet: GetShelfAsync(string,CallSettings) - // Additional: GetShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf1() - { - // Snippet: GetShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync2() - { - // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf2() - { - // Snippet: GetShelf(string,SomeMessage,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() - { - // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf3() - { - // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); - // End snippet - } - /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5204,33 +5117,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync() - { - // Snippet: DeleteShelfAsync(string,CallSettings) - // Additional: DeleteShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - await libraryServiceClient.DeleteShelfAsync(name); - // End snippet - } - - /// Snippet for DeleteShelf - public void DeleteShelf() - { - // Snippet: DeleteShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - libraryServiceClient.DeleteShelf(name); - // End snippet - } - /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -5264,35 +5150,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync() - { - // Snippet: MergeShelvesAsync(string,string,CallSettings) - // Additional: MergeShelvesAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MergeShelves - public void MergeShelves() - { - // Snippet: MergeShelves(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); - // End snippet - } - /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5328,35 +5185,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for CreateBookAsync - public async Task CreateBookAsync() - { - // Snippet: CreateBookAsync(string,Book,CallSettings) - // Additional: CreateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.CreateBookAsync(name, book); - // End snippet - } - - /// Snippet for CreateBook - public void CreateBook() - { - // Snippet: CreateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.CreateBook(name, book); - // End snippet - } - /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5474,33 +5302,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookAsync - public async Task GetBookAsync() - { - // Snippet: GetBookAsync(string,CallSettings) - // Additional: GetBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = await libraryServiceClient.GetBookAsync(name); - // End snippet - } - - /// Snippet for GetBook - public void GetBook() - { - // Snippet: GetBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = libraryServiceClient.GetBook(name); - // End snippet - } - /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5720,33 +5521,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync() - { - // Snippet: DeleteBookAsync(string,CallSettings) - // Additional: DeleteBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook() - { - // Snippet: DeleteBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -5780,70 +5554,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync1() - { - // Snippet: UpdateBookAsync(string,Book,CallSettings) - // Additional: UpdateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, book); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook1() - { - // Snippet: UpdateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, book); - // End snippet - } - - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync2() - { - // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook2() - { - // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -5880,56 +5590,27 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync() + public async Task MoveBookAsync_RequestObject() { - // Snippet: MoveBookAsync(string,string,CallSettings) - // Additional: MoveBookAsync(string,string,CancellationToken) + // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) + // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request - Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + Book response = await libraryServiceClient.MoveBookAsync(request); // End snippet } /// Snippet for MoveBook - public void MoveBook() + public void MoveBook_RequestObject() { - // Snippet: MoveBook(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Book response = libraryServiceClient.MoveBook(name, otherShelfName); - // End snippet - } - - /// Snippet for MoveBookAsync - public async Task MoveBookAsync_RequestObject() - { - // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) - // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - // Make the request - Book response = await libraryServiceClient.MoveBookAsync(request); - // End snippet - } - - /// Snippet for MoveBook - public void MoveBook_RequestObject() - { - // Snippet: MoveBook(MoveBookRequest,CallSettings) + // Snippet: MoveBook(MoveBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) @@ -6203,51 +5884,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync() - { - // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - await libraryServiceClient.AddCommentsAsync(name, comments); - // End snippet - } - - /// Snippet for AddComments - public void AddComments() - { - // Snippet: AddComments(string,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - libraryServiceClient.AddComments(name, comments); - // End snippet - } - /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -6299,35 +5935,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync() - { - // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) - // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); - // Make the request - BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); - // End snippet - } - - /// Snippet for GetBookFromArchive - public void GetBookFromArchive() - { - // Snippet: GetBookFromArchive(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); - // Make the request - BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); - // End snippet - } - /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -6363,39 +5970,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync() - { - // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) - // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); - // End snippet - } - - /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere() - { - // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); - // End snippet - } - /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -6435,33 +6009,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync() - { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); - // End snippet - } - - /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere() - { - // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); - // End snippet - } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -6495,43 +6042,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync() - { - // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); - // End snippet - } - - /// Snippet for UpdateBookIndex - public void UpdateBookIndex() - { - // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); - // End snippet - } - /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -6934,7 +6444,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync1() + public async Task GetBigBookAsync() { // Snippet: GetBigBookAsync(BookName,CallSettings) // Additional: GetBigBookAsync(BookName,CancellationToken) @@ -6967,7 +6477,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook1() + public void GetBigBook() { // Snippet: GetBigBook(BookName,CallSettings) // Create client @@ -6998,71 +6508,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync2() - { - // Snippet: GetBigBookAsync(string,CallSettings) - // Additional: GetBigBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - await libraryServiceClient.GetBigBookAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigBookAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBook - public void GetBigBook2() - { - // Snippet: GetBigBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - libraryServiceClient.GetBigBook(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigBook(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - /// Snippet for GetBigBookAsync public async Task GetBigBookAsync_RequestObject() { @@ -7134,7 +6579,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync1() + public async Task GetBigNothingAsync() { // Snippet: GetBigNothingAsync(BookName,CallSettings) // Additional: GetBigNothingAsync(BookName,CancellationToken) @@ -7165,7 +6610,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing1() + public void GetBigNothing() { // Snippet: GetBigNothing(BookName,CallSettings) // Create client @@ -7195,17 +6640,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync2() + public async Task GetBigNothingAsync_RequestObject() { - // Snippet: GetBigNothingAsync(string,CallSettings) - // Additional: GetBigNothingAsync(string,CancellationToken) + // Snippet: GetBigNothingAsync(GetBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); + GetBookRequest request = new GetBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + }; // Make the request Operation response = - await libraryServiceClient.GetBigNothingAsync(name); + await libraryServiceClient.GetBigNothingAsync(request); // Poll until the returned long-running operation is complete Operation completedResponse = @@ -7226,16 +6673,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing2() + public void GetBigNothing_RequestObject() { - // Snippet: GetBigNothing(string,CallSettings) + // Snippet: GetBigNothing(GetBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); + GetBookRequest request = new GetBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + }; // Make the request Operation response = - libraryServiceClient.GetBigNothing(name); + libraryServiceClient.GetBigNothing(request); // Poll until the returned long-running operation is complete Operation completedResponse = @@ -7255,77 +6705,11 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync_RequestObject() + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync() { - // Snippet: GetBigNothingAsync(GetBookRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - // Make the request - Operation response = - await libraryServiceClient.GetBigNothingAsync(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothing - public void GetBigNothing_RequestObject() - { - // Snippet: GetBigNothing(GetBookRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - }; - // Make the request - Operation response = - libraryServiceClient.GetBigNothing(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigNothing(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync1() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Make the request @@ -7334,7 +6718,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams1() + public void TestOptionalRequiredFlatteningParams() { // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) // Create client @@ -7344,275 +6728,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync2() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams2() - { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 6d84dc7a9e..8f8b927532 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -1747,93 +1747,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetShelfAsync - public async Task GetShelfAsync1() - { - // Snippet: GetShelfAsync(string,CallSettings) - // Additional: GetShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf1() - { - // Snippet: GetShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync2() - { - // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf2() - { - // Snippet: GetShelf(string,SomeMessage,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() - { - // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf3() - { - // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); - // End snippet - } - /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -2041,33 +1954,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync() - { - // Snippet: DeleteShelfAsync(string,CallSettings) - // Additional: DeleteShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - await libraryServiceClient.DeleteShelfAsync(name); - // End snippet - } - - /// Snippet for DeleteShelf - public void DeleteShelf() - { - // Snippet: DeleteShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - libraryServiceClient.DeleteShelf(name); - // End snippet - } - /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -2101,35 +1987,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync() - { - // Snippet: MergeShelvesAsync(string,string,CallSettings) - // Additional: MergeShelvesAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MergeShelves - public void MergeShelves() - { - // Snippet: MergeShelves(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); - // End snippet - } - /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -2165,35 +2022,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for CreateBookAsync - public async Task CreateBookAsync() - { - // Snippet: CreateBookAsync(string,Book,CallSettings) - // Additional: CreateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.CreateBookAsync(name, book); - // End snippet - } - - /// Snippet for CreateBook - public void CreateBook() - { - // Snippet: CreateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.CreateBook(name, book); - // End snippet - } - /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -2311,33 +2139,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookAsync - public async Task GetBookAsync() - { - // Snippet: GetBookAsync(string,CallSettings) - // Additional: GetBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = await libraryServiceClient.GetBookAsync(name); - // End snippet - } - - /// Snippet for GetBook - public void GetBook() - { - // Snippet: GetBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Book response = libraryServiceClient.GetBook(name); - // End snippet - } - /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -2557,33 +2358,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync() - { - // Snippet: DeleteBookAsync(string,CallSettings) - // Additional: DeleteBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook() - { - // Snippet: DeleteBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -2617,70 +2391,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync1() - { - // Snippet: UpdateBookAsync(string,Book,CallSettings) - // Additional: UpdateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, book); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook1() - { - // Snippet: UpdateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, book); - // End snippet - } - - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync2() - { - // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook2() - { - // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -2717,64 +2427,35 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBookAsync - public async Task MoveBookAsync() + public async Task MoveBookAsync_RequestObject() { - // Snippet: MoveBookAsync(string,string,CallSettings) - // Additional: MoveBookAsync(string,string,CancellationToken) + // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) + // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request - Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + Book response = await libraryServiceClient.MoveBookAsync(request); // End snippet } /// Snippet for MoveBook - public void MoveBook() + public void MoveBook_RequestObject() { - // Snippet: MoveBook(string,string,CallSettings) + // Snippet: MoveBook(MoveBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Book response = libraryServiceClient.MoveBook(name, otherShelfName); - // End snippet - } - - /// Snippet for MoveBookAsync - public async Task MoveBookAsync_RequestObject() - { - // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) - // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; - // Make the request - Book response = await libraryServiceClient.MoveBookAsync(request); - // End snippet - } - - /// Snippet for MoveBook - public void MoveBook_RequestObject() - { - // Snippet: MoveBook(MoveBookRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest - { - BookName = new BookName("[SHELF]", "[BOOK]"), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; + MoveBookRequest request = new MoveBookRequest + { + BookName = new BookName("[SHELF]", "[BOOK]"), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request Book response = libraryServiceClient.MoveBook(request); // End snippet @@ -3040,51 +2721,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync() - { - // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - await libraryServiceClient.AddCommentsAsync(name, comments); - // End snippet - } - - /// Snippet for AddComments - public void AddComments() - { - // Snippet: AddComments(string,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - libraryServiceClient.AddComments(name, comments); - // End snippet - } - /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -3136,33 +2772,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync() - { - // Snippet: GetBookFromArchiveAsync(string,CallSettings) - // Additional: GetBookFromArchiveAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name); - // End snippet - } - - /// Snippet for GetBookFromArchive - public void GetBookFromArchive() - { - // Snippet: GetBookFromArchive(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); - // Make the request - BookFromArchive response = libraryServiceClient.GetBookFromArchive(name); - // End snippet - } - /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -3196,35 +2805,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync() - { - // Snippet: GetBookFromAnywhereAsync(string,string,CallSettings) - // Additional: GetBookFromAnywhereAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName); - // End snippet - } - - /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere() - { - // Snippet: GetBookFromAnywhere(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookName altBookName = new BookName("[SHELF]", "[BOOK]"); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName); - // End snippet - } - /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -3260,33 +2840,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync() - { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); - // End snippet - } - - /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere() - { - // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); - // End snippet - } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -3320,43 +2873,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync() - { - // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); - // End snippet - } - - /// Snippet for UpdateBookIndex - public void UpdateBookIndex() - { - // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); - // End snippet - } - /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -3759,7 +3275,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync1() + public async Task GetBigBookAsync() { // Snippet: GetBigBookAsync(BookName,CallSettings) // Additional: GetBigBookAsync(BookName,CancellationToken) @@ -3792,7 +3308,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook1() + public void GetBigBook() { // Snippet: GetBigBook(BookName,CallSettings) // Create client @@ -3823,71 +3339,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync2() - { - // Snippet: GetBigBookAsync(string,CallSettings) - // Additional: GetBigBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - await libraryServiceClient.GetBigBookAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigBookAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBook - public void GetBigBook2() - { - // Snippet: GetBigBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - libraryServiceClient.GetBigBook(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigBook(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - /// Snippet for GetBigBookAsync public async Task GetBigBookAsync_RequestObject() { @@ -3959,7 +3410,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync1() + public async Task GetBigNothingAsync() { // Snippet: GetBigNothingAsync(BookName,CallSettings) // Additional: GetBigNothingAsync(BookName,CancellationToken) @@ -3990,7 +3441,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing1() + public void GetBigNothing() { // Snippet: GetBigNothing(BookName,CallSettings) // Create client @@ -4019,67 +3470,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync2() - { - // Snippet: GetBigNothingAsync(string,CallSettings) - // Additional: GetBigNothingAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - await libraryServiceClient.GetBigNothingAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothing - public void GetBigNothing2() - { - // Snippet: GetBigNothing(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookName name = new BookName("[SHELF]", "[BOOK]"); - // Make the request - Operation response = - libraryServiceClient.GetBigNothing(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigNothing(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - /// Snippet for GetBigNothingAsync public async Task GetBigNothingAsync_RequestObject() { @@ -4147,7 +3537,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync1() + public async Task TestOptionalRequiredFlatteningParamsAsync() { // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) @@ -4159,7 +3549,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams1() + public void TestOptionalRequiredFlatteningParams() { // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) // Create client @@ -4169,211 +3559,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync2() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams2() - { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index c0d8c85b9d..dc1ba91432 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -4951,93 +4951,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetShelfAsync - public async Task GetShelfAsync1() - { - // Snippet: GetShelfAsync(string,CallSettings) - // Additional: GetShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf1() - { - // Snippet: GetShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync2() - { - // Snippet: GetShelfAsync(string,SomeMessage,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf2() - { - // Snippet: GetShelf(string,SomeMessage,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message); - // End snippet - } - - /// Snippet for GetShelfAsync - public async Task GetShelfAsync3() - { - // Snippet: GetShelfAsync(string,SomeMessage,StringBuilder,CallSettings) - // Additional: GetShelfAsync(string,SomeMessage,StringBuilder,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); - // End snippet - } - - /// Snippet for GetShelf - public void GetShelf3() - { - // Snippet: GetShelf(string,SomeMessage,StringBuilder,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - SomeMessage message = new SomeMessage(); - StringBuilder stringBuilder = new StringBuilder(); - // Make the request - Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); - // End snippet - } - /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5245,33 +5158,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteShelfAsync - public async Task DeleteShelfAsync() - { - // Snippet: DeleteShelfAsync(string,CallSettings) - // Additional: DeleteShelfAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - await libraryServiceClient.DeleteShelfAsync(name); - // End snippet - } - - /// Snippet for DeleteShelf - public void DeleteShelf() - { - // Snippet: DeleteShelf(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - // Make the request - libraryServiceClient.DeleteShelf(name); - // End snippet - } - /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -5305,35 +5191,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MergeShelvesAsync - public async Task MergeShelvesAsync() - { - // Snippet: MergeShelvesAsync(string,string,CallSettings) - // Additional: MergeShelvesAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MergeShelves - public void MergeShelves() - { - // Snippet: MergeShelves(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); - // End snippet - } - /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5369,35 +5226,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for CreateBookAsync - public async Task CreateBookAsync() - { - // Snippet: CreateBookAsync(string,Book,CallSettings) - // Additional: CreateBookAsync(string,Book,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = await libraryServiceClient.CreateBookAsync(name, book); - // End snippet - } - - /// Snippet for CreateBook - public void CreateBook() - { - // Snippet: CreateBook(string,Book,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName name = new ShelfName("[SHELF]"); - Book book = new Book(); - // Make the request - Book response = libraryServiceClient.CreateBook(name, book); - // End snippet - } - /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5433,47 +5261,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for PublishSeriesAsync - public async Task PublishSeriesAsync() - { - // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) - // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - // Make the request - PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); - // End snippet - } - - /// Snippet for PublishSeries - public void PublishSeries() - { - // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - Shelf shelf = new Shelf(); - IEnumerable books = new List(); - uint edition = 0; - SeriesUuid seriesUuid = new SeriesUuid - { - SeriesString = "foobar", - }; - PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); - // Make the request - PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid, publisher); - // End snippet - } - /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -5517,33 +5304,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookAsync - public async Task GetBookAsync() - { - // Snippet: GetBookAsync(string,CallSettings) - // Additional: GetBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Book response = await libraryServiceClient.GetBookAsync(name); - // End snippet - } - - /// Snippet for GetBook - public void GetBook() - { - // Snippet: GetBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Book response = libraryServiceClient.GetBook(name); - // End snippet - } - /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5763,33 +5523,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for DeleteBookAsync - public async Task DeleteBookAsync() - { - // Snippet: DeleteBookAsync(string,CallSettings) - // Additional: DeleteBookAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - await libraryServiceClient.DeleteBookAsync(name); - // End snippet - } - - /// Snippet for DeleteBook - public void DeleteBook() - { - // Snippet: DeleteBook(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - libraryServiceClient.DeleteBook(name); - // End snippet - } - /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -5824,138 +5557,45 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync1() + public async Task UpdateBookAsync_RequestObject() { - // Snippet: UpdateBookAsync(string,Book,CallSettings) - // Additional: UpdateBookAsync(string,Book,CancellationToken) + // Snippet: UpdateBookAsync(UpdateBookRequest,CallSettings) + // Additional: UpdateBookAsync(UpdateBookRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); + UpdateBookRequest request = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, book); + Book response = await libraryServiceClient.UpdateBookAsync(request); // End snippet } /// Snippet for UpdateBook - public void UpdateBook1() + public void UpdateBook_RequestObject() { - // Snippet: UpdateBook(string,Book,CallSettings) + // Snippet: UpdateBook(UpdateBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - Book book = new Book(); + UpdateBookRequest request = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; // Make the request - Book response = libraryServiceClient.UpdateBook(name, book); + Book response = libraryServiceClient.UpdateBook(request); // End snippet } - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync2() + /// Snippet for MoveBookAsync + public async Task MoveBookAsync_RequestObject() { - // Snippet: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Additional: UpdateBookAsync(string,string,Book,FieldMask,apis::FieldMask,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook2() - { - // Snippet: UpdateBook(string,string,Book,FieldMask,apis::FieldMask,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalFoo = ""; - Book book = new Book(); - FieldMask updateMask = new FieldMask(); - apis::FieldMask physicalMask = new apis::FieldMask(); - // Make the request - Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); - // End snippet - } - - /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync_RequestObject() - { - // Snippet: UpdateBookAsync(UpdateBookRequest,CallSettings) - // Additional: UpdateBookAsync(UpdateBookRequest,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - UpdateBookRequest request = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), - }; - // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(request); - // End snippet - } - - /// Snippet for UpdateBook - public void UpdateBook_RequestObject() - { - // Snippet: UpdateBook(UpdateBookRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - UpdateBookRequest request = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), - }; - // Make the request - Book response = libraryServiceClient.UpdateBook(request); - // End snippet - } - - /// Snippet for MoveBookAsync - public async Task MoveBookAsync() - { - // Snippet: MoveBookAsync(string,string,CallSettings) - // Additional: MoveBookAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); - // End snippet - } - - /// Snippet for MoveBook - public void MoveBook() - { - // Snippet: MoveBook(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - ShelfName otherShelfName = new ShelfName("[SHELF]"); - // Make the request - Book response = libraryServiceClient.MoveBook(name, otherShelfName); - // End snippet - } - - /// Snippet for MoveBookAsync - public async Task MoveBookAsync_RequestObject() - { - // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) - // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) + // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) + // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) @@ -6246,51 +5886,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for AddCommentsAsync - public async Task AddCommentsAsync() - { - // Snippet: AddCommentsAsync(string,IEnumerable,CallSettings) - // Additional: AddCommentsAsync(string,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - await libraryServiceClient.AddCommentsAsync(name, comments); - // End snippet - } - - /// Snippet for AddComments - public void AddComments() - { - // Snippet: AddComments(string,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - IEnumerable comments = new[] - { - new Comment - { - Comment = ByteString.Empty, - Stage = Comment.Types.Stage.Unset, - Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, - }, - }; - // Make the request - libraryServiceClient.AddComments(name, comments); - // End snippet - } - /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -6342,35 +5937,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromArchiveAsync - public async Task GetBookFromArchiveAsync() - { - // Snippet: GetBookFromArchiveAsync(string,string,CallSettings) - // Additional: GetBookFromArchiveAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - // Make the request - BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); - // End snippet - } - - /// Snippet for GetBookFromArchive - public void GetBookFromArchive() - { - // Snippet: GetBookFromArchive(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); - ProjectName parent = new ProjectName("[PROJECT]"); - // Make the request - BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); - // End snippet - } - /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -6406,39 +5972,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAnywhereAsync - public async Task GetBookFromAnywhereAsync() - { - // Snippet: GetBookFromAnywhereAsync(string,string,string,string,CallSettings) - // Additional: GetBookFromAnywhereAsync(string,string,string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); - // End snippet - } - - /// Snippet for GetBookFromAnywhere - public void GetBookFromAnywhere() - { - // Snippet: GetBookFromAnywhere(string,string,string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); - FolderName folder = new FolderName("[FOLDER]"); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); - // End snippet - } - /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -6478,33 +6011,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync() - { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(string,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); - // End snippet - } - - /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere() - { - // Snippet: GetBookFromAbsolutelyAnywhere(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); - // End snippet - } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -6538,43 +6044,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for UpdateBookIndexAsync - public async Task UpdateBookIndexAsync() - { - // Snippet: UpdateBookIndexAsync(string,string,IDictionary,CallSettings) - // Additional: UpdateBookIndexAsync(string,string,IDictionary,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); - // End snippet - } - - /// Snippet for UpdateBookIndex - public void UpdateBookIndex() - { - // Snippet: UpdateBookIndex(string,string,IDictionary,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string indexName = "default index"; - IDictionary indexMap = new Dictionary - { - { "default_key", "" }, - }; - // Make the request - libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); - // End snippet - } - /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -6948,7 +6417,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync1() + public async Task GetBigBookAsync() { // Snippet: GetBigBookAsync(BookNameOneof,CallSettings) // Additional: GetBigBookAsync(BookNameOneof,CancellationToken) @@ -6981,7 +6450,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook1() + public void GetBigBook() { // Snippet: GetBigBook(BookNameOneof,CallSettings) // Create client @@ -7013,17 +6482,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync2() + public async Task GetBigBookAsync_RequestObject() { - // Snippet: GetBigBookAsync(string,CallSettings) - // Additional: GetBigBookAsync(string,CancellationToken) + // Snippet: GetBigBookAsync(GetBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + GetBookRequest request = new GetBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; // Make the request Operation response = - await libraryServiceClient.GetBigBookAsync(name); + await libraryServiceClient.GetBigBookAsync(request); // Poll until the returned long-running operation is complete Operation completedResponse = @@ -7046,16 +6517,19 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigBook - public void GetBigBook2() + public void GetBigBook_RequestObject() { - // Snippet: GetBigBook(string,CallSettings) + // Snippet: GetBigBook(GetBookRequest,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + GetBookRequest request = new GetBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; // Make the request Operation response = - libraryServiceClient.GetBigBook(name); + libraryServiceClient.GetBigBook(request); // Poll until the returned long-running operation is complete Operation completedResponse = @@ -7077,85 +6551,15 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBigBookAsync - public async Task GetBigBookAsync_RequestObject() + /// Snippet for GetBigNothingAsync + public async Task GetBigNothingAsync() { - // Snippet: GetBigBookAsync(GetBookRequest,CallSettings) + // Snippet: GetBigNothingAsync(BookNameOneof,CallSettings) + // Additional: GetBigNothingAsync(BookNameOneof,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - // Make the request - Operation response = - await libraryServiceClient.GetBigBookAsync(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigBookAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigBook - public void GetBigBook_RequestObject() - { - // Snippet: GetBigBook(GetBookRequest,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - GetBookRequest request = new GetBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - }; - // Make the request - Operation response = - libraryServiceClient.GetBigBook(request); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - Book result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigBook(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - Book retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync1() - { - // Snippet: GetBigNothingAsync(BookNameOneof,CallSettings) - // Additional: GetBigNothingAsync(BookNameOneof,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); // Make the request Operation response = await libraryServiceClient.GetBigNothingAsync(name); @@ -7179,7 +6583,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for GetBigNothing - public void GetBigNothing1() + public void GetBigNothing() { // Snippet: GetBigNothing(BookNameOneof,CallSettings) // Create client @@ -7208,67 +6612,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBigNothingAsync - public async Task GetBigNothingAsync2() - { - // Snippet: GetBigNothingAsync(string,CallSettings) - // Additional: GetBigNothingAsync(string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Operation response = - await libraryServiceClient.GetBigNothingAsync(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceGetBigNothingAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - - /// Snippet for GetBigNothing - public void GetBigNothing2() - { - // Snippet: GetBigNothing(string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - // Make the request - Operation response = - libraryServiceClient.GetBigNothing(name); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // The long-running operation is now complete. - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceGetBigNothing(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // The long-running operation is now complete. - } - // End snippet - } - /// Snippet for GetBigNothingAsync public async Task GetBigNothingAsync_RequestObject() { @@ -7336,7 +6679,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync1() + public async Task TestOptionalRequiredFlatteningParamsAsync() { // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) @@ -7348,7 +6691,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams1() + public void TestOptionalRequiredFlatteningParams() { // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) // Create client @@ -7358,275 +6701,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync2() - { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = ""; - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = ""; - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - - /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams2() - { - // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,string,string,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - int requiredSingularInt32 = 0; - long requiredSingularInt64 = 0L; - float requiredSingularFloat = 0.0f; - double requiredSingularDouble = 0.0; - bool requiredSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string requiredSingularString = ""; - ByteString requiredSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string requiredSingularResourceNameCommon = ""; - int requiredSingularFixed32 = 0; - long requiredSingularFixed64 = 0L; - IEnumerable requiredRepeatedInt32 = new List(); - IEnumerable requiredRepeatedInt64 = new List(); - IEnumerable requiredRepeatedFloat = new List(); - IEnumerable requiredRepeatedDouble = new List(); - IEnumerable requiredRepeatedBool = new List(); - IEnumerable requiredRepeatedEnum = new List(); - IEnumerable requiredRepeatedString = new List(); - IEnumerable requiredRepeatedBytes = new List(); - IEnumerable requiredRepeatedMessage = new List(); - IEnumerable requiredRepeatedResourceName = new List(); - IEnumerable requiredRepeatedResourceNameOneof = new List(); - IEnumerable requiredRepeatedResourceNameCommon = new List(); - IEnumerable requiredRepeatedFixed32 = new List(); - IEnumerable requiredRepeatedFixed64 = new List(); - IDictionary requiredMap = new Dictionary(); - Any requiredAnyValue = new Any(); - Struct requiredStructValue = new Struct(); - Value requiredValueValue = new Value(); - ListValue requiredListValueValue = new ListValue(); - Timestamp requiredTimeValue = new Timestamp(); - Duration requiredDurationValue = new Duration(); - FieldMask requiredFieldMaskValue = new FieldMask(); - int? requiredInt32Value = null; - uint? requiredUint32Value = null; - long? requiredInt64Value = null; - ulong? requiredUint64Value = null; - float? requiredFloatValue = null; - double? requiredDoubleValue = null; - string requiredStringValue = null; - bool? requiredBoolValue = null; - ByteString requiredBytesValue = null; - IEnumerable requiredRepeatedAnyValue = new List(); - IEnumerable requiredRepeatedStructValue = new List(); - IEnumerable requiredRepeatedValueValue = new List(); - IEnumerable requiredRepeatedListValueValue = new List(); - IEnumerable requiredRepeatedTimeValue = new List(); - IEnumerable requiredRepeatedDurationValue = new List(); - IEnumerable requiredRepeatedFieldMaskValue = new List(); - IEnumerable requiredRepeatedInt32Value = new List(); - IEnumerable requiredRepeatedUint32Value = new List(); - IEnumerable requiredRepeatedInt64Value = new List(); - IEnumerable requiredRepeatedUint64Value = new List(); - IEnumerable requiredRepeatedFloatValue = new List(); - IEnumerable requiredRepeatedDoubleValue = new List(); - IEnumerable requiredRepeatedStringValue = new List(); - IEnumerable requiredRepeatedBoolValue = new List(); - IEnumerable requiredRepeatedBytesValue = new List(); - int optionalSingularInt32 = 0; - long optionalSingularInt64 = 0L; - float optionalSingularFloat = 0.0f; - double optionalSingularDouble = 0.0; - bool optionalSingularBool = false; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; - string optionalSingularString = ""; - ByteString optionalSingularBytes = ByteString.Empty; - TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); - BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); - string optionalSingularResourceNameCommon = ""; - int optionalSingularFixed32 = 0; - long optionalSingularFixed64 = 0L; - IEnumerable optionalRepeatedInt32 = new List(); - IEnumerable optionalRepeatedInt64 = new List(); - IEnumerable optionalRepeatedFloat = new List(); - IEnumerable optionalRepeatedDouble = new List(); - IEnumerable optionalRepeatedBool = new List(); - IEnumerable optionalRepeatedEnum = new List(); - IEnumerable optionalRepeatedString = new List(); - IEnumerable optionalRepeatedBytes = new List(); - IEnumerable optionalRepeatedMessage = new List(); - IEnumerable optionalRepeatedResourceName = new List(); - IEnumerable optionalRepeatedResourceNameOneof = new List(); - IEnumerable optionalRepeatedResourceNameCommon = new List(); - IEnumerable optionalRepeatedFixed32 = new List(); - IEnumerable optionalRepeatedFixed64 = new List(); - IDictionary optionalMap = new Dictionary(); - Any anyValue = new Any(); - Struct structValue = new Struct(); - Value valueValue = new Value(); - ListValue listValueValue = new ListValue(); - Timestamp timeValue = new Timestamp(); - Duration durationValue = new Duration(); - FieldMask fieldMaskValue = new FieldMask(); - int? int32Value = null; - uint? uint32Value = null; - long? int64Value = null; - ulong? uint64Value = null; - float? floatValue = null; - double? doubleValue = null; - string stringValue = null; - bool? boolValue = null; - ByteString bytesValue = null; - IEnumerable repeatedAnyValue = new List(); - IEnumerable repeatedStructValue = new List(); - IEnumerable repeatedValueValue = new List(); - IEnumerable repeatedListValueValue = new List(); - IEnumerable repeatedTimeValue = new List(); - IEnumerable repeatedDurationValue = new List(); - IEnumerable repeatedFieldMaskValue = new List(); - IEnumerable repeatedInt32Value = new List(); - IEnumerable repeatedUint32Value = new List(); - IEnumerable repeatedInt64Value = new List(); - IEnumerable repeatedUint64Value = new List(); - IEnumerable repeatedFloatValue = new List(); - IEnumerable repeatedDoubleValue = new List(); - IEnumerable repeatedStringValue = new List(); - IEnumerable repeatedBoolValue = new List(); - IEnumerable repeatedBytesValue = new List(); - // Make the request - TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); - // End snippet - } - /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { @@ -7780,39 +6854,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync() - { - // Snippet: MoveBooksAsync(string,string,IEnumerable,string,CallSettings) - // Additional: MoveBooksAsync(string,string,IEnumerable,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks() - { - // Snippet: MoveBooks(string,string,IEnumerable,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - /// Snippet for MoveBooksAsync public async Task MoveBooksAsync_RequestObject() { @@ -7840,35 +6881,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync() - { - // Snippet: ArchiveBooksAsync(string,string,CallSettings) - // Additional: ArchiveBooksAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooks - public void ArchiveBooks() - { - // Snippet: ArchiveBooks(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); - // End snippet - } - /// Snippet for ArchiveBooksAsync public async Task ArchiveBooksAsync_RequestObject() { @@ -8097,73 +7109,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync4() - { - // Snippet: LongRunningArchiveBooksAsync(string,string,CallSettings) - // Additional: LongRunningArchiveBooksAsync(string,string,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks4() - { - // Snippet: LongRunningArchiveBooks(string,string,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - /// Snippet for LongRunningArchiveBooksAsync public async Task LongRunningArchiveBooksAsync_RequestObject() { From 36708de35d73990859e5f4bf57c79345b5aa7678 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 14:40:57 -0800 Subject: [PATCH 34/36] decade --- .../CSharpGapicSnippetsTransformer.java | 5 - .../testdata/csharp/csharp_library.baseline | 789 +++++++++- ...amplegen_config_migration_library.baseline | 695 ++++++++- .../testdata/csharp_library.baseline | 1294 ++++++++++++++++- 4 files changed, 2705 insertions(+), 78 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index 3daebc4836..e7d012689c 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -208,11 +208,6 @@ private List generateMethods(InterfaceContext co if (methodConfig.isFlattening()) { List flatteningGroups = getFlatteningConfigsForSnippets(methodConfig.getFlatteningConfigs()); - flatteningGroups = - flatteningGroups - .stream() - .filter(f -> !FlatteningConfig.hasAnyResourceNameParameter(f)) - .collect(ImmutableList.toImmutableList()); boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { FlatteningConfig flatteningGroup = flatteningGroups.get(i); diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline index 9a49f029bb..92dc045906 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_library.baseline @@ -4910,6 +4910,93 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetShelfAsync + public async Task GetShelfAsync1() + { + // Snippet: GetShelfAsync(ShelfName,CallSettings) + // Additional: GetShelfAsync(ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf1() + { + // Snippet: GetShelf(ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync2() + { + // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) + // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf2() + { + // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync3() + { + // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf3() + { + // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); + // End snippet + } + /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5117,6 +5204,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteShelfAsync + public async Task DeleteShelfAsync() + { + // Snippet: DeleteShelfAsync(ShelfName,CallSettings) + // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + await libraryServiceClient.DeleteShelfAsync(name); + // End snippet + } + + /// Snippet for DeleteShelf + public void DeleteShelf() + { + // Snippet: DeleteShelf(ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + libraryServiceClient.DeleteShelf(name); + // End snippet + } + /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -5150,6 +5264,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MergeShelvesAsync + public async Task MergeShelvesAsync() + { + // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) + // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MergeShelves + public void MergeShelves() + { + // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); + // End snippet + } + /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5185,6 +5328,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for CreateBookAsync + public async Task CreateBookAsync() + { + // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) + // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.CreateBookAsync(name, book); + // End snippet + } + + /// Snippet for CreateBook + public void CreateBook() + { + // Snippet: CreateBook(ShelfName,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.CreateBook(name, book); + // End snippet + } + /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5302,6 +5474,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookAsync + public async Task GetBookAsync() + { + // Snippet: GetBookAsync(BookName,CallSettings) + // Additional: GetBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = await libraryServiceClient.GetBookAsync(name); + // End snippet + } + + /// Snippet for GetBook + public void GetBook() + { + // Snippet: GetBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = libraryServiceClient.GetBook(name); + // End snippet + } + /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5521,6 +5720,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync() + { + // Snippet: DeleteBookAsync(BookName,CallSettings) + // Additional: DeleteBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook() + { + // Snippet: DeleteBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -5554,6 +5780,70 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync1() + { + // Snippet: UpdateBookAsync(BookName,Book,CallSettings) + // Additional: UpdateBookAsync(BookName,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, book); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook1() + { + // Snippet: UpdateBook(BookName,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, book); + // End snippet + } + + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync2() + { + // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook2() + { + // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -5589,6 +5879,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MoveBookAsync + public async Task MoveBookAsync() + { + // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) + // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MoveBook + public void MoveBook() + { + // Snippet: MoveBook(BookName,ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = libraryServiceClient.MoveBook(name, otherShelfName); + // End snippet + } + /// Snippet for MoveBookAsync public async Task MoveBookAsync_RequestObject() { @@ -5884,6 +6203,51 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync() + { + // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + await libraryServiceClient.AddCommentsAsync(name, comments); + // End snippet + } + + /// Snippet for AddComments + public void AddComments() + { + // Snippet: AddComments(BookName,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + libraryServiceClient.AddComments(name, comments); + // End snippet + } + /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -5935,6 +6299,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromArchiveAsync + public async Task GetBookFromArchiveAsync() + { + // Snippet: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CallSettings) + // Additional: GetBookFromArchiveAsync(ArchivedBookName,LocationParentNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); + // Make the request + BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); + // End snippet + } + + /// Snippet for GetBookFromArchive + public void GetBookFromArchive() + { + // Snippet: GetBookFromArchive(ArchivedBookName,LocationParentNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + LocationParentNameOneof parent = LocationParentNameOneof.From(new ProjectName("[PROJECT]")); + // Make the request + BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); + // End snippet + } + /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -5970,6 +6363,39 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAnywhereAsync + public async Task GetBookFromAnywhereAsync() + { + // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CallSettings) + // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,LocationName,FolderName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); + // End snippet + } + + /// Snippet for GetBookFromAnywhere + public void GetBookFromAnywhere() + { + // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,LocationName,FolderName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); + // End snippet + } + /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -6009,36 +6435,100 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhereAsync - public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() + /// Snippet for GetBookFromAbsolutelyAnywhereAsync + public async Task GetBookFromAbsolutelyAnywhereAsync() + { + // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhere + public void GetBookFromAbsolutelyAnywhere() + { + // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhereAsync + public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() + { + // Snippet: GetBookFromAbsolutelyAnywhereAsync(GetBookFromAbsolutelyAnywhereRequest,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(GetBookFromAbsolutelyAnywhereRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + { + AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(request); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhere + public void GetBookFromAbsolutelyAnywhere_RequestObject() + { + // Snippet: GetBookFromAbsolutelyAnywhere(GetBookFromAbsolutelyAnywhereRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + { + AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + }; + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(request); + // End snippet + } + + /// Snippet for UpdateBookIndexAsync + public async Task UpdateBookIndexAsync() { - // Snippet: GetBookFromAbsolutelyAnywhereAsync(GetBookFromAbsolutelyAnywhereRequest,CallSettings) - // Additional: GetBookFromAbsolutelyAnywhereAsync(GetBookFromAbsolutelyAnywhereRequest,CancellationToken) + // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary { - AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + { "default_key", "" }, }; // Make the request - BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(request); + await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); // End snippet } - /// Snippet for GetBookFromAbsolutelyAnywhere - public void GetBookFromAbsolutelyAnywhere_RequestObject() + /// Snippet for UpdateBookIndex + public void UpdateBookIndex() { - // Snippet: GetBookFromAbsolutelyAnywhere(GetBookFromAbsolutelyAnywhereRequest,CallSettings) + // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - GetBookFromAbsolutelyAnywhereRequest request = new GetBookFromAbsolutelyAnywhereRequest + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary { - AsResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + { "default_key", "" }, }; // Make the request - BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(request); + libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); // End snippet } @@ -6706,7 +7196,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync() + public async Task TestOptionalRequiredFlatteningParamsAsync1() { // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) @@ -6718,7 +7208,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams() + public void TestOptionalRequiredFlatteningParams1() { // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) // Create client @@ -6728,6 +7218,275 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync2() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams2() + { + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + // End snippet + } + /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline index 8f8b927532..204fe410a0 100644 --- a/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline +++ b/src/test/java/com/google/api/codegen/gapic/testdata/csharp/csharp_samplegen_config_migration_library.baseline @@ -1747,6 +1747,93 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetShelfAsync + public async Task GetShelfAsync1() + { + // Snippet: GetShelfAsync(ShelfName,CallSettings) + // Additional: GetShelfAsync(ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf1() + { + // Snippet: GetShelf(ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync2() + { + // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) + // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf2() + { + // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync3() + { + // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf3() + { + // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); + // End snippet + } + /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -1954,6 +2041,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteShelfAsync + public async Task DeleteShelfAsync() + { + // Snippet: DeleteShelfAsync(ShelfName,CallSettings) + // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + await libraryServiceClient.DeleteShelfAsync(name); + // End snippet + } + + /// Snippet for DeleteShelf + public void DeleteShelf() + { + // Snippet: DeleteShelf(ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + libraryServiceClient.DeleteShelf(name); + // End snippet + } + /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -1987,6 +2101,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MergeShelvesAsync + public async Task MergeShelvesAsync() + { + // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) + // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MergeShelves + public void MergeShelves() + { + // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); + // End snippet + } + /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -2022,6 +2165,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for CreateBookAsync + public async Task CreateBookAsync() + { + // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) + // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.CreateBookAsync(name, book); + // End snippet + } + + /// Snippet for CreateBook + public void CreateBook() + { + // Snippet: CreateBook(ShelfName,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.CreateBook(name, book); + // End snippet + } + /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -2139,6 +2311,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookAsync + public async Task GetBookAsync() + { + // Snippet: GetBookAsync(BookName,CallSettings) + // Additional: GetBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = await libraryServiceClient.GetBookAsync(name); + // End snippet + } + + /// Snippet for GetBook + public void GetBook() + { + // Snippet: GetBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + Book response = libraryServiceClient.GetBook(name); + // End snippet + } + /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -2358,6 +2557,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync() + { + // Snippet: DeleteBookAsync(BookName,CallSettings) + // Additional: DeleteBookAsync(BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook() + { + // Snippet: DeleteBook(BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -2391,6 +2617,70 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync1() + { + // Snippet: UpdateBookAsync(BookName,Book,CallSettings) + // Additional: UpdateBookAsync(BookName,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, book); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook1() + { + // Snippet: UpdateBook(BookName,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, book); + // End snippet + } + + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync2() + { + // Snippet: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(BookName,string,Book,FieldMask,apis::FieldMask,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook2() + { + // Snippet: UpdateBook(BookName,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + /// Snippet for UpdateBookAsync public async Task UpdateBookAsync_RequestObject() { @@ -2426,6 +2716,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MoveBookAsync + public async Task MoveBookAsync() + { + // Snippet: MoveBookAsync(BookName,ShelfName,CallSettings) + // Additional: MoveBookAsync(BookName,ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MoveBook + public void MoveBook() + { + // Snippet: MoveBook(BookName,ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = libraryServiceClient.MoveBook(name, otherShelfName); + // End snippet + } + /// Snippet for MoveBookAsync public async Task MoveBookAsync_RequestObject() { @@ -2721,6 +3040,51 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync() + { + // Snippet: AddCommentsAsync(BookName,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookName,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + await libraryServiceClient.AddCommentsAsync(name, comments); + // End snippet + } + + /// Snippet for AddComments + public void AddComments() + { + // Snippet: AddComments(BookName,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + libraryServiceClient.AddComments(name, comments); + // End snippet + } + /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -2768,7 +3132,34 @@ namespace Google.Example.Library.V1.Snippets }, }; // Make the request - libraryServiceClient.AddComments(request); + libraryServiceClient.AddComments(request); + // End snippet + } + + /// Snippet for GetBookFromArchiveAsync + public async Task GetBookFromArchiveAsync() + { + // Snippet: GetBookFromArchiveAsync(ArchivedBookName,CallSettings) + // Additional: GetBookFromArchiveAsync(ArchivedBookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + // Make the request + BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name); + // End snippet + } + + /// Snippet for GetBookFromArchive + public void GetBookFromArchive() + { + // Snippet: GetBookFromArchive(ArchivedBookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE_PATH]", "[BOOK]"); + // Make the request + BookFromArchive response = libraryServiceClient.GetBookFromArchive(name); // End snippet } @@ -2805,6 +3196,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAnywhereAsync + public async Task GetBookFromAnywhereAsync() + { + // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookName,CallSettings) + // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName); + // End snippet + } + + /// Snippet for GetBookFromAnywhere + public void GetBookFromAnywhere() + { + // Snippet: GetBookFromAnywhere(BookNameOneof,BookName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookName altBookName = new BookName("[SHELF]", "[BOOK]"); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName); + // End snippet + } + /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -2840,6 +3260,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync + public async Task GetBookFromAbsolutelyAnywhereAsync() + { + // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhere + public void GetBookFromAbsolutelyAnywhere() + { + // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); + // End snippet + } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -2873,6 +3320,43 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookIndexAsync + public async Task UpdateBookIndexAsync() + { + // Snippet: UpdateBookIndexAsync(BookName,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(BookName,string,IDictionary,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); + // End snippet + } + + /// Snippet for UpdateBookIndex + public void UpdateBookIndex() + { + // Snippet: UpdateBookIndex(BookName,string,IDictionary,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookName name = new BookName("[SHELF]", "[BOOK]"); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); + // End snippet + } + /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -3537,7 +4021,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync() + public async Task TestOptionalRequiredFlatteningParamsAsync1() { // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) @@ -3549,7 +4033,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams() + public void TestOptionalRequiredFlatteningParams1() { // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) // Create client @@ -3559,6 +4043,211 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync2() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams2() + { + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookName,BookNameOneof,ProjectName,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName requiredSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName requiredSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookName optionalSingularResourceName = new BookName("[SHELF]", "[BOOK]"); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ProjectName optionalSingularResourceNameCommon = new ProjectName("[PROJECT]"); + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + // End snippet + } + /// Snippet for TestOptionalRequiredFlatteningParamsAsync public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() { diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index dc1ba91432..236d56c804 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -4951,6 +4951,93 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetShelfAsync + public async Task GetShelfAsync1() + { + // Snippet: GetShelfAsync(ShelfName,CallSettings) + // Additional: GetShelfAsync(ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf1() + { + // Snippet: GetShelf(ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync2() + { + // Snippet: GetShelfAsync(ShelfName,SomeMessage,CallSettings) + // Additional: GetShelfAsync(ShelfName,SomeMessage,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf2() + { + // Snippet: GetShelf(ShelfName,SomeMessage,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message); + // End snippet + } + + /// Snippet for GetShelfAsync + public async Task GetShelfAsync3() + { + // Snippet: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Additional: GetShelfAsync(ShelfName,SomeMessage,StringBuilder,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = await libraryServiceClient.GetShelfAsync(name, message, stringBuilder); + // End snippet + } + + /// Snippet for GetShelf + public void GetShelf3() + { + // Snippet: GetShelf(ShelfName,SomeMessage,StringBuilder,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + SomeMessage message = new SomeMessage(); + StringBuilder stringBuilder = new StringBuilder(); + // Make the request + Shelf response = libraryServiceClient.GetShelf(name, message, stringBuilder); + // End snippet + } + /// Snippet for GetShelfAsync public async Task GetShelfAsync_RequestObject() { @@ -5158,6 +5245,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteShelfAsync + public async Task DeleteShelfAsync() + { + // Snippet: DeleteShelfAsync(ShelfName,CallSettings) + // Additional: DeleteShelfAsync(ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + await libraryServiceClient.DeleteShelfAsync(name); + // End snippet + } + + /// Snippet for DeleteShelf + public void DeleteShelf() + { + // Snippet: DeleteShelf(ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + // Make the request + libraryServiceClient.DeleteShelf(name); + // End snippet + } + /// Snippet for DeleteShelfAsync public async Task DeleteShelfAsync_RequestObject() { @@ -5191,6 +5305,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for MergeShelvesAsync + public async Task MergeShelvesAsync() + { + // Snippet: MergeShelvesAsync(ShelfName,ShelfName,CallSettings) + // Additional: MergeShelvesAsync(ShelfName,ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = await libraryServiceClient.MergeShelvesAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MergeShelves + public void MergeShelves() + { + // Snippet: MergeShelves(ShelfName,ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Shelf response = libraryServiceClient.MergeShelves(name, otherShelfName); + // End snippet + } + /// Snippet for MergeShelvesAsync public async Task MergeShelvesAsync_RequestObject() { @@ -5226,6 +5369,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for CreateBookAsync + public async Task CreateBookAsync() + { + // Snippet: CreateBookAsync(ShelfName,Book,CallSettings) + // Additional: CreateBookAsync(ShelfName,Book,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = await libraryServiceClient.CreateBookAsync(name, book); + // End snippet + } + + /// Snippet for CreateBook + public void CreateBook() + { + // Snippet: CreateBook(ShelfName,Book,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName name = new ShelfName("[SHELF]"); + Book book = new Book(); + // Make the request + Book response = libraryServiceClient.CreateBook(name, book); + // End snippet + } + /// Snippet for CreateBookAsync public async Task CreateBookAsync_RequestObject() { @@ -5261,6 +5433,47 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for PublishSeriesAsync + public async Task PublishSeriesAsync() + { + // Snippet: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) + // Additional: PublishSeriesAsync(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + // Make the request + PublishSeriesResponse response = await libraryServiceClient.PublishSeriesAsync(shelf, books, edition, seriesUuid, publisher); + // End snippet + } + + /// Snippet for PublishSeries + public void PublishSeries() + { + // Snippet: PublishSeries(Shelf,IEnumerable,uint?,SeriesUuid,PublisherName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + Shelf shelf = new Shelf(); + IEnumerable books = new List(); + uint edition = 0; + SeriesUuid seriesUuid = new SeriesUuid + { + SeriesString = "foobar", + }; + PublisherName publisher = new PublisherName("[PROJECT]", "[LOCATION]", "[PUBLISHER]"); + // Make the request + PublishSeriesResponse response = libraryServiceClient.PublishSeries(shelf, books, edition, seriesUuid, publisher); + // End snippet + } + /// Snippet for PublishSeriesAsync public async Task PublishSeriesAsync_RequestObject() { @@ -5304,6 +5517,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookAsync + public async Task GetBookAsync() + { + // Snippet: GetBookAsync(BookNameOneof,CallSettings) + // Additional: GetBookAsync(BookNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Book response = await libraryServiceClient.GetBookAsync(name); + // End snippet + } + + /// Snippet for GetBook + public void GetBook() + { + // Snippet: GetBook(BookNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + Book response = libraryServiceClient.GetBook(name); + // End snippet + } + /// Snippet for GetBookAsync public async Task GetBookAsync_RequestObject() { @@ -5523,6 +5763,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for DeleteBookAsync + public async Task DeleteBookAsync() + { + // Snippet: DeleteBookAsync(BookNameOneof,CallSettings) + // Additional: DeleteBookAsync(BookNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + await libraryServiceClient.DeleteBookAsync(name); + // End snippet + } + + /// Snippet for DeleteBook + public void DeleteBook() + { + // Snippet: DeleteBook(BookNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + libraryServiceClient.DeleteBook(name); + // End snippet + } + /// Snippet for DeleteBookAsync public async Task DeleteBookAsync_RequestObject() { @@ -5557,53 +5824,146 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for UpdateBookAsync - public async Task UpdateBookAsync_RequestObject() + public async Task UpdateBookAsync1() { - // Snippet: UpdateBookAsync(UpdateBookRequest,CallSettings) - // Additional: UpdateBookAsync(UpdateBookRequest,CancellationToken) + // Snippet: UpdateBookAsync(BookNameOneof,Book,CallSettings) + // Additional: UpdateBookAsync(BookNameOneof,Book,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - UpdateBookRequest request = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), - }; + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); // Make the request - Book response = await libraryServiceClient.UpdateBookAsync(request); + Book response = await libraryServiceClient.UpdateBookAsync(name, book); // End snippet } /// Snippet for UpdateBook - public void UpdateBook_RequestObject() + public void UpdateBook1() { - // Snippet: UpdateBook(UpdateBookRequest,CallSettings) + // Snippet: UpdateBook(BookNameOneof,Book,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - UpdateBookRequest request = new UpdateBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - Book = new Book(), - }; + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + Book book = new Book(); // Make the request - Book response = libraryServiceClient.UpdateBook(request); + Book response = libraryServiceClient.UpdateBook(name, book); // End snippet } - /// Snippet for MoveBookAsync - public async Task MoveBookAsync_RequestObject() + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync2() { - // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) - // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) + // Snippet: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Additional: UpdateBookAsync(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - MoveBookRequest request = new MoveBookRequest - { - BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), - }; + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook2() + { + // Snippet: UpdateBook(BookNameOneof,string,Book,FieldMask,apis::FieldMask,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalFoo = ""; + Book book = new Book(); + FieldMask updateMask = new FieldMask(); + apis::FieldMask physicalMask = new apis::FieldMask(); + // Make the request + Book response = libraryServiceClient.UpdateBook(name, optionalFoo, book, updateMask, physicalMask); + // End snippet + } + + /// Snippet for UpdateBookAsync + public async Task UpdateBookAsync_RequestObject() + { + // Snippet: UpdateBookAsync(UpdateBookRequest,CallSettings) + // Additional: UpdateBookAsync(UpdateBookRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + UpdateBookRequest request = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; + // Make the request + Book response = await libraryServiceClient.UpdateBookAsync(request); + // End snippet + } + + /// Snippet for UpdateBook + public void UpdateBook_RequestObject() + { + // Snippet: UpdateBook(UpdateBookRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + UpdateBookRequest request = new UpdateBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + Book = new Book(), + }; + // Make the request + Book response = libraryServiceClient.UpdateBook(request); + // End snippet + } + + /// Snippet for MoveBookAsync + public async Task MoveBookAsync() + { + // Snippet: MoveBookAsync(BookNameOneof,ShelfName,CallSettings) + // Additional: MoveBookAsync(BookNameOneof,ShelfName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = await libraryServiceClient.MoveBookAsync(name, otherShelfName); + // End snippet + } + + /// Snippet for MoveBook + public void MoveBook() + { + // Snippet: MoveBook(BookNameOneof,ShelfName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + ShelfName otherShelfName = new ShelfName("[SHELF]"); + // Make the request + Book response = libraryServiceClient.MoveBook(name, otherShelfName); + // End snippet + } + + /// Snippet for MoveBookAsync + public async Task MoveBookAsync_RequestObject() + { + // Snippet: MoveBookAsync(MoveBookRequest,CallSettings) + // Additional: MoveBookAsync(MoveBookRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + MoveBookRequest request = new MoveBookRequest + { + BookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + OtherShelfNameAsShelfName = new ShelfName("[SHELF]"), + }; // Make the request Book response = await libraryServiceClient.MoveBookAsync(request); // End snippet @@ -5886,6 +6246,51 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for AddCommentsAsync + public async Task AddCommentsAsync() + { + // Snippet: AddCommentsAsync(BookNameOneof,IEnumerable,CallSettings) + // Additional: AddCommentsAsync(BookNameOneof,IEnumerable,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + await libraryServiceClient.AddCommentsAsync(name, comments); + // End snippet + } + + /// Snippet for AddComments + public void AddComments() + { + // Snippet: AddComments(BookNameOneof,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + IEnumerable comments = new[] + { + new Comment + { + Comment = ByteString.Empty, + Stage = Comment.Types.Stage.Unset, + Alignment = SomeMessage2.Types.SomeMessage3.Types.Alignment.Char, + }, + }; + // Make the request + libraryServiceClient.AddComments(name, comments); + // End snippet + } + /// Snippet for AddCommentsAsync public async Task AddCommentsAsync_RequestObject() { @@ -5937,6 +6342,35 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromArchiveAsync + public async Task GetBookFromArchiveAsync() + { + // Snippet: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CallSettings) + // Additional: GetBookFromArchiveAsync(ArchivedBookName,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + // Make the request + BookFromArchive response = await libraryServiceClient.GetBookFromArchiveAsync(name, parent); + // End snippet + } + + /// Snippet for GetBookFromArchive + public void GetBookFromArchive() + { + // Snippet: GetBookFromArchive(ArchivedBookName,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchivedBookName name = new ArchivedBookName("[ARCHIVE]", "[BOOK]"); + ProjectName parent = new ProjectName("[PROJECT]"); + // Make the request + BookFromArchive response = libraryServiceClient.GetBookFromArchive(name, parent); + // End snippet + } + /// Snippet for GetBookFromArchiveAsync public async Task GetBookFromArchiveAsync_RequestObject() { @@ -5972,6 +6406,39 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAnywhereAsync + public async Task GetBookFromAnywhereAsync() + { + // Snippet: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) + // Additional: GetBookFromAnywhereAsync(BookNameOneof,BookNameOneof,LocationName,FolderName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAnywhereAsync(name, altBookName, place, folder); + // End snippet + } + + /// Snippet for GetBookFromAnywhere + public void GetBookFromAnywhere() + { + // Snippet: GetBookFromAnywhere(BookNameOneof,BookNameOneof,LocationName,FolderName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof altBookName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + LocationName place = new LocationName("[PROJECT]", "[LOCATION]"); + FolderName folder = new FolderName("[FOLDER]"); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAnywhere(name, altBookName, place, folder); + // End snippet + } + /// Snippet for GetBookFromAnywhereAsync public async Task GetBookFromAnywhereAsync_RequestObject() { @@ -6011,6 +6478,33 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync + public async Task GetBookFromAbsolutelyAnywhereAsync() + { + // Snippet: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CallSettings) + // Additional: GetBookFromAbsolutelyAnywhereAsync(BookNameOneof,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = await libraryServiceClient.GetBookFromAbsolutelyAnywhereAsync(name); + // End snippet + } + + /// Snippet for GetBookFromAbsolutelyAnywhere + public void GetBookFromAbsolutelyAnywhere() + { + // Snippet: GetBookFromAbsolutelyAnywhere(BookNameOneof,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + // Make the request + BookFromAnywhere response = libraryServiceClient.GetBookFromAbsolutelyAnywhere(name); + // End snippet + } + /// Snippet for GetBookFromAbsolutelyAnywhereAsync public async Task GetBookFromAbsolutelyAnywhereAsync_RequestObject() { @@ -6044,6 +6538,43 @@ namespace Google.Example.Library.V1.Snippets // End snippet } + /// Snippet for UpdateBookIndexAsync + public async Task UpdateBookIndexAsync() + { + // Snippet: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CallSettings) + // Additional: UpdateBookIndexAsync(BookNameOneof,string,IDictionary,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + await libraryServiceClient.UpdateBookIndexAsync(name, indexName, indexMap); + // End snippet + } + + /// Snippet for UpdateBookIndex + public void UpdateBookIndex() + { + // Snippet: UpdateBookIndex(BookNameOneof,string,IDictionary,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + BookNameOneof name = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string indexName = "default index"; + IDictionary indexMap = new Dictionary + { + { "default_key", "" }, + }; + // Make the request + libraryServiceClient.UpdateBookIndex(name, indexName, indexMap); + // End snippet + } + /// Snippet for UpdateBookIndexAsync public async Task UpdateBookIndexAsync_RequestObject() { @@ -6679,7 +7210,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync() + public async Task TestOptionalRequiredFlatteningParamsAsync1() { // Snippet: TestOptionalRequiredFlatteningParamsAsync(CallSettings) // Additional: TestOptionalRequiredFlatteningParamsAsync(CancellationToken) @@ -6691,7 +7222,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParams - public void TestOptionalRequiredFlatteningParams() + public void TestOptionalRequiredFlatteningParams1() { // Snippet: TestOptionalRequiredFlatteningParams(CallSettings) // Create client @@ -6702,27 +7233,296 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for TestOptionalRequiredFlatteningParamsAsync - public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() + public async Task TestOptionalRequiredFlatteningParamsAsync2() { - // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) - // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) + // Snippet: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest - { - RequiredSingularInt32 = 0, - RequiredSingularInt64 = 0L, - RequiredSingularFloat = 0.0f, - RequiredSingularDouble = 0.0, - RequiredSingularBool = false, - RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, - RequiredSingularString = "", - RequiredSingularBytes = ByteString.Empty, - RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), - RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), - RequiredSingularResourceNameCommon = "", + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = ""; + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = ""; + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = await libraryServiceClient.TestOptionalRequiredFlatteningParamsAsync(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParams + public void TestOptionalRequiredFlatteningParams2() + { + // Snippet: TestOptionalRequiredFlatteningParams(int,long,float,double,bool,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int,long,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,int?,long?,float?,double?,bool?,TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum?,string,ByteString,TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage,BookNameOneof,BookNameOneof,string,int?,long?,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IDictionary,Any,Struct,Value,ListValue,Timestamp,Duration,FieldMask,int?,uint?,long?,ulong?,float?,double?,string,bool?,ByteString,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,IEnumerable,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + int requiredSingularInt32 = 0; + long requiredSingularInt64 = 0L; + float requiredSingularFloat = 0.0f; + double requiredSingularDouble = 0.0; + bool requiredSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum requiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string requiredSingularString = ""; + ByteString requiredSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage requiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof requiredSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof requiredSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string requiredSingularResourceNameCommon = ""; + int requiredSingularFixed32 = 0; + long requiredSingularFixed64 = 0L; + IEnumerable requiredRepeatedInt32 = new List(); + IEnumerable requiredRepeatedInt64 = new List(); + IEnumerable requiredRepeatedFloat = new List(); + IEnumerable requiredRepeatedDouble = new List(); + IEnumerable requiredRepeatedBool = new List(); + IEnumerable requiredRepeatedEnum = new List(); + IEnumerable requiredRepeatedString = new List(); + IEnumerable requiredRepeatedBytes = new List(); + IEnumerable requiredRepeatedMessage = new List(); + IEnumerable requiredRepeatedResourceName = new List(); + IEnumerable requiredRepeatedResourceNameOneof = new List(); + IEnumerable requiredRepeatedResourceNameCommon = new List(); + IEnumerable requiredRepeatedFixed32 = new List(); + IEnumerable requiredRepeatedFixed64 = new List(); + IDictionary requiredMap = new Dictionary(); + Any requiredAnyValue = new Any(); + Struct requiredStructValue = new Struct(); + Value requiredValueValue = new Value(); + ListValue requiredListValueValue = new ListValue(); + Timestamp requiredTimeValue = new Timestamp(); + Duration requiredDurationValue = new Duration(); + FieldMask requiredFieldMaskValue = new FieldMask(); + int? requiredInt32Value = null; + uint? requiredUint32Value = null; + long? requiredInt64Value = null; + ulong? requiredUint64Value = null; + float? requiredFloatValue = null; + double? requiredDoubleValue = null; + string requiredStringValue = null; + bool? requiredBoolValue = null; + ByteString requiredBytesValue = null; + IEnumerable requiredRepeatedAnyValue = new List(); + IEnumerable requiredRepeatedStructValue = new List(); + IEnumerable requiredRepeatedValueValue = new List(); + IEnumerable requiredRepeatedListValueValue = new List(); + IEnumerable requiredRepeatedTimeValue = new List(); + IEnumerable requiredRepeatedDurationValue = new List(); + IEnumerable requiredRepeatedFieldMaskValue = new List(); + IEnumerable requiredRepeatedInt32Value = new List(); + IEnumerable requiredRepeatedUint32Value = new List(); + IEnumerable requiredRepeatedInt64Value = new List(); + IEnumerable requiredRepeatedUint64Value = new List(); + IEnumerable requiredRepeatedFloatValue = new List(); + IEnumerable requiredRepeatedDoubleValue = new List(); + IEnumerable requiredRepeatedStringValue = new List(); + IEnumerable requiredRepeatedBoolValue = new List(); + IEnumerable requiredRepeatedBytesValue = new List(); + int optionalSingularInt32 = 0; + long optionalSingularInt64 = 0L; + float optionalSingularFloat = 0.0f; + double optionalSingularDouble = 0.0; + bool optionalSingularBool = false; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum optionalSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero; + string optionalSingularString = ""; + ByteString optionalSingularBytes = ByteString.Empty; + TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage optionalSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(); + BookNameOneof optionalSingularResourceName = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + BookNameOneof optionalSingularResourceNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")); + string optionalSingularResourceNameCommon = ""; + int optionalSingularFixed32 = 0; + long optionalSingularFixed64 = 0L; + IEnumerable optionalRepeatedInt32 = new List(); + IEnumerable optionalRepeatedInt64 = new List(); + IEnumerable optionalRepeatedFloat = new List(); + IEnumerable optionalRepeatedDouble = new List(); + IEnumerable optionalRepeatedBool = new List(); + IEnumerable optionalRepeatedEnum = new List(); + IEnumerable optionalRepeatedString = new List(); + IEnumerable optionalRepeatedBytes = new List(); + IEnumerable optionalRepeatedMessage = new List(); + IEnumerable optionalRepeatedResourceName = new List(); + IEnumerable optionalRepeatedResourceNameOneof = new List(); + IEnumerable optionalRepeatedResourceNameCommon = new List(); + IEnumerable optionalRepeatedFixed32 = new List(); + IEnumerable optionalRepeatedFixed64 = new List(); + IDictionary optionalMap = new Dictionary(); + Any anyValue = new Any(); + Struct structValue = new Struct(); + Value valueValue = new Value(); + ListValue listValueValue = new ListValue(); + Timestamp timeValue = new Timestamp(); + Duration durationValue = new Duration(); + FieldMask fieldMaskValue = new FieldMask(); + int? int32Value = null; + uint? uint32Value = null; + long? int64Value = null; + ulong? uint64Value = null; + float? floatValue = null; + double? doubleValue = null; + string stringValue = null; + bool? boolValue = null; + ByteString bytesValue = null; + IEnumerable repeatedAnyValue = new List(); + IEnumerable repeatedStructValue = new List(); + IEnumerable repeatedValueValue = new List(); + IEnumerable repeatedListValueValue = new List(); + IEnumerable repeatedTimeValue = new List(); + IEnumerable repeatedDurationValue = new List(); + IEnumerable repeatedFieldMaskValue = new List(); + IEnumerable repeatedInt32Value = new List(); + IEnumerable repeatedUint32Value = new List(); + IEnumerable repeatedInt64Value = new List(); + IEnumerable repeatedUint64Value = new List(); + IEnumerable repeatedFloatValue = new List(); + IEnumerable repeatedDoubleValue = new List(); + IEnumerable repeatedStringValue = new List(); + IEnumerable repeatedBoolValue = new List(); + IEnumerable repeatedBytesValue = new List(); + // Make the request + TestOptionalRequiredFlatteningParamsResponse response = libraryServiceClient.TestOptionalRequiredFlatteningParams(requiredSingularInt32, requiredSingularInt64, requiredSingularFloat, requiredSingularDouble, requiredSingularBool, requiredSingularEnum, requiredSingularString, requiredSingularBytes, requiredSingularMessage, requiredSingularResourceName, requiredSingularResourceNameOneof, requiredSingularResourceNameCommon, requiredSingularFixed32, requiredSingularFixed64, requiredRepeatedInt32, requiredRepeatedInt64, requiredRepeatedFloat, requiredRepeatedDouble, requiredRepeatedBool, requiredRepeatedEnum, requiredRepeatedString, requiredRepeatedBytes, requiredRepeatedMessage, requiredRepeatedResourceName, requiredRepeatedResourceNameOneof, requiredRepeatedResourceNameCommon, requiredRepeatedFixed32, requiredRepeatedFixed64, requiredMap, requiredAnyValue, requiredStructValue, requiredValueValue, requiredListValueValue, requiredTimeValue, requiredDurationValue, requiredFieldMaskValue, requiredInt32Value, requiredUint32Value, requiredInt64Value, requiredUint64Value, requiredFloatValue, requiredDoubleValue, requiredStringValue, requiredBoolValue, requiredBytesValue, requiredRepeatedAnyValue, requiredRepeatedStructValue, requiredRepeatedValueValue, requiredRepeatedListValueValue, requiredRepeatedTimeValue, requiredRepeatedDurationValue, requiredRepeatedFieldMaskValue, requiredRepeatedInt32Value, requiredRepeatedUint32Value, requiredRepeatedInt64Value, requiredRepeatedUint64Value, requiredRepeatedFloatValue, requiredRepeatedDoubleValue, requiredRepeatedStringValue, requiredRepeatedBoolValue, requiredRepeatedBytesValue, optionalSingularInt32, optionalSingularInt64, optionalSingularFloat, optionalSingularDouble, optionalSingularBool, optionalSingularEnum, optionalSingularString, optionalSingularBytes, optionalSingularMessage, optionalSingularResourceName, optionalSingularResourceNameOneof, optionalSingularResourceNameCommon, optionalSingularFixed32, optionalSingularFixed64, optionalRepeatedInt32, optionalRepeatedInt64, optionalRepeatedFloat, optionalRepeatedDouble, optionalRepeatedBool, optionalRepeatedEnum, optionalRepeatedString, optionalRepeatedBytes, optionalRepeatedMessage, optionalRepeatedResourceName, optionalRepeatedResourceNameOneof, optionalRepeatedResourceNameCommon, optionalRepeatedFixed32, optionalRepeatedFixed64, optionalMap, anyValue, structValue, valueValue, listValueValue, timeValue, durationValue, fieldMaskValue, int32Value, uint32Value, int64Value, uint64Value, floatValue, doubleValue, stringValue, boolValue, bytesValue, repeatedAnyValue, repeatedStructValue, repeatedValueValue, repeatedListValueValue, repeatedTimeValue, repeatedDurationValue, repeatedFieldMaskValue, repeatedInt32Value, repeatedUint32Value, repeatedInt64Value, repeatedUint64Value, repeatedFloatValue, repeatedDoubleValue, repeatedStringValue, repeatedBoolValue, repeatedBytesValue); + // End snippet + } + + /// Snippet for TestOptionalRequiredFlatteningParamsAsync + public async Task TestOptionalRequiredFlatteningParamsAsync_RequestObject() + { + // Snippet: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CallSettings) + // Additional: TestOptionalRequiredFlatteningParamsAsync(TestOptionalRequiredFlatteningParamsRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + TestOptionalRequiredFlatteningParamsRequest request = new TestOptionalRequiredFlatteningParamsRequest + { + RequiredSingularInt32 = 0, + RequiredSingularInt64 = 0L, + RequiredSingularFloat = 0.0f, + RequiredSingularDouble = 0.0, + RequiredSingularBool = false, + RequiredSingularEnum = TestOptionalRequiredFlatteningParamsRequest.Types.InnerEnum.Zero, + RequiredSingularString = "", + RequiredSingularBytes = ByteString.Empty, + RequiredSingularMessage = new TestOptionalRequiredFlatteningParamsRequest.Types.InnerMessage(), + RequiredSingularResourceNameAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameOneofAsBookNameOneof = BookNameOneof.From(new BookName("[SHELF]", "[BOOK]")), + RequiredSingularResourceNameCommon = "", RequiredSingularFixed32 = 0, RequiredSingularFixed64 = 0L, RequiredRepeatedInt32 = { }, @@ -6855,29 +7655,413 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync_RequestObject() + public async Task MoveBooksAsync1() { - // Snippet: MoveBooksAsync(MoveBooksRequest,CallSettings) - // Additional: MoveBooksAsync(MoveBooksRequest,CancellationToken) + // Snippet: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CancellationToken) // Create client LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); // Initialize request argument(s) - MoveBooksRequest request = new MoveBooksRequest(); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(request); + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); // End snippet } /// Snippet for MoveBooks - public void MoveBooks_RequestObject() + public void MoveBooks1() { - // Snippet: MoveBooks(MoveBooksRequest,CallSettings) + // Snippet: MoveBooks(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) // Create client LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); // Initialize request argument(s) - MoveBooksRequest request = new MoveBooksRequest(); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(request); + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync2() + { + // Snippet: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks2() + { + // Snippet: MoveBooks(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync3() + { + // Snippet: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks3() + { + // Snippet: MoveBooks(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync4() + { + // Snippet: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks4() + { + // Snippet: MoveBooks(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync5() + { + // Snippet: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks5() + { + // Snippet: MoveBooks(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync6() + { + // Snippet: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks6() + { + // Snippet: MoveBooks(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync7() + { + // Snippet: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks7() + { + // Snippet: MoveBooks(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName destination = new ArchiveName("[ARCHIVE]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync8() + { + // Snippet: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks8() + { + // Snippet: MoveBooks(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ShelfName destination = new ShelfName("[SHELF]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync9() + { + // Snippet: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Additional: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks9() + { + // Snippet: MoveBooks(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ProjectName destination = new ProjectName("[PROJECT]"); + IEnumerable publishers = new List(); + ProjectName project = new ProjectName("[PROJECT]"); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); + // End snippet + } + + /// Snippet for MoveBooksAsync + public async Task MoveBooksAsync_RequestObject() + { + // Snippet: MoveBooksAsync(MoveBooksRequest,CallSettings) + // Additional: MoveBooksAsync(MoveBooksRequest,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + MoveBooksRequest request = new MoveBooksRequest(); + // Make the request + MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(request); + // End snippet + } + + /// Snippet for MoveBooks + public void MoveBooks_RequestObject() + { + // Snippet: MoveBooks(MoveBooksRequest,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + MoveBooksRequest request = new MoveBooksRequest(); + // Make the request + MoveBooksResponse response = libraryServiceClient.MoveBooks(request); + // End snippet + } + + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync1() + { + // Snippet: ArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) + // Additional: ArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); + // End snippet + } + + /// Snippet for ArchiveBooks + public void ArchiveBooks1() + { + // Snippet: ArchiveBooks(ArchiveName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ArchiveName source = new ArchiveName("[ARCHIVE]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); + // End snippet + } + + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync2() + { + // Snippet: ArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) + // Additional: ArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); + // End snippet + } + + /// Snippet for ArchiveBooks + public void ArchiveBooks2() + { + // Snippet: ArchiveBooks(ShelfName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ShelfName source = new ShelfName("[SHELF]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); + // End snippet + } + + /// Snippet for ArchiveBooksAsync + public async Task ArchiveBooksAsync3() + { + // Snippet: ArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) + // Additional: ArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) + // Create client + LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); + // End snippet + } + + /// Snippet for ArchiveBooks + public void ArchiveBooks3() + { + // Snippet: ArchiveBooks(ProjectName,ArchiveName,CallSettings) + // Create client + LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); + // Initialize request argument(s) + ProjectName source = new ProjectName("[PROJECT]"); + ArchiveName archive = new ArchiveName("[ARCHIVE]"); + // Make the request + ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); // End snippet } From 49b9cb096e1f766bffe7cca8a1b767910f4c323e Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 15:51:50 -0800 Subject: [PATCH 35/36] stranger things! --- .../CSharpGapicSnippetsTransformer.java | 4 +- .../testdata/csharp_library.baseline | 468 +----------------- 2 files changed, 8 insertions(+), 464 deletions(-) diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index e7d012689c..efa8b65c48 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -542,8 +542,8 @@ private static List getFlatteningConfigsForSnippets( Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); return flatteningGroups .stream() - .map(FlatteningConfig::getFlatteningConfigsForSnippets) - .flatMap(List::stream) + .map(FlatteningConfig::getFlatteningConfigForUnitTests) + // .flatMap(List::stream) .collect(ImmutableList.toImmutableList()); } } diff --git a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline index 236d56c804..43c10e3557 100644 --- a/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline +++ b/src/test/java/com/google/api/codegen/protoannotations/testdata/csharp_library.baseline @@ -7655,7 +7655,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync1() + public async Task MoveBooksAsync() { // Snippet: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) // Additional: MoveBooksAsync(ArchiveName,ArchiveName,IEnumerable,ProjectName,CancellationToken) @@ -7672,7 +7672,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for MoveBooks - public void MoveBooks1() + public void MoveBooks() { // Snippet: MoveBooks(ArchiveName,ArchiveName,IEnumerable,ProjectName,CallSettings) // Create client @@ -7687,270 +7687,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync2() - { - // Snippet: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ArchiveName,ShelfName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks2() - { - // Snippet: MoveBooks(ArchiveName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync3() - { - // Snippet: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ArchiveName,ProjectName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks3() - { - // Snippet: MoveBooks(ArchiveName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ArchiveName source = new ArchiveName("[ARCHIVE]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync4() - { - // Snippet: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ShelfName,ArchiveName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks4() - { - // Snippet: MoveBooks(ShelfName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync5() - { - // Snippet: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ShelfName,ShelfName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks5() - { - // Snippet: MoveBooks(ShelfName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync6() - { - // Snippet: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ShelfName,ProjectName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks6() - { - // Snippet: MoveBooks(ShelfName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync7() - { - // Snippet: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ProjectName,ArchiveName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks7() - { - // Snippet: MoveBooks(ProjectName,ArchiveName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName destination = new ArchiveName("[ARCHIVE]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync8() - { - // Snippet: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ProjectName,ShelfName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks8() - { - // Snippet: MoveBooks(ProjectName,ShelfName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ShelfName destination = new ShelfName("[SHELF]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooksAsync - public async Task MoveBooksAsync9() - { - // Snippet: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Additional: MoveBooksAsync(ProjectName,ProjectName,IEnumerable,ProjectName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = await libraryServiceClient.MoveBooksAsync(source, destination, publishers, project); - // End snippet - } - - /// Snippet for MoveBooks - public void MoveBooks9() - { - // Snippet: MoveBooks(ProjectName,ProjectName,IEnumerable,ProjectName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ProjectName destination = new ProjectName("[PROJECT]"); - IEnumerable publishers = new List(); - ProjectName project = new ProjectName("[PROJECT]"); - // Make the request - MoveBooksResponse response = libraryServiceClient.MoveBooks(source, destination, publishers, project); - // End snippet - } - /// Snippet for MoveBooksAsync public async Task MoveBooksAsync_RequestObject() { @@ -7979,7 +7715,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync1() + public async Task ArchiveBooksAsync() { // Snippet: ArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) // Additional: ArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) @@ -7994,7 +7730,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for ArchiveBooks - public void ArchiveBooks1() + public void ArchiveBooks() { // Snippet: ArchiveBooks(ArchiveName,ArchiveName,CallSettings) // Create client @@ -8007,64 +7743,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync2() - { - // Snippet: ArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) - // Additional: ArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooks - public void ArchiveBooks2() - { - // Snippet: ArchiveBooks(ShelfName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooksAsync - public async Task ArchiveBooksAsync3() - { - // Snippet: ArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) - // Additional: ArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = await libraryServiceClient.ArchiveBooksAsync(source, archive); - // End snippet - } - - /// Snippet for ArchiveBooks - public void ArchiveBooks3() - { - // Snippet: ArchiveBooks(ProjectName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - ArchiveBooksResponse response = libraryServiceClient.ArchiveBooks(source, archive); - // End snippet - } - /// Snippet for ArchiveBooksAsync public async Task ArchiveBooksAsync_RequestObject() { @@ -8093,7 +7771,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync1() + public async Task LongRunningArchiveBooksAsync() { // Snippet: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CallSettings) // Additional: LongRunningArchiveBooksAsync(ArchiveName,ArchiveName,CancellationToken) @@ -8127,7 +7805,7 @@ namespace Google.Example.Library.V1.Snippets } /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks1() + public void LongRunningArchiveBooks() { // Snippet: LongRunningArchiveBooks(ArchiveName,ArchiveName,CallSettings) // Create client @@ -8159,140 +7837,6 @@ namespace Google.Example.Library.V1.Snippets // End snippet } - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync2() - { - // Snippet: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CallSettings) - // Additional: LongRunningArchiveBooksAsync(ShelfName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks2() - { - // Snippet: LongRunningArchiveBooks(ShelfName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ShelfName source = new ShelfName("[SHELF]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooksAsync - public async Task LongRunningArchiveBooksAsync3() - { - // Snippet: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CallSettings) - // Additional: LongRunningArchiveBooksAsync(ProjectName,ArchiveName,CancellationToken) - // Create client - LibraryServiceClient libraryServiceClient = await LibraryServiceClient.CreateAsync(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - await libraryServiceClient.LongRunningArchiveBooksAsync(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - await response.PollUntilCompletedAsync(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - await libraryServiceClient.PollOnceLongRunningArchiveBooksAsync(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - - /// Snippet for LongRunningArchiveBooks - public void LongRunningArchiveBooks3() - { - // Snippet: LongRunningArchiveBooks(ProjectName,ArchiveName,CallSettings) - // Create client - LibraryServiceClient libraryServiceClient = LibraryServiceClient.Create(); - // Initialize request argument(s) - ProjectName source = new ProjectName("[PROJECT]"); - ArchiveName archive = new ArchiveName("[ARCHIVE]"); - // Make the request - Operation response = - libraryServiceClient.LongRunningArchiveBooks(source, archive); - - // Poll until the returned long-running operation is complete - Operation completedResponse = - response.PollUntilCompleted(); - // Retrieve the operation result - ArchiveBooksResponse result = completedResponse.Result; - - // Or get the name of the operation - string operationName = response.Name; - // This name can be stored, then the long-running operation retrieved later by name - Operation retrievedResponse = - libraryServiceClient.PollOnceLongRunningArchiveBooks(operationName); - // Check if the retrieved long-running operation has completed - if (retrievedResponse.IsCompleted) - { - // If it has completed, then access the result - ArchiveBooksResponse retrievedResult = retrievedResponse.Result; - } - // End snippet - } - /// Snippet for LongRunningArchiveBooksAsync public async Task LongRunningArchiveBooksAsync_RequestObject() { From 85a63ec5155455ea919e99818f52d01ac5bcfb8e Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Thu, 30 Jan 2020 17:49:09 -0800 Subject: [PATCH 36/36] =?UTF-8?q?Saint=20Seiya=E2=80=9C=20=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/codegen/config/FieldConfig.java | 19 ++-- .../codegen/config/FieldConfigFactory.java | 62 +++++++--- .../api/codegen/config/FlatteningConfig.java | 87 +++----------- .../api/codegen/config/FlatteningConfigs.java | 63 +++++++++++ .../api/codegen/config/MethodConfig.java | 17 ++- .../api/codegen/metacode/InitCodeNode.java | 3 +- .../transformer/DefaultFeatureConfig.java | 6 - .../codegen/transformer/FeatureConfig.java | 6 - .../CSharpGapicSnippetsTransformer.java | 23 ++-- .../CSharpGapicUnitTestTransformer.java | 16 +-- .../java/JavaSurfaceTestTransformer.java | 19 +--- .../codegen/config/FlatteningConfigTest.java | 106 +++++++++++++++++- 12 files changed, 262 insertions(+), 165 deletions(-) create mode 100644 src/main/java/com/google/api/codegen/config/FlatteningConfigs.java diff --git a/src/main/java/com/google/api/codegen/config/FieldConfig.java b/src/main/java/com/google/api/codegen/config/FieldConfig.java index fb6c623d55..95b4481648 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfig.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfig.java @@ -36,14 +36,14 @@ public abstract class FieldConfig { @Nullable public abstract ResourceNameTreatment getResourceNameTreatment(); - /** The resource name config used in API surfaces. Used to generate flattened API methods. */ + /** The resource name config used to generate flattened API methods. */ @Nullable public abstract ResourceNameConfig getResourceNameConfig(); /** - * The resource name associated to the field in a proto message. Used to generate samples and - * tests in API methods that take request objects, and iterator methods (e.g., - * iterateAllAsBookName) in page streaming responses. + * The resource name config associated to a field in a proto message. Used to generate samples and + * tests for non-flattened methods, and iterator methods (e.g., iterateAllAsBookName) in page + * streaming responses. */ @Nullable public abstract ResourceNameConfig getMessageResourceNameConfig(); @@ -55,7 +55,7 @@ public ResourceNameType getResourceNameType() { return getResourceNameConfig().getResourceNameType(); } - private static FieldConfig createFieldConfig( + static FieldConfig createFieldConfig( FieldModel field, ResourceNameTreatment resourceNameTreatment, ResourceNameConfig resourceNameConfig, @@ -77,11 +77,6 @@ private static FieldConfig createFieldConfig( .build(); } - /** Creates a FieldConfig for the given Field with ResourceNameTreatment set to None. */ - public static FieldConfig createDefaultFieldConfig(FieldModel field) { - return FieldConfig.createFieldConfig(field, ResourceNameTreatment.NONE, null, null); - } - /** Package-private since this is not used outside the config package. */ static FieldConfig createFieldConfig( DiagCollector diagCollector, @@ -304,6 +299,10 @@ public static Builder newBuilder() { return new AutoValue_FieldConfig.Builder(); } + /** + * The string returned that the default toString() method generated by AutoValue is too verbose. + * Override it to provide just key information. + */ @Override public String toString() { String resourceNameEntityId = diff --git a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java index cceeb557b0..750d413dd7 100644 --- a/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java +++ b/src/main/java/com/google/api/codegen/config/FieldConfigFactory.java @@ -29,10 +29,18 @@ public class FieldConfigFactory { private FieldConfigFactory() {} - /* - * Create a FieldConfig for a field in a message. If the field is associated - * with multiple resource names through child_type resource reference, - * the created FieldConfig will pick one for its messageResourceNameConfig. + /** + * Create a FieldConfig for a field in a message. If the field is associated with multiple + * resource names through child_type resource reference, the created FieldConfig will pick one for + * its messageResourceNameConfig. + * + *

    It is safe to create just one FieldConfig for the purpose of generating samples and unit + * tests because we may use any resource name type in samples and tests. + * + *

    It is safe to create just one FieldConfig for the purpose of generating page streaming + * response helper methods because we only support paging over primitive fields in order not to + * break existing APIs (Logging, PubSub and Firestore) and will respect automatic pagination in + * https://aip.dev/client-libraries/4233. */ static FieldConfig createMessageFieldConfig( ResourceNameMessageConfigs messageConfigs, @@ -54,19 +62,27 @@ static FieldConfig createMessageFieldConfig( return null; } - static List createFlattenedFieldConfigs( + static FieldConfig createMessageFieldConfig( + DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, + ImmutableListMultimap fieldNamePatterns, Map resourceNameConfigs, FieldModel field, + ResourceNameTreatment treatment, ResourceNameTreatment defaultResourceNameTreatment) { - return createFlattenedFieldConfigs( - null, - messageConfigs, - null, - resourceNameConfigs, - field, - ResourceNameTreatment.UNSET_TREATMENT, - defaultResourceNameTreatment); + List configs = + createFlattenedFieldConfigs( + diagCollector, + messageConfigs, + fieldNamePatterns, + resourceNameConfigs, + field, + ResourceNameTreatment.UNSET_TREATMENT, + defaultResourceNameTreatment); + if (configs.size() >= 1) { + return configs.get(0); + } + return null; } /** @@ -105,6 +121,21 @@ static List createFlattenedFieldConfigs( *

  • ListFoos(String parent) -> ("Project", "Project", SAMPLE_ONLY); * */ + static List createFlattenedFieldConfigs( + ResourceNameMessageConfigs messageConfigs, + Map resourceNameConfigs, + FieldModel field, + ResourceNameTreatment defaultResourceNameTreatment) { + return createFlattenedFieldConfigs( + null, + messageConfigs, + null, + resourceNameConfigs, + field, + ResourceNameTreatment.UNSET_TREATMENT, + defaultResourceNameTreatment); + } + static List createFlattenedFieldConfigs( DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, @@ -225,4 +256,9 @@ private static List createFieldConfigForMultiResourceField( } return fieldConfigs.build(); } + + /** Creates a FieldConfig for the given Field with ResourceNameTreatment set to None. */ + public static FieldConfig createDefaultFieldConfig(FieldModel field) { + return FieldConfig.createFieldConfig(field, ResourceNameTreatment.NONE, null, null); + } } diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java index c8abc29255..24a12a805d 100644 --- a/src/main/java/com/google/api/codegen/config/FlatteningConfig.java +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfig.java @@ -25,7 +25,6 @@ import com.google.api.tools.framework.model.SimpleLocation; import com.google.auto.value.AutoValue; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; @@ -36,7 +35,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import javax.annotation.Nullable; @@ -58,7 +56,7 @@ private static void insertFlatteningsFromGapicConfig( ImmutableMap resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel methodModel, - ImmutableMap.Builder> flatteningConfigs) { + ImmutableList.Builder flatteningConfigs) { for (FlatteningGroupProto flatteningGroup : methodConfigProto.getFlattening().getGroupsList()) { FlatteningConfig groupConfig = @@ -70,13 +68,11 @@ private static void insertFlatteningsFromGapicConfig( flatteningGroup, methodModel); if (groupConfig != null) { - ImmutableList.Builder fieldConfigs = ImmutableList.builder(); - fieldConfigs.add(groupConfig); + flatteningConfigs.add(groupConfig); // We always generate an overload will all resource names treated as strings if (hasAnyResourceNameParameter(groupConfig)) { - fieldConfigs.add(groupConfig.withResourceNamesInSamplesOnly()); + flatteningConfigs.add(groupConfig.withResourceNamesInSamplesOnly()); } - flatteningConfigs.put(flatteningConfigToString(groupConfig), fieldConfigs.build()); } } } @@ -87,11 +83,7 @@ static ImmutableList createFlatteningConfigs( ImmutableMap resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel methodModel) { - // As a flattened field may have multiple resource name associated, a method_signature - // may end up with multiple method overloads as we generate all the combinations of - // resource name types. Therefore we group all the FlatteningConfigs generated from - // one method_signature in a list. - ImmutableMap.Builder> flatteningConfigs = ImmutableMap.builder(); + ImmutableList.Builder flatteningConfigs = ImmutableList.builder(); insertFlatteningsFromGapicConfig( diagCollector, messageConfigs, @@ -102,12 +94,7 @@ static ImmutableList createFlatteningConfigs( if (diagCollector.hasErrors()) { return null; } - return flatteningConfigs - .build() - .values() - .stream() - .flatMap(List::stream) - .collect(ImmutableList.toImmutableList()); + return flatteningConfigs.build(); } @VisibleForTesting @@ -120,7 +107,7 @@ static ImmutableList createFlatteningConfigs( ProtoMethodModel methodModel, ProtoParser protoParser) { - ImmutableMap.Builder> flatteningConfigs = ImmutableMap.builder(); + ImmutableList.Builder flatteningConfigs = ImmutableList.builder(); insertFlatteningsFromGapicConfig( diagCollector, @@ -140,12 +127,7 @@ static ImmutableList createFlatteningConfigs( if (diagCollector.hasErrors()) { return null; } - return flatteningConfigs - .build() - .values() - .stream() - .flatMap(List::stream) - .collect(ImmutableList.toImmutableList()); + return flatteningConfigs.build(); } /** @@ -158,7 +140,7 @@ private static void insertFlatteningConfigsFromProtoFile( ImmutableMap resourceNameConfigs, ProtoMethodModel methodModel, ProtoParser protoParser, - ImmutableMap.Builder> flatteningConfigs) { + ImmutableList.Builder flatteningConfigs) { // Get flattenings from protofile annotations, let these override flattenings from GAPIC config. List> methodSignatures = protoParser.getMethodSignatures(methodModel.getProtoMethod()); @@ -172,7 +154,7 @@ private static void insertFlatteningConfigsFromProtoFile( methodModel, protoParser); if (groupConfigs != null && !groupConfigs.isEmpty()) { - flatteningConfigs.put(flatteningConfigToString(groupConfigs.get(0)), groupConfigs); + flatteningConfigs.addAll(groupConfigs); } } } @@ -293,9 +275,8 @@ static List createFlatteningsFromProtoFile( flatteningConfigs = collectFieldConfigs(flatteningConfigs, fieldConfigs, parameter); } - // We also generate an overload that all singular resource names are treated as strings, - // if there is at least one singular resource name field in the method surface. Note repeated - // resource name fields are always treated as strings. + // We also generate an overload that all resource names are treated as strings, + // if there is at least one resource name field in the method surface. if (hasAnyResourceNameParameter(flatteningConfigs)) { flatteningConfigs.add(withResourceNamesInSamplesOnly(flatteningConfigs.get(0))); } @@ -307,7 +288,7 @@ static List createFlatteningsFromProtoFile( } /** - * Find all the combinations of FieldConfigs for a method_signature in a breadth-first search way. + * Find all the combinations of FieldConfigs for a method_signature using breadth-first search. */ private static List> collectFieldConfigs( List> flatteningConfigs, @@ -317,7 +298,10 @@ private static List> collectFieldConfigs( // Performance-wise this is not ideal but should be fine because there won't be too // many flatteningConfigs (should be almost always fewer than 5): // - // O(method_signatures * resource_name_fields_in_message * resources_per_field) + // O(flatteningConfigs) = + // O(method_signatures) + // * O(resource_name_fields_in_message) + // * O(resources_per_field) List> newFlatteningConfigs = new ArrayList<>(); // Inserts a dumb element to kick of the search @@ -392,44 +376,7 @@ public Iterable getFlattenedFields() { return FieldConfig.toFieldTypeIterable(getFlattenedFieldConfigs().values()); } - /** Returns a multimap from google.api.method_signature string to flattening configs. */ - public static ImmutableListMultimap groupByMethodSignature( - List flatteningConfigs) { - return flatteningConfigs - .stream() - .collect( - ImmutableListMultimap.toImmutableListMultimap( - FlatteningConfig::getMethodSignature, f -> f)); - } - - /** - * Returns a flattening config for unit tests. Choose one with resource name types in API surface - * if possible. - */ - public static FlatteningConfig getFlatteningConfigForUnitTests( - List flatteningConfigs) { - Preconditions.checkArgument(flatteningConfigs.size() > 0, "empty flattening configs"); - Optional flattening = - flatteningConfigs.stream().filter(FlatteningConfig::hasAnyResourceNameParameter).findAny(); - return flattening.isPresent() ? flattening.get() : flatteningConfigs.get(0); - } - - /** - * Returns flattening configs for samples. Eliminate those will only raw strings if there are - * other flattenings with resource name types that have the same method signature. - */ - public static List getFlatteningConfigsForSnippets( - List flatteningConfigs) { - Preconditions.checkArgument(flatteningConfigs.size() > 0, "empty flattening configs"); - List flatteningWithResourceTypes = - flatteningConfigs - .stream() - .filter(FlatteningConfig::hasAnyResourceNameParameter) - .collect(ImmutableList.toImmutableList()); - return flatteningWithResourceTypes.isEmpty() ? flatteningConfigs : flatteningWithResourceTypes; - } - - private String getMethodSignature() { + public String getMethodSignature() { return getFlattenedFieldConfigs().keySet().stream().collect(Collectors.joining(",")); } diff --git a/src/main/java/com/google/api/codegen/config/FlatteningConfigs.java b/src/main/java/com/google/api/codegen/config/FlatteningConfigs.java new file mode 100644 index 0000000000..d575b7666e --- /dev/null +++ b/src/main/java/com/google/api/codegen/config/FlatteningConfigs.java @@ -0,0 +1,63 @@ +/* Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.codegen.config; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.Multimaps; +import java.util.List; +import java.util.Optional; + +/** Utility class for FlatteningConfig. */ +public class FlatteningConfigs { + + private FlatteningConfigs() {} + + /** + * Returns a list of flattening configs to generate unit tests and samples for. Pick one from all + * flattening configs that have the same flattening fields. When there are multiple such + * flattening configs, choose one with resource name types if possible. + */ + public static List getRepresentativeFlatteningConfigs( + List flatteningConfigs) { + ImmutableList.Builder builder = ImmutableList.builder(); + for (List flatteningsByMethodSignature : + groupByMethodSignature(flatteningConfigs)) { + Optional flattening = + flatteningsByMethodSignature + .stream() + .filter(FlatteningConfig::hasAnyResourceNameParameter) + .findFirst(); + builder.add(flattening.isPresent() ? flattening.get() : flatteningConfigs.get(0)); + } + + return builder.build(); + } + + /** + * Return a list of list of flattening configs, where flattening configs in each inner list are + * generated from the same google.api.method_signature annotation. + */ + private static List> groupByMethodSignature( + List flatteningConfigs) { + ImmutableListMultimap configs = + flatteningConfigs + .stream() + .collect( + ImmutableListMultimap.toImmutableListMultimap( + FlatteningConfig::getMethodSignature, f -> f)); + return Multimaps.asMap(configs).values().stream().collect(ImmutableList.toImmutableList()); + } +} diff --git a/src/main/java/com/google/api/codegen/config/MethodConfig.java b/src/main/java/com/google/api/codegen/config/MethodConfig.java index a823f36099..8eea3704ea 100644 --- a/src/main/java/com/google/api/codegen/config/MethodConfig.java +++ b/src/main/java/com/google/api/codegen/config/MethodConfig.java @@ -191,15 +191,14 @@ static ImmutableList createFieldNameConfigs( ImmutableList.Builder fieldConfigsBuilder = ImmutableList.builder(); for (FieldModel field : fields) { fieldConfigsBuilder.add( - FieldConfigFactory.createFlattenedFieldConfigs( - diagCollector, - messageConfigs, - fieldNamePatterns, - resourceNameConfigs, - field, - ResourceNameTreatment.UNSET_TREATMENT, - defaultResourceNameTreatment) - .get(0)); + FieldConfigFactory.createMessageFieldConfig( + diagCollector, + messageConfigs, + fieldNamePatterns, + resourceNameConfigs, + field, + ResourceNameTreatment.UNSET_TREATMENT, + defaultResourceNameTreatment)); } return fieldConfigsBuilder.build(); } diff --git a/src/main/java/com/google/api/codegen/metacode/InitCodeNode.java b/src/main/java/com/google/api/codegen/metacode/InitCodeNode.java index 6a0beff4b1..facf68e112 100644 --- a/src/main/java/com/google/api/codegen/metacode/InitCodeNode.java +++ b/src/main/java/com/google/api/codegen/metacode/InitCodeNode.java @@ -15,6 +15,7 @@ package com.google.api.codegen.metacode; import com.google.api.codegen.config.FieldConfig; +import com.google.api.codegen.config.FieldConfigFactory; import com.google.api.codegen.config.FieldModel; import com.google.api.codegen.config.OneofConfig; import com.google.api.codegen.config.ProtoTypeRef; @@ -571,7 +572,7 @@ private static FieldConfig getChildFieldConfig( } FieldConfig fieldConfig = fieldConfigMap.get(childField.getFullName()); if (fieldConfig == null) { - fieldConfig = FieldConfig.createDefaultFieldConfig(childField); + fieldConfig = FieldConfigFactory.createDefaultFieldConfig(childField); } return fieldConfig; } else { diff --git a/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java b/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java index a2ef333d95..dff2488d55 100644 --- a/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java +++ b/src/main/java/com/google/api/codegen/transformer/DefaultFeatureConfig.java @@ -100,12 +100,6 @@ public boolean useResourceNameConverters(FieldConfig fieldConfig) { return !resourceNameProtoAccessorsEnabled() && useResourceNameFormatOption(fieldConfig); } - @Override - public boolean useResourceNameConvertersInSample(MethodContext context, FieldConfig fieldConfig) { - return !resourceNameProtoAccessorsEnabled() - && useResourceNameFormatOptionInSample(context, fieldConfig); - } - @Override public boolean useResourceNameConvertersInSampleOnly( MethodContext context, FieldConfig fieldConfig) { diff --git a/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java b/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java index 5f3493e6f6..c9f99459a6 100644 --- a/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java +++ b/src/main/java/com/google/api/codegen/transformer/FeatureConfig.java @@ -48,12 +48,6 @@ public interface FeatureConfig { */ boolean useResourceNameConverters(FieldConfig fieldConfig); - /** - * Returns true if useResourceNameFormatOptionInSample() is true but - * resourceNameProtoAccessorsEnabled() is false. - */ - boolean useResourceNameConvertersInSample(MethodContext context, FieldConfig fieldConfig); - /** * Returns true if useResourceNameFormatOptionInSampleOnly() is true but * resourceNameProtoAccessorsEnabled() is false. diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java index efa8b65c48..86e09f5319 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicSnippetsTransformer.java @@ -16,6 +16,7 @@ import com.google.api.codegen.config.FieldConfig; import com.google.api.codegen.config.FlatteningConfig; +import com.google.api.codegen.config.FlatteningConfigs; import com.google.api.codegen.config.GapicInterfaceContext; import com.google.api.codegen.config.GapicProductConfig; import com.google.api.codegen.config.InterfaceContext; @@ -42,8 +43,6 @@ import com.google.api.codegen.viewmodel.StaticLangApiMethodSnippetView; import com.google.api.codegen.viewmodel.StaticLangApiMethodView; import com.google.api.codegen.viewmodel.ViewModel; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Multimaps; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -133,7 +132,8 @@ private List generateMethods(InterfaceContext co } else if (methodContext.isLongRunningMethodContext()) { if (methodConfig.isFlattening()) { List flatteningGroups = - getFlatteningConfigsForSnippets(methodConfig.getFlatteningConfigs()); + FlatteningConfigs.getRepresentativeFlatteningConfigs( + methodConfig.getFlatteningConfigs()); boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { @@ -150,7 +150,8 @@ private List generateMethods(InterfaceContext co } else if (methodConfig.isPageStreaming()) { if (methodConfig.isFlattening()) { List flatteningGroups = - getFlatteningConfigsForSnippets(methodConfig.getFlatteningConfigs()); + FlatteningConfigs.getRepresentativeFlatteningConfigs( + methodConfig.getFlatteningConfigs()); // Find flattenings that have ambiguous parameters, and mark them to use named arguments. // Ambiguity occurs in a page-stream flattening that has one or two extra string // parameters (that are not resource-names) compared to any other flattening of this same @@ -207,7 +208,8 @@ private List generateMethods(InterfaceContext co } else { if (methodConfig.isFlattening()) { List flatteningGroups = - getFlatteningConfigsForSnippets(methodConfig.getFlatteningConfigs()); + FlatteningConfigs.getRepresentativeFlatteningConfigs( + methodConfig.getFlatteningConfigs()); boolean requiresNameSuffix = flatteningGroups.size() > 1; for (int i = 0; i < flatteningGroups.size(); i++) { FlatteningConfig flatteningGroup = flatteningGroups.get(i); @@ -535,15 +537,4 @@ private StaticLangApiMethodView generateInitCode( builder, context, fieldConfigs, initCodeOutputType, Arrays.asList(callingForm)); return builder.build(); } - - private static List getFlatteningConfigsForSnippets( - List flatteningConfigs) { - Collection> flatteningGroups = - Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); - return flatteningGroups - .stream() - .map(FlatteningConfig::getFlatteningConfigForUnitTests) - // .flatMap(List::stream) - .collect(ImmutableList.toImmutableList()); - } } diff --git a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java index 140cc0f756..ddc81a158a 100644 --- a/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/csharp/CSharpGapicUnitTestTransformer.java @@ -16,6 +16,7 @@ import com.google.api.codegen.config.FieldConfig; import com.google.api.codegen.config.FlatteningConfig; +import com.google.api.codegen.config.FlatteningConfigs; import com.google.api.codegen.config.GapicInterfaceContext; import com.google.api.codegen.config.GapicMethodContext; import com.google.api.codegen.config.GapicProductConfig; @@ -48,8 +49,6 @@ import com.google.api.codegen.viewmodel.testing.ClientTestClassView; import com.google.api.codegen.viewmodel.testing.ClientTestFileView; import com.google.api.codegen.viewmodel.testing.TestCaseView; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Multimaps; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -181,7 +180,8 @@ private List createTestCaseViews(GapicInterfaceContext context) { } GapicMethodContext requestContext = context.asRequestMethodContext(method); for (FlatteningConfig flatteningGroup : - getFlatteningConfigsForTests(methodConfig.getFlatteningConfigs())) { + FlatteningConfigs.getRepresentativeFlatteningConfigs( + methodConfig.getFlatteningConfigs())) { GapicMethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); @@ -291,14 +291,4 @@ private TestCaseView createFlattenedTestCase( initCodeRequestObjectContext, requestContext); } - - private static List getFlatteningConfigsForTests( - List flatteningConfigs) { - Collection> flatteningGroups = - Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); - return flatteningGroups - .stream() - .map(FlatteningConfig::getFlatteningConfigForUnitTests) - .collect(ImmutableList.toImmutableList()); - } } diff --git a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java index 0d35fa86ff..bcb3889a43 100644 --- a/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java +++ b/src/main/java/com/google/api/codegen/transformer/java/JavaSurfaceTestTransformer.java @@ -16,6 +16,7 @@ import com.google.api.codegen.config.ApiModel; import com.google.api.codegen.config.FlatteningConfig; +import com.google.api.codegen.config.FlatteningConfigs; import com.google.api.codegen.config.GapicProductConfig; import com.google.api.codegen.config.GrpcStreamingConfig.GrpcStreamingType; import com.google.api.codegen.config.InterfaceContext; @@ -54,10 +55,7 @@ import com.google.api.codegen.viewmodel.testing.MockServiceView; import com.google.api.codegen.viewmodel.testing.SmokeTestClassView; import com.google.api.codegen.viewmodel.testing.TestCaseView; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Multimaps; import java.util.ArrayList; -import java.util.Collection; import java.util.List; /** A subclass of ModelToViewTransformer which translates an ApiModel into API tests in Java. */ @@ -304,7 +302,9 @@ private List createTestCaseViews(InterfaceContext context) { clientMethodType = ClientMethodType.FlattenedMethod; } for (FlatteningConfig flatteningGroup : - getFlatteningConfigsForTests(methodConfig.getFlatteningConfigs())) { + FlatteningConfigs.getRepresentativeFlatteningConfigs( + FlatteningConfig.withRepeatedResourceInSampleOnly( + methodConfig.getFlatteningConfigs()))) { MethodContext methodContext = context.asFlattenedMethodContext(defaultMethodContext, flatteningGroup); InitCodeContext initCodeContext = @@ -505,15 +505,4 @@ private void addGrpcStreamingTestImports( } } } - - private static List getFlatteningConfigsForTests( - List flatteningConfigs) { - flatteningConfigs = FlatteningConfig.withRepeatedResourceInSampleOnly(flatteningConfigs); - Collection> flatteningGroups = - Multimaps.asMap(FlatteningConfig.groupByMethodSignature(flatteningConfigs)).values(); - return flatteningGroups - .stream() - .map(FlatteningConfig::getFlatteningConfigForUnitTests) - .collect(ImmutableList.toImmutableList()); - } } diff --git a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java index 6f367ed5c6..ef298adbbb 100644 --- a/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java +++ b/src/test/java/com/google/api/codegen/config/FlatteningConfigTest.java @@ -195,7 +195,23 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { .setField(destination) .build(); - FieldConfig animalsField = + FieldConfig animalsFieldFishResource = + FieldConfig.newBuilder() + .setResourceNameConfig(fish) + .setMessageResourceNameConfig(fish) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(animals) + .build(); + + FieldConfig animalsFieldBirdResource = + FieldConfig.newBuilder() + .setResourceNameConfig(bird) + .setMessageResourceNameConfig(bird) + .setResourceNameTreatment(ResourceNameTreatment.STATIC_TYPES) + .setField(animals) + .build(); + + FieldConfig animalsFieldSampleOnly = FieldConfig.newBuilder() .setResourceNameConfig(fish) .setMessageResourceNameConfig(fish) @@ -212,7 +228,39 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { "destination", destinationFieldStateResource, "animals", - animalsField)), + animalsFieldFishResource)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldCountyResource, + "destination", + destinationFieldStateResource, + "animals", + animalsFieldFishResource)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldStateResource, + "destination", + destinationFieldCountyResource, + "animals", + animalsFieldFishResource)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldCountyResource, + "destination", + destinationFieldCountyResource, + "animals", + animalsFieldFishResource)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldStateResource, + "destination", + destinationFieldStateResource, + "animals", + animalsFieldBirdResource)), new AutoValue_FlatteningConfig( ImmutableMap.of( "source", @@ -220,7 +268,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { "destination", destinationFieldStateResource, "animals", - animalsField)), + animalsFieldBirdResource)), new AutoValue_FlatteningConfig( ImmutableMap.of( "source", @@ -228,7 +276,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { "destination", destinationFieldCountyResource, "animals", - animalsField)), + animalsFieldBirdResource)), new AutoValue_FlatteningConfig( ImmutableMap.of( "source", @@ -236,7 +284,7 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { "destination", destinationFieldCountyResource, "animals", - animalsField)), + animalsFieldBirdResource)), new AutoValue_FlatteningConfig( ImmutableMap.of( "source", @@ -244,8 +292,54 @@ public void testCreateFlatteningConfigsWithResourceNameCombination() { "destination", destinationFieldSampleOnly, "animals", - animalsField))); + animalsFieldSampleOnly))); assertThat(flatteningConfigs).containsExactlyElementsIn(expectedFlatteningConfigs); + + List expectedFlatteningConfigs2 = + ImmutableList.of( + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldStateResource, + "destination", + destinationFieldStateResource, + "animals", + animalsFieldSampleOnly)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldCountyResource, + "destination", + destinationFieldStateResource, + "animals", + animalsFieldSampleOnly)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldStateResource, + "destination", + destinationFieldCountyResource, + "animals", + animalsFieldSampleOnly)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldCountyResource, + "destination", + destinationFieldCountyResource, + "animals", + animalsFieldSampleOnly)), + new AutoValue_FlatteningConfig( + ImmutableMap.of( + "source", + sourceFieldSampleOnly, + "destination", + destinationFieldSampleOnly, + "animals", + animalsFieldSampleOnly))); + + assertThat(FlatteningConfig.withRepeatedResourceInSampleOnly(flatteningConfigs)) + .containsExactlyElementsIn(expectedFlatteningConfigs2); } }