diff --git a/protos/google/cloud/bigquery/connection/v1/connection.proto b/protos/google/cloud/bigquery/connection/v1/connection.proto index 2d1eccf..3db05ef 100644 --- a/protos/google/cloud/bigquery/connection/v1/connection.proto +++ b/protos/google/cloud/bigquery/connection/v1/connection.proto @@ -230,6 +230,9 @@ message Connection { oneof properties { // Cloud SQL properties. CloudSqlProperties cloud_sql = 4; + + // Amazon Web Services (AWS) properties. + AwsProperties aws = 8; } // Output only. The creation timestamp of the connection. @@ -277,3 +280,29 @@ message CloudSqlCredential { // The password for the credential. string password = 2; } + +// Connection properties specific to Amazon Web Services (AWS). +message AwsProperties { + // Authentication method chosen at connection creation. + oneof authentication_method { + // Authentication using Google owned AWS IAM user's access key to assume + // into customer's AWS IAM Role. + AwsCrossAccountRole cross_account_role = 2; + } +} + +// Authentication method for Amazon Web Services (AWS) that uses Google owned +// AWS IAM user's access key to assume into customer's AWS IAM Role. +message AwsCrossAccountRole { + // The user’s AWS IAM Role that trusts the Google-owned AWS IAM user + // Connection. + string iam_role_id = 1; + + // Output only. Google-owned AWS IAM User for a Connection. + string iam_user_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A Google-generated id for representing Connection’s identity in AWS. + // External Id is also used for preventing the Confused Deputy Problem. See + // https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + string external_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 25b205b..e3a31bb 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -818,6 +818,9 @@ export namespace google { /** Connection cloudSql */ cloudSql?: (google.cloud.bigquery.connection.v1.ICloudSqlProperties|null); + /** Connection aws */ + aws?: (google.cloud.bigquery.connection.v1.IAwsProperties|null); + /** Connection creationTime */ creationTime?: (number|Long|string|null); @@ -849,6 +852,9 @@ export namespace google { /** Connection cloudSql. */ public cloudSql?: (google.cloud.bigquery.connection.v1.ICloudSqlProperties|null); + /** Connection aws. */ + public aws?: (google.cloud.bigquery.connection.v1.IAwsProperties|null); + /** Connection creationTime. */ public creationTime: (number|Long|string); @@ -859,7 +865,7 @@ export namespace google { public hasCredential: boolean; /** Connection properties. */ - public properties?: "cloudSql"; + public properties?: ("cloudSql"|"aws"); /** * Creates a new Connection instance using the specified properties. @@ -1145,6 +1151,201 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of an AwsProperties. */ + interface IAwsProperties { + + /** AwsProperties crossAccountRole */ + crossAccountRole?: (google.cloud.bigquery.connection.v1.IAwsCrossAccountRole|null); + } + + /** Represents an AwsProperties. */ + class AwsProperties implements IAwsProperties { + + /** + * Constructs a new AwsProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.connection.v1.IAwsProperties); + + /** AwsProperties crossAccountRole. */ + public crossAccountRole?: (google.cloud.bigquery.connection.v1.IAwsCrossAccountRole|null); + + /** AwsProperties authenticationMethod. */ + public authenticationMethod?: "crossAccountRole"; + + /** + * Creates a new AwsProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsProperties instance + */ + public static create(properties?: google.cloud.bigquery.connection.v1.IAwsProperties): google.cloud.bigquery.connection.v1.AwsProperties; + + /** + * Encodes the specified AwsProperties message. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsProperties.verify|verify} messages. + * @param message AwsProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.connection.v1.IAwsProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsProperties message, length delimited. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsProperties.verify|verify} messages. + * @param message AwsProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.connection.v1.IAwsProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.connection.v1.AwsProperties; + + /** + * Decodes an AwsProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.connection.v1.AwsProperties; + + /** + * Verifies an AwsProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AwsProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.connection.v1.AwsProperties; + + /** + * Creates a plain object from an AwsProperties message. Also converts values to other types if specified. + * @param message AwsProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.connection.v1.AwsProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AwsCrossAccountRole. */ + interface IAwsCrossAccountRole { + + /** AwsCrossAccountRole iamRoleId */ + iamRoleId?: (string|null); + + /** AwsCrossAccountRole iamUserId */ + iamUserId?: (string|null); + + /** AwsCrossAccountRole externalId */ + externalId?: (string|null); + } + + /** Represents an AwsCrossAccountRole. */ + class AwsCrossAccountRole implements IAwsCrossAccountRole { + + /** + * Constructs a new AwsCrossAccountRole. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.connection.v1.IAwsCrossAccountRole); + + /** AwsCrossAccountRole iamRoleId. */ + public iamRoleId: string; + + /** AwsCrossAccountRole iamUserId. */ + public iamUserId: string; + + /** AwsCrossAccountRole externalId. */ + public externalId: string; + + /** + * Creates a new AwsCrossAccountRole instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsCrossAccountRole instance + */ + public static create(properties?: google.cloud.bigquery.connection.v1.IAwsCrossAccountRole): google.cloud.bigquery.connection.v1.AwsCrossAccountRole; + + /** + * Encodes the specified AwsCrossAccountRole message. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsCrossAccountRole.verify|verify} messages. + * @param message AwsCrossAccountRole message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.connection.v1.IAwsCrossAccountRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsCrossAccountRole message, length delimited. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsCrossAccountRole.verify|verify} messages. + * @param message AwsCrossAccountRole message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.connection.v1.IAwsCrossAccountRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsCrossAccountRole message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsCrossAccountRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.connection.v1.AwsCrossAccountRole; + + /** + * Decodes an AwsCrossAccountRole message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsCrossAccountRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.connection.v1.AwsCrossAccountRole; + + /** + * Verifies an AwsCrossAccountRole message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AwsCrossAccountRole message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsCrossAccountRole + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.connection.v1.AwsCrossAccountRole; + + /** + * Creates a plain object from an AwsCrossAccountRole message. Also converts values to other types if specified. + * @param message AwsCrossAccountRole + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.connection.v1.AwsCrossAccountRole, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsCrossAccountRole to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } diff --git a/protos/protos.js b/protos/protos.js index 11b009f..54721e6 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -1700,6 +1700,7 @@ * @property {string|null} [friendlyName] Connection friendlyName * @property {string|null} [description] Connection description * @property {google.cloud.bigquery.connection.v1.ICloudSqlProperties|null} [cloudSql] Connection cloudSql + * @property {google.cloud.bigquery.connection.v1.IAwsProperties|null} [aws] Connection aws * @property {number|Long|null} [creationTime] Connection creationTime * @property {number|Long|null} [lastModifiedTime] Connection lastModifiedTime * @property {boolean|null} [hasCredential] Connection hasCredential @@ -1752,6 +1753,14 @@ */ Connection.prototype.cloudSql = null; + /** + * Connection aws. + * @member {google.cloud.bigquery.connection.v1.IAwsProperties|null|undefined} aws + * @memberof google.cloud.bigquery.connection.v1.Connection + * @instance + */ + Connection.prototype.aws = null; + /** * Connection creationTime. * @member {number|Long} creationTime @@ -1781,12 +1790,12 @@ /** * Connection properties. - * @member {"cloudSql"|undefined} properties + * @member {"cloudSql"|"aws"|undefined} properties * @memberof google.cloud.bigquery.connection.v1.Connection * @instance */ Object.defineProperty(Connection.prototype, "properties", { - get: $util.oneOfGetter($oneOfFields = ["cloudSql"]), + get: $util.oneOfGetter($oneOfFields = ["cloudSql", "aws"]), set: $util.oneOfSetter($oneOfFields) }); @@ -1828,6 +1837,8 @@ writer.uint32(/* id 6, wireType 0 =*/48).int64(message.lastModifiedTime); if (message.hasCredential != null && Object.hasOwnProperty.call(message, "hasCredential")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.hasCredential); + if (message.aws != null && Object.hasOwnProperty.call(message, "aws")) + $root.google.cloud.bigquery.connection.v1.AwsProperties.encode(message.aws, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -1874,6 +1885,9 @@ case 4: message.cloudSql = $root.google.cloud.bigquery.connection.v1.CloudSqlProperties.decode(reader, reader.uint32()); break; + case 8: + message.aws = $root.google.cloud.bigquery.connection.v1.AwsProperties.decode(reader, reader.uint32()); + break; case 5: message.creationTime = reader.int64(); break; @@ -1936,6 +1950,16 @@ return "cloudSql." + error; } } + if (message.aws != null && message.hasOwnProperty("aws")) { + if (properties.properties === 1) + return "properties: multiple values"; + properties.properties = 1; + { + var error = $root.google.cloud.bigquery.connection.v1.AwsProperties.verify(message.aws); + if (error) + return "aws." + error; + } + } if (message.creationTime != null && message.hasOwnProperty("creationTime")) if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) return "creationTime: integer|Long expected"; @@ -1971,6 +1995,11 @@ throw TypeError(".google.cloud.bigquery.connection.v1.Connection.cloudSql: object expected"); message.cloudSql = $root.google.cloud.bigquery.connection.v1.CloudSqlProperties.fromObject(object.cloudSql); } + if (object.aws != null) { + if (typeof object.aws !== "object") + throw TypeError(".google.cloud.bigquery.connection.v1.Connection.aws: object expected"); + message.aws = $root.google.cloud.bigquery.connection.v1.AwsProperties.fromObject(object.aws); + } if (object.creationTime != null) if ($util.Long) (message.creationTime = $util.Long.fromValue(object.creationTime)).unsigned = false; @@ -2046,6 +2075,11 @@ object.lastModifiedTime = options.longs === String ? $util.Long.prototype.toString.call(message.lastModifiedTime) : options.longs === Number ? new $util.LongBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0).toNumber() : message.lastModifiedTime; if (message.hasCredential != null && message.hasOwnProperty("hasCredential")) object.hasCredential = message.hasCredential; + if (message.aws != null && message.hasOwnProperty("aws")) { + object.aws = $root.google.cloud.bigquery.connection.v1.AwsProperties.toObject(message.aws, options); + if (options.oneofs) + object.properties = "aws"; + } return object; }; @@ -2566,6 +2600,449 @@ return CloudSqlCredential; })(); + v1.AwsProperties = (function() { + + /** + * Properties of an AwsProperties. + * @memberof google.cloud.bigquery.connection.v1 + * @interface IAwsProperties + * @property {google.cloud.bigquery.connection.v1.IAwsCrossAccountRole|null} [crossAccountRole] AwsProperties crossAccountRole + */ + + /** + * Constructs a new AwsProperties. + * @memberof google.cloud.bigquery.connection.v1 + * @classdesc Represents an AwsProperties. + * @implements IAwsProperties + * @constructor + * @param {google.cloud.bigquery.connection.v1.IAwsProperties=} [properties] Properties to set + */ + function AwsProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsProperties crossAccountRole. + * @member {google.cloud.bigquery.connection.v1.IAwsCrossAccountRole|null|undefined} crossAccountRole + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @instance + */ + AwsProperties.prototype.crossAccountRole = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AwsProperties authenticationMethod. + * @member {"crossAccountRole"|undefined} authenticationMethod + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @instance + */ + Object.defineProperty(AwsProperties.prototype, "authenticationMethod", { + get: $util.oneOfGetter($oneOfFields = ["crossAccountRole"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AwsProperties instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {google.cloud.bigquery.connection.v1.IAwsProperties=} [properties] Properties to set + * @returns {google.cloud.bigquery.connection.v1.AwsProperties} AwsProperties instance + */ + AwsProperties.create = function create(properties) { + return new AwsProperties(properties); + }; + + /** + * Encodes the specified AwsProperties message. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {google.cloud.bigquery.connection.v1.IAwsProperties} message AwsProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.crossAccountRole != null && Object.hasOwnProperty.call(message, "crossAccountRole")) + $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole.encode(message.crossAccountRole, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AwsProperties message, length delimited. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {google.cloud.bigquery.connection.v1.IAwsProperties} message AwsProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.connection.v1.AwsProperties} AwsProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.connection.v1.AwsProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.crossAccountRole = $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.connection.v1.AwsProperties} AwsProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsProperties message. + * @function verify + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.crossAccountRole != null && message.hasOwnProperty("crossAccountRole")) { + properties.authenticationMethod = 1; + { + var error = $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole.verify(message.crossAccountRole); + if (error) + return "crossAccountRole." + error; + } + } + return null; + }; + + /** + * Creates an AwsProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.connection.v1.AwsProperties} AwsProperties + */ + AwsProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.connection.v1.AwsProperties) + return object; + var message = new $root.google.cloud.bigquery.connection.v1.AwsProperties(); + if (object.crossAccountRole != null) { + if (typeof object.crossAccountRole !== "object") + throw TypeError(".google.cloud.bigquery.connection.v1.AwsProperties.crossAccountRole: object expected"); + message.crossAccountRole = $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole.fromObject(object.crossAccountRole); + } + return message; + }; + + /** + * Creates a plain object from an AwsProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @static + * @param {google.cloud.bigquery.connection.v1.AwsProperties} message AwsProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.crossAccountRole != null && message.hasOwnProperty("crossAccountRole")) { + object.crossAccountRole = $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole.toObject(message.crossAccountRole, options); + if (options.oneofs) + object.authenticationMethod = "crossAccountRole"; + } + return object; + }; + + /** + * Converts this AwsProperties to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.connection.v1.AwsProperties + * @instance + * @returns {Object.} JSON object + */ + AwsProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AwsProperties; + })(); + + v1.AwsCrossAccountRole = (function() { + + /** + * Properties of an AwsCrossAccountRole. + * @memberof google.cloud.bigquery.connection.v1 + * @interface IAwsCrossAccountRole + * @property {string|null} [iamRoleId] AwsCrossAccountRole iamRoleId + * @property {string|null} [iamUserId] AwsCrossAccountRole iamUserId + * @property {string|null} [externalId] AwsCrossAccountRole externalId + */ + + /** + * Constructs a new AwsCrossAccountRole. + * @memberof google.cloud.bigquery.connection.v1 + * @classdesc Represents an AwsCrossAccountRole. + * @implements IAwsCrossAccountRole + * @constructor + * @param {google.cloud.bigquery.connection.v1.IAwsCrossAccountRole=} [properties] Properties to set + */ + function AwsCrossAccountRole(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsCrossAccountRole iamRoleId. + * @member {string} iamRoleId + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @instance + */ + AwsCrossAccountRole.prototype.iamRoleId = ""; + + /** + * AwsCrossAccountRole iamUserId. + * @member {string} iamUserId + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @instance + */ + AwsCrossAccountRole.prototype.iamUserId = ""; + + /** + * AwsCrossAccountRole externalId. + * @member {string} externalId + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @instance + */ + AwsCrossAccountRole.prototype.externalId = ""; + + /** + * Creates a new AwsCrossAccountRole instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {google.cloud.bigquery.connection.v1.IAwsCrossAccountRole=} [properties] Properties to set + * @returns {google.cloud.bigquery.connection.v1.AwsCrossAccountRole} AwsCrossAccountRole instance + */ + AwsCrossAccountRole.create = function create(properties) { + return new AwsCrossAccountRole(properties); + }; + + /** + * Encodes the specified AwsCrossAccountRole message. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsCrossAccountRole.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {google.cloud.bigquery.connection.v1.IAwsCrossAccountRole} message AwsCrossAccountRole message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsCrossAccountRole.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iamRoleId != null && Object.hasOwnProperty.call(message, "iamRoleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.iamRoleId); + if (message.iamUserId != null && Object.hasOwnProperty.call(message, "iamUserId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.iamUserId); + if (message.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalId); + return writer; + }; + + /** + * Encodes the specified AwsCrossAccountRole message, length delimited. Does not implicitly {@link google.cloud.bigquery.connection.v1.AwsCrossAccountRole.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {google.cloud.bigquery.connection.v1.IAwsCrossAccountRole} message AwsCrossAccountRole message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsCrossAccountRole.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsCrossAccountRole message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.connection.v1.AwsCrossAccountRole} AwsCrossAccountRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsCrossAccountRole.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iamRoleId = reader.string(); + break; + case 2: + message.iamUserId = reader.string(); + break; + case 3: + message.externalId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsCrossAccountRole message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.connection.v1.AwsCrossAccountRole} AwsCrossAccountRole + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsCrossAccountRole.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsCrossAccountRole message. + * @function verify + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsCrossAccountRole.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iamRoleId != null && message.hasOwnProperty("iamRoleId")) + if (!$util.isString(message.iamRoleId)) + return "iamRoleId: string expected"; + if (message.iamUserId != null && message.hasOwnProperty("iamUserId")) + if (!$util.isString(message.iamUserId)) + return "iamUserId: string expected"; + if (message.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + return null; + }; + + /** + * Creates an AwsCrossAccountRole message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.connection.v1.AwsCrossAccountRole} AwsCrossAccountRole + */ + AwsCrossAccountRole.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole) + return object; + var message = new $root.google.cloud.bigquery.connection.v1.AwsCrossAccountRole(); + if (object.iamRoleId != null) + message.iamRoleId = String(object.iamRoleId); + if (object.iamUserId != null) + message.iamUserId = String(object.iamUserId); + if (object.externalId != null) + message.externalId = String(object.externalId); + return message; + }; + + /** + * Creates a plain object from an AwsCrossAccountRole message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @static + * @param {google.cloud.bigquery.connection.v1.AwsCrossAccountRole} message AwsCrossAccountRole + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsCrossAccountRole.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.iamRoleId = ""; + object.iamUserId = ""; + object.externalId = ""; + } + if (message.iamRoleId != null && message.hasOwnProperty("iamRoleId")) + object.iamRoleId = message.iamRoleId; + if (message.iamUserId != null && message.hasOwnProperty("iamUserId")) + object.iamUserId = message.iamUserId; + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + return object; + }; + + /** + * Converts this AwsCrossAccountRole to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.connection.v1.AwsCrossAccountRole + * @instance + * @returns {Object.} JSON object + */ + AwsCrossAccountRole.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AwsCrossAccountRole; + })(); + return v1; })(); diff --git a/protos/protos.json b/protos/protos.json index 58922ab..4a38011 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -214,7 +214,8 @@ "oneofs": { "properties": { "oneof": [ - "cloudSql" + "cloudSql", + "aws" ] } }, @@ -235,6 +236,10 @@ "type": "CloudSqlProperties", "id": 4 }, + "aws": { + "type": "AwsProperties", + "id": 8 + }, "creationTime": { "type": "int64", "id": 5, @@ -301,6 +306,43 @@ "id": 2 } } + }, + "AwsProperties": { + "oneofs": { + "authenticationMethod": { + "oneof": [ + "crossAccountRole" + ] + } + }, + "fields": { + "crossAccountRole": { + "type": "AwsCrossAccountRole", + "id": 2 + } + } + }, + "AwsCrossAccountRole": { + "fields": { + "iamRoleId": { + "type": "string", + "id": 1 + }, + "iamUserId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } } } } diff --git a/synth.metadata b/synth.metadata index 2c0f857..c339a9f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-connection.git", - "sha": "d93cb0cdbb94056a5076be30ebc2f5861d6e1ba2" + "sha": "0316fd66b76bcb24eade21ee93a426a7dc843a5a" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "aa72330a8d16d281df131e8d37bb1a4bde53401f", + "internalRef": "334870265" } }, {