public Builder mergeFrom(com.google.bigtable.admin.v2.CreateAppProfileRequest other) { if (other == com.google.bigtable.admin.v2.CreateAppProfileRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (!other.getAppProfileId().isEmpty()) { appProfileId_ = other.appProfileId_; onChanged(); } if (other.hasAppProfile()) { mergeAppProfile(other.getAppProfile()); } if (other.getIgnoreWarnings() != false) { setIgnoreWarnings(other.getIgnoreWarnings()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
.setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) .setAppProfileId(APP_PROFILE_ID) .setAppProfile( com.google.bigtable.admin.v2.AppProfile.newBuilder() .setDescription("my description") com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny .getDefaultInstance())) .build();
/** * * * <pre> * The app profile to be created. * Fields marked `OutputOnly` will be ignored. * </pre> * * <code>.google.bigtable.admin.v2.AppProfile app_profile = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder> getAppProfileFieldBuilder() { if (appProfileBuilder_ == null) { appProfileBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder>( getAppProfile(), getParentForChildren(), isClean()); appProfile_ = null; } return appProfileBuilder_; }
.setParent(parent == null ? null : parent.toString()) .setAppProfileId(appProfileId) .setAppProfile(appProfile) .build(); return createAppProfile(request);
.setParent(parent) .setAppProfileId(appProfileId) .setAppProfile(appProfile) .build(); return createAppProfile(request);
/** * * * <pre> * The app profile to be created. * Fields marked `OutputOnly` will be ignored. * </pre> * * <code>.google.bigtable.admin.v2.AppProfile app_profile = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder> getAppProfileFieldBuilder() { if (appProfileBuilder_ == null) { appProfileBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder>( getAppProfile(), getParentForChildren(), isClean()); appProfile_ = null; } return appProfileBuilder_; }
public Builder mergeFrom(com.google.bigtable.admin.v2.CreateAppProfileRequest other) { if (other == com.google.bigtable.admin.v2.CreateAppProfileRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (!other.getAppProfileId().isEmpty()) { appProfileId_ = other.appProfileId_; onChanged(); } if (other.hasAppProfile()) { mergeAppProfile(other.getAppProfile()); } if (other.getIgnoreWarnings() != false) { setIgnoreWarnings(other.getIgnoreWarnings()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** Sets the routing policy for all read/write requests that use this app profile. */ @SuppressWarnings("WeakerAccess") public CreateAppProfileRequest setRoutingPolicy(RoutingPolicy routingPolicy) { Preconditions.checkNotNull(routingPolicy); if (routingPolicy instanceof MultiClusterRoutingPolicy) { proto .getAppProfileBuilder() .setMultiClusterRoutingUseAny(((MultiClusterRoutingPolicy) routingPolicy).toProto()); } else if (routingPolicy instanceof SingleClusterRoutingPolicy) { proto .getAppProfileBuilder() .setSingleClusterRouting(((SingleClusterRoutingPolicy) routingPolicy).toProto()); } else { throw new IllegalArgumentException("Unknown policy type: " + routingPolicy); } return this; }
@java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
private CreateAppProfileRequest(String instanceId, String appProfileId) { this.instanceId = instanceId; this.proto = com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder(); proto.setAppProfileId(appProfileId); proto.getAppProfileBuilder().setDescription(appProfileId); }
/** Sets the optional long form description of the use case for the AppProfile. */ @SuppressWarnings("WeakerAccess") public CreateAppProfileRequest setDescription(@Nonnull String description) { proto.getAppProfileBuilder().setDescription(description); return this; }
/** Configures if safety warnings should be disabled. */ @SuppressWarnings("WeakerAccess") public CreateAppProfileRequest setIgnoreWarnings(boolean value) { proto.setIgnoreWarnings(value); return this; }
@java.lang.Override public com.google.bigtable.admin.v2.CreateAppProfileRequest build() { com.google.bigtable.admin.v2.CreateAppProfileRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
/** * 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 == null ? null : parent.toString()) .setAppProfileId(appProfileId) .setAppProfile(appProfile) .build(); return createAppProfile(request);
.setParent(parent) .setAppProfileId(appProfileId) .setAppProfile(appProfile) .build(); return createAppProfile(request);
@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()); }
/** Sets the routing policy for all read/write requests that use this app profile. */ @SuppressWarnings("WeakerAccess") public CreateAppProfileRequest setRoutingPolicy(RoutingPolicy routingPolicy) { Preconditions.checkNotNull(routingPolicy); if (routingPolicy instanceof MultiClusterRoutingPolicy) { proto .getAppProfileBuilder() .setMultiClusterRoutingUseAny(((MultiClusterRoutingPolicy) routingPolicy).toProto()); } else if (routingPolicy instanceof SingleClusterRoutingPolicy) { proto .getAppProfileBuilder() .setSingleClusterRouting(((SingleClusterRoutingPolicy) routingPolicy).toProto()); } else { throw new IllegalArgumentException("Unknown policy type: " + routingPolicy); } return this; }