.setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) .setAppProfileId(APP_PROFILE_ID) .setAppProfile(
@Test public void testToProto() { CreateAppProfileRequest wrapper = CreateAppProfileRequest.of("my-instance", "my-profile") .setDescription("my description") .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster", true)) .setIgnoreWarnings(true); assertThat(wrapper.toProto("my-project")) .isEqualTo( com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() .setParent(InstanceName.of("my-project", "my-instance").toString()) .setAppProfileId("my-profile") .setAppProfile( com.google.bigtable.admin.v2.AppProfile.newBuilder() .setDescription("my description") .setSingleClusterRouting( SingleClusterRouting.newBuilder() .setClusterId("my-cluster") .setAllowTransactionalWrites(true))) .setIgnoreWarnings(true) .build()); }
.setParent(parent == null ? null : parent.toString()) .setAppProfileId(appProfileId) .setAppProfile(appProfile)
.setParent(parent) .setAppProfileId(appProfileId) .setAppProfile(appProfile)
/** * Creates the request protobuf. This method is considered an internal implementation detail and * not meant to be used by applications. */ @InternalApi public com.google.bigtable.admin.v2.CreateAppProfileRequest toProto(String projectId) { String name = NameUtil.formatInstanceName(projectId, instanceId); return proto.setParent(name).build(); } }
.setParent(parent) .setAppProfileId(appProfileId) .setAppProfile(appProfile)
.setParent(parent == null ? null : parent.toString()) .setAppProfileId(appProfileId) .setAppProfile(appProfile)
/** * Creates the request protobuf. This method is considered an internal implementation detail and * not meant to be used by applications. */ @InternalApi public com.google.bigtable.admin.v2.CreateAppProfileRequest toProto(String projectId) { String name = NameUtil.formatInstanceName(projectId, instanceId); return proto.setParent(name).build(); } }