public Builder mergeFrom(com.google.spanner.admin.instance.v1.ListInstancesRequest other) { if (other == com.google.spanner.admin.instance.v1.ListInstancesRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } if (!other.getFilter().isEmpty()) { filter_ = other.filter_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Override public Paginated<Instance> listInstances( int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException { ListInstancesRequest.Builder requestBuilder = ListInstancesRequest.newBuilder().setParent(projectName).setPageSize(pageSize); if (pageToken != null) { requestBuilder.setPageToken(pageToken); } if (filter != null) { requestBuilder.setFilter(filter); } ListInstancesRequest request = requestBuilder.build(); GrpcCallContext context = newCallContext(null, projectName); ListInstancesResponse response = get(instanceAdminStub.listInstancesCallable().futureCall(request, context)); return new Paginated<>(response.getInstancesList(), response.getNextPageToken()); }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.spanner.admin.instance.v1.ListInstancesRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.spanner.admin.instance.v1.ListInstancesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: * * `name` * * `display_name` * * `labels.key` where key is the name of a label * Some examples of using filters are: * * `name:*` --> The instance has a name. * * `name:Howl` --> The instance's name contains the string "howl". * * `name:HOWL` --> Equivalent to above. * * `NAME:howl` --> Equivalent to above. * * `labels.env:*` --> The instance has the label "env". * * `labels.env:dev` --> The instance has the label "env" and the value of * the label contains the string "dev". * * `name:howl labels.env:dev` --> The instance's name contains "howl" and * it has the label "env" with its value * containing "dev". * </pre> * * <code>string filter = 4;</code> */ public Builder clearFilter() { filter_ = getDefaultInstance().getFilter(); onChanged(); return this; } /**
/** * Lists all instances in the given project. * * <p>Sample code: * * <pre><code> * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (Instance element : instanceAdminClient.listInstances(parent).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent Required. The name of the project for which a list of instances is requested. * Values are of the form `projects/<project>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(ProjectName parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listInstances(request); }
/** * Lists all instances in the given project. * * <p>Sample code: * * <pre><code> * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (Instance element : instanceAdminClient.listInstances(parent.toString()).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent Required. The name of the project for which a list of instances is requested. * Values are of the form `projects/<project>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(String parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); return listInstances(request); }
public Builder mergeFrom(com.google.spanner.admin.instance.v1.ListInstancesRequest other) { if (other == com.google.spanner.admin.instance.v1.ListInstancesRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } if (!other.getFilter().isEmpty()) { filter_ = other.filter_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * * * <pre> * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] from a * previous [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. * </pre> * * <code>string page_token = 3;</code> */ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } pageToken_ = value; onChanged(); return this; } /**
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.spanner.admin.instance.v1.ListInstancesRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.spanner.admin.instance.v1.ListInstancesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * Required. The name of the project for which a list of instances is * requested. Values are of the form `projects/<project>`. * </pre> * * <code>string parent = 1;</code> */ public Builder setParentBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); parent_ = value; onChanged(); return this; }
/** * * * <pre> * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] from a * previous [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. * </pre> * * <code>string page_token = 3;</code> */ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); pageToken_ = value; onChanged(); return this; }
/** * * * <pre> * Required. The name of the project for which a list of instances is * requested. Values are of the form `projects/<project>`. * </pre> * * <code>string parent = 1;</code> */ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } parent_ = value; onChanged(); return this; } /**
@Override public Paginated<Instance> listInstances( int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException { ListInstancesRequest.Builder requestBuilder = ListInstancesRequest.newBuilder().setParent(projectName).setPageSize(pageSize); if (pageToken != null) { requestBuilder.setPageToken(pageToken); } if (filter != null) { requestBuilder.setFilter(filter); } ListInstancesRequest request = requestBuilder.build(); GrpcCallContext context = newCallContext(null, projectName); ListInstancesResponse response = get(instanceAdminStub.listInstancesCallable().futureCall(request, context)); return new Paginated<>(response.getInstancesList(), response.getNextPageToken()); }
/** * * * <pre> * Number of instances to be returned in the response. If 0 or less, defaults * to the server's maximum allowed page size. * </pre> * * <code>int32 page_size = 2;</code> */ public Builder setPageSize(int value) { pageSize_ = value; onChanged(); return this; } /**
/** * * * <pre> * If non-empty, `page_token` should contain a * [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] from a * previous [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. * </pre> * * <code>string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
/** * * * <pre> * Number of instances to be returned in the response. If 0 or less, defaults * to the server's maximum allowed page size. * </pre> * * <code>int32 page_size = 2;</code> */ public Builder clearPageSize() { pageSize_ = 0; onChanged(); return this; }
/** * * * <pre> * Required. The name of the project for which a list of instances is * requested. Values are of the form `projects/<project>`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**