Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit e7d9c5f

Browse files
feat: Add MySQL dialect to bigquerymigration v2 client library (#154)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 466417698 Source-Link: googleapis/googleapis@2bafaf1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/15db99606c2f37840475be9dfa5faa32d0844dbf Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTVkYjk5NjA2YzJmMzc4NDA0NzViZTlkZmE1ZmFhMzJkMDg0NGRiZiJ9
1 parent 3e40838 commit e7d9c5f

File tree

9 files changed

+898
-50
lines changed

9 files changed

+898
-50
lines changed

proto-google-cloud-bigquerymigration-v2/src/main/java/com/google/cloud/bigquery/migration/v2/Dialect.java

Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,26 @@ private Dialect(
328328
dialectValueCase_ = 13;
329329
break;
330330
}
331+
case 114:
332+
{
333+
com.google.cloud.bigquery.migration.v2.MySQLDialect.Builder subBuilder = null;
334+
if (dialectValueCase_ == 14) {
335+
subBuilder =
336+
((com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_)
337+
.toBuilder();
338+
}
339+
dialectValue_ =
340+
input.readMessage(
341+
com.google.cloud.bigquery.migration.v2.MySQLDialect.parser(),
342+
extensionRegistry);
343+
if (subBuilder != null) {
344+
subBuilder.mergeFrom(
345+
(com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_);
346+
dialectValue_ = subBuilder.buildPartial();
347+
}
348+
dialectValueCase_ = 14;
349+
break;
350+
}
331351
default:
332352
{
333353
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -384,6 +404,7 @@ public enum DialectValueCase
384404
SQL_SERVER_DIALECT(11),
385405
POSTGRESQL_DIALECT(12),
386406
PRESTO_DIALECT(13),
407+
MYSQL_DIALECT(14),
387408
DIALECTVALUE_NOT_SET(0);
388409
private final int value;
389410

@@ -428,6 +449,8 @@ public static DialectValueCase forNumber(int value) {
428449
return POSTGRESQL_DIALECT;
429450
case 13:
430451
return PRESTO_DIALECT;
452+
case 14:
453+
return MYSQL_DIALECT;
431454
case 0:
432455
return DIALECTVALUE_NOT_SET;
433456
default:
@@ -1117,6 +1140,57 @@ public com.google.cloud.bigquery.migration.v2.PrestoDialectOrBuilder getPrestoDi
11171140
return com.google.cloud.bigquery.migration.v2.PrestoDialect.getDefaultInstance();
11181141
}
11191142

1143+
public static final int MYSQL_DIALECT_FIELD_NUMBER = 14;
1144+
/**
1145+
*
1146+
*
1147+
* <pre>
1148+
* The MySQL dialect
1149+
* </pre>
1150+
*
1151+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
1152+
*
1153+
* @return Whether the mysqlDialect field is set.
1154+
*/
1155+
@java.lang.Override
1156+
public boolean hasMysqlDialect() {
1157+
return dialectValueCase_ == 14;
1158+
}
1159+
/**
1160+
*
1161+
*
1162+
* <pre>
1163+
* The MySQL dialect
1164+
* </pre>
1165+
*
1166+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
1167+
*
1168+
* @return The mysqlDialect.
1169+
*/
1170+
@java.lang.Override
1171+
public com.google.cloud.bigquery.migration.v2.MySQLDialect getMysqlDialect() {
1172+
if (dialectValueCase_ == 14) {
1173+
return (com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_;
1174+
}
1175+
return com.google.cloud.bigquery.migration.v2.MySQLDialect.getDefaultInstance();
1176+
}
1177+
/**
1178+
*
1179+
*
1180+
* <pre>
1181+
* The MySQL dialect
1182+
* </pre>
1183+
*
1184+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
1185+
*/
1186+
@java.lang.Override
1187+
public com.google.cloud.bigquery.migration.v2.MySQLDialectOrBuilder getMysqlDialectOrBuilder() {
1188+
if (dialectValueCase_ == 14) {
1189+
return (com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_;
1190+
}
1191+
return com.google.cloud.bigquery.migration.v2.MySQLDialect.getDefaultInstance();
1192+
}
1193+
11201194
private byte memoizedIsInitialized = -1;
11211195

11221196
@java.lang.Override
@@ -1179,6 +1253,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
11791253
if (dialectValueCase_ == 13) {
11801254
output.writeMessage(13, (com.google.cloud.bigquery.migration.v2.PrestoDialect) dialectValue_);
11811255
}
1256+
if (dialectValueCase_ == 14) {
1257+
output.writeMessage(14, (com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_);
1258+
}
11821259
unknownFields.writeTo(output);
11831260
}
11841261

@@ -1253,6 +1330,11 @@ public int getSerializedSize() {
12531330
com.google.protobuf.CodedOutputStream.computeMessageSize(
12541331
13, (com.google.cloud.bigquery.migration.v2.PrestoDialect) dialectValue_);
12551332
}
1333+
if (dialectValueCase_ == 14) {
1334+
size +=
1335+
com.google.protobuf.CodedOutputStream.computeMessageSize(
1336+
14, (com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_);
1337+
}
12561338
size += unknownFields.getSerializedSize();
12571339
memoizedSize = size;
12581340
return size;
@@ -1310,6 +1392,9 @@ public boolean equals(final java.lang.Object obj) {
13101392
case 13:
13111393
if (!getPrestoDialect().equals(other.getPrestoDialect())) return false;
13121394
break;
1395+
case 14:
1396+
if (!getMysqlDialect().equals(other.getMysqlDialect())) return false;
1397+
break;
13131398
case 0:
13141399
default:
13151400
}
@@ -1377,6 +1462,10 @@ public int hashCode() {
13771462
hash = (37 * hash) + PRESTO_DIALECT_FIELD_NUMBER;
13781463
hash = (53 * hash) + getPrestoDialect().hashCode();
13791464
break;
1465+
case 14:
1466+
hash = (37 * hash) + MYSQL_DIALECT_FIELD_NUMBER;
1467+
hash = (53 * hash) + getMysqlDialect().hashCode();
1468+
break;
13801469
case 0:
13811470
default:
13821471
}
@@ -1645,6 +1734,13 @@ public com.google.cloud.bigquery.migration.v2.Dialect buildPartial() {
16451734
result.dialectValue_ = prestoDialectBuilder_.build();
16461735
}
16471736
}
1737+
if (dialectValueCase_ == 14) {
1738+
if (mysqlDialectBuilder_ == null) {
1739+
result.dialectValue_ = dialectValue_;
1740+
} else {
1741+
result.dialectValue_ = mysqlDialectBuilder_.build();
1742+
}
1743+
}
16481744
result.dialectValueCase_ = dialectValueCase_;
16491745
onBuilt();
16501746
return result;
@@ -1761,6 +1857,11 @@ public Builder mergeFrom(com.google.cloud.bigquery.migration.v2.Dialect other) {
17611857
mergePrestoDialect(other.getPrestoDialect());
17621858
break;
17631859
}
1860+
case MYSQL_DIALECT:
1861+
{
1862+
mergeMysqlDialect(other.getMysqlDialect());
1863+
break;
1864+
}
17641865
case DIALECTVALUE_NOT_SET:
17651866
{
17661867
break;
@@ -4613,6 +4714,217 @@ public com.google.cloud.bigquery.migration.v2.PrestoDialect.Builder getPrestoDia
46134714
return prestoDialectBuilder_;
46144715
}
46154716

4717+
private com.google.protobuf.SingleFieldBuilderV3<
4718+
com.google.cloud.bigquery.migration.v2.MySQLDialect,
4719+
com.google.cloud.bigquery.migration.v2.MySQLDialect.Builder,
4720+
com.google.cloud.bigquery.migration.v2.MySQLDialectOrBuilder>
4721+
mysqlDialectBuilder_;
4722+
/**
4723+
*
4724+
*
4725+
* <pre>
4726+
* The MySQL dialect
4727+
* </pre>
4728+
*
4729+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4730+
*
4731+
* @return Whether the mysqlDialect field is set.
4732+
*/
4733+
@java.lang.Override
4734+
public boolean hasMysqlDialect() {
4735+
return dialectValueCase_ == 14;
4736+
}
4737+
/**
4738+
*
4739+
*
4740+
* <pre>
4741+
* The MySQL dialect
4742+
* </pre>
4743+
*
4744+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4745+
*
4746+
* @return The mysqlDialect.
4747+
*/
4748+
@java.lang.Override
4749+
public com.google.cloud.bigquery.migration.v2.MySQLDialect getMysqlDialect() {
4750+
if (mysqlDialectBuilder_ == null) {
4751+
if (dialectValueCase_ == 14) {
4752+
return (com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_;
4753+
}
4754+
return com.google.cloud.bigquery.migration.v2.MySQLDialect.getDefaultInstance();
4755+
} else {
4756+
if (dialectValueCase_ == 14) {
4757+
return mysqlDialectBuilder_.getMessage();
4758+
}
4759+
return com.google.cloud.bigquery.migration.v2.MySQLDialect.getDefaultInstance();
4760+
}
4761+
}
4762+
/**
4763+
*
4764+
*
4765+
* <pre>
4766+
* The MySQL dialect
4767+
* </pre>
4768+
*
4769+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4770+
*/
4771+
public Builder setMysqlDialect(com.google.cloud.bigquery.migration.v2.MySQLDialect value) {
4772+
if (mysqlDialectBuilder_ == null) {
4773+
if (value == null) {
4774+
throw new NullPointerException();
4775+
}
4776+
dialectValue_ = value;
4777+
onChanged();
4778+
} else {
4779+
mysqlDialectBuilder_.setMessage(value);
4780+
}
4781+
dialectValueCase_ = 14;
4782+
return this;
4783+
}
4784+
/**
4785+
*
4786+
*
4787+
* <pre>
4788+
* The MySQL dialect
4789+
* </pre>
4790+
*
4791+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4792+
*/
4793+
public Builder setMysqlDialect(
4794+
com.google.cloud.bigquery.migration.v2.MySQLDialect.Builder builderForValue) {
4795+
if (mysqlDialectBuilder_ == null) {
4796+
dialectValue_ = builderForValue.build();
4797+
onChanged();
4798+
} else {
4799+
mysqlDialectBuilder_.setMessage(builderForValue.build());
4800+
}
4801+
dialectValueCase_ = 14;
4802+
return this;
4803+
}
4804+
/**
4805+
*
4806+
*
4807+
* <pre>
4808+
* The MySQL dialect
4809+
* </pre>
4810+
*
4811+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4812+
*/
4813+
public Builder mergeMysqlDialect(com.google.cloud.bigquery.migration.v2.MySQLDialect value) {
4814+
if (mysqlDialectBuilder_ == null) {
4815+
if (dialectValueCase_ == 14
4816+
&& dialectValue_
4817+
!= com.google.cloud.bigquery.migration.v2.MySQLDialect.getDefaultInstance()) {
4818+
dialectValue_ =
4819+
com.google.cloud.bigquery.migration.v2.MySQLDialect.newBuilder(
4820+
(com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_)
4821+
.mergeFrom(value)
4822+
.buildPartial();
4823+
} else {
4824+
dialectValue_ = value;
4825+
}
4826+
onChanged();
4827+
} else {
4828+
if (dialectValueCase_ == 14) {
4829+
mysqlDialectBuilder_.mergeFrom(value);
4830+
} else {
4831+
mysqlDialectBuilder_.setMessage(value);
4832+
}
4833+
}
4834+
dialectValueCase_ = 14;
4835+
return this;
4836+
}
4837+
/**
4838+
*
4839+
*
4840+
* <pre>
4841+
* The MySQL dialect
4842+
* </pre>
4843+
*
4844+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4845+
*/
4846+
public Builder clearMysqlDialect() {
4847+
if (mysqlDialectBuilder_ == null) {
4848+
if (dialectValueCase_ == 14) {
4849+
dialectValueCase_ = 0;
4850+
dialectValue_ = null;
4851+
onChanged();
4852+
}
4853+
} else {
4854+
if (dialectValueCase_ == 14) {
4855+
dialectValueCase_ = 0;
4856+
dialectValue_ = null;
4857+
}
4858+
mysqlDialectBuilder_.clear();
4859+
}
4860+
return this;
4861+
}
4862+
/**
4863+
*
4864+
*
4865+
* <pre>
4866+
* The MySQL dialect
4867+
* </pre>
4868+
*
4869+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4870+
*/
4871+
public com.google.cloud.bigquery.migration.v2.MySQLDialect.Builder getMysqlDialectBuilder() {
4872+
return getMysqlDialectFieldBuilder().getBuilder();
4873+
}
4874+
/**
4875+
*
4876+
*
4877+
* <pre>
4878+
* The MySQL dialect
4879+
* </pre>
4880+
*
4881+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4882+
*/
4883+
@java.lang.Override
4884+
public com.google.cloud.bigquery.migration.v2.MySQLDialectOrBuilder getMysqlDialectOrBuilder() {
4885+
if ((dialectValueCase_ == 14) && (mysqlDialectBuilder_ != null)) {
4886+
return mysqlDialectBuilder_.getMessageOrBuilder();
4887+
} else {
4888+
if (dialectValueCase_ == 14) {
4889+
return (com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_;
4890+
}
4891+
return com.google.cloud.bigquery.migration.v2.MySQLDialect.getDefaultInstance();
4892+
}
4893+
}
4894+
/**
4895+
*
4896+
*
4897+
* <pre>
4898+
* The MySQL dialect
4899+
* </pre>
4900+
*
4901+
* <code>.google.cloud.bigquery.migration.v2.MySQLDialect mysql_dialect = 14;</code>
4902+
*/
4903+
private com.google.protobuf.SingleFieldBuilderV3<
4904+
com.google.cloud.bigquery.migration.v2.MySQLDialect,
4905+
com.google.cloud.bigquery.migration.v2.MySQLDialect.Builder,
4906+
com.google.cloud.bigquery.migration.v2.MySQLDialectOrBuilder>
4907+
getMysqlDialectFieldBuilder() {
4908+
if (mysqlDialectBuilder_ == null) {
4909+
if (!(dialectValueCase_ == 14)) {
4910+
dialectValue_ = com.google.cloud.bigquery.migration.v2.MySQLDialect.getDefaultInstance();
4911+
}
4912+
mysqlDialectBuilder_ =
4913+
new com.google.protobuf.SingleFieldBuilderV3<
4914+
com.google.cloud.bigquery.migration.v2.MySQLDialect,
4915+
com.google.cloud.bigquery.migration.v2.MySQLDialect.Builder,
4916+
com.google.cloud.bigquery.migration.v2.MySQLDialectOrBuilder>(
4917+
(com.google.cloud.bigquery.migration.v2.MySQLDialect) dialectValue_,
4918+
getParentForChildren(),
4919+
isClean());
4920+
dialectValue_ = null;
4921+
}
4922+
dialectValueCase_ = 14;
4923+
onChanged();
4924+
;
4925+
return mysqlDialectBuilder_;
4926+
}
4927+
46164928
@java.lang.Override
46174929
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
46184930
return super.setUnknownFields(unknownFields);

0 commit comments

Comments
 (0)