diff --git a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common/common.proto b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common/common.proto
index 6c45ebb6d982..854a8115480c 100644
--- a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common/common.proto
+++ b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common/common.proto
@@ -1,4 +1,4 @@
-// Copyright 2017 Google Inc.
+// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,7 +16,8 @@ syntax = "proto3";
package google.cloud.oslogin.common;
-import "google/api/annotations.proto";
+import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
option csharp_namespace = "Google.Cloud.OsLogin.Common";
option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/common;common";
@@ -24,8 +25,26 @@ option java_outer_classname = "OsLoginProto";
option java_package = "com.google.cloud.oslogin.common";
option php_namespace = "Google\\Cloud\\OsLogin\\Common";
+// The operating system options for account entries.
+enum OperatingSystemType {
+ // The operating system type associated with the user account information is
+ // unspecified.
+ OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0;
+
+ // Linux user account information.
+ LINUX = 1;
+
+ // Windows user account information.
+ WINDOWS = 2;
+}
+
// The POSIX account information associated with a Google account.
message PosixAccount {
+ option (google.api.resource) = {
+ type: "oslogin.googleapis.com/PosixAccount"
+ pattern: "users/{user}/projects/{project}"
+ };
+
// Only one POSIX account can be marked as primary.
bool primary = 1;
@@ -52,11 +71,22 @@ message PosixAccount {
string system_id = 8;
// Output only. A POSIX account identifier.
- string account_id = 9;
+ string account_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The operating system type where this account applies.
+ OperatingSystemType operating_system_type = 10;
+
+ // Output only. The canonical resource name.
+ string name = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// The SSH public key information associated with a Google account.
message SshPublicKey {
+ option (google.api.resource) = {
+ type: "oslogin.googleapis.com/SshPublicKey"
+ pattern: "users/{user}/sshPublicKeys/{fingerprint}"
+ };
+
// Public key text in SSH format, defined by
// RFC4253
// section 6.6.
@@ -66,5 +96,8 @@ message SshPublicKey {
int64 expiration_time_usec = 2;
// Output only. The SHA-256 fingerprint of the SSH public key.
- string fingerprint = 3;
+ string fingerprint = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Output only. The canonical resource name.
+ string name = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}
diff --git a/packages/google-cloud-oslogin/protos/protos.d.ts b/packages/google-cloud-oslogin/protos/protos.d.ts
index 67419d62f1a3..965ef3271070 100644
--- a/packages/google-cloud-oslogin/protos/protos.d.ts
+++ b/packages/google-cloud-oslogin/protos/protos.d.ts
@@ -927,6 +927,13 @@ export namespace google {
/** Namespace common. */
namespace common {
+ /** OperatingSystemType enum. */
+ enum OperatingSystemType {
+ OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0,
+ LINUX = 1,
+ WINDOWS = 2
+ }
+
/** Properties of a PosixAccount. */
interface IPosixAccount {
@@ -956,6 +963,12 @@ export namespace google {
/** PosixAccount accountId */
accountId?: (string|null);
+
+ /** PosixAccount operatingSystemType */
+ operatingSystemType?: (google.cloud.oslogin.common.OperatingSystemType|null);
+
+ /** PosixAccount name */
+ name?: (string|null);
}
/** Represents a PosixAccount. */
@@ -994,6 +1007,12 @@ export namespace google {
/** PosixAccount accountId. */
public accountId: string;
+ /** PosixAccount operatingSystemType. */
+ public operatingSystemType: google.cloud.oslogin.common.OperatingSystemType;
+
+ /** PosixAccount name. */
+ public name: string;
+
/**
* Creates a new PosixAccount instance using the specified properties.
* @param [properties] Properties to set
@@ -1076,6 +1095,9 @@ export namespace google {
/** SshPublicKey fingerprint */
fingerprint?: (string|null);
+
+ /** SshPublicKey name */
+ name?: (string|null);
}
/** Represents a SshPublicKey. */
@@ -1096,6 +1118,9 @@ export namespace google {
/** SshPublicKey fingerprint. */
public fingerprint: string;
+ /** SshPublicKey name. */
+ public name: string;
+
/**
* Creates a new SshPublicKey instance using the specified properties.
* @param [properties] Properties to set
@@ -1511,6 +1536,230 @@ export namespace google {
*/
public toJSON(): { [k: string]: any };
}
+
+ /** FieldBehavior enum. */
+ enum FieldBehavior {
+ FIELD_BEHAVIOR_UNSPECIFIED = 0,
+ OPTIONAL = 1,
+ REQUIRED = 2,
+ OUTPUT_ONLY = 3,
+ INPUT_ONLY = 4,
+ IMMUTABLE = 5
+ }
+
+ /** Properties of a ResourceDescriptor. */
+ interface IResourceDescriptor {
+
+ /** ResourceDescriptor type */
+ type?: (string|null);
+
+ /** ResourceDescriptor pattern */
+ pattern?: (string[]|null);
+
+ /** ResourceDescriptor nameField */
+ nameField?: (string|null);
+
+ /** ResourceDescriptor history */
+ history?: (google.api.ResourceDescriptor.History|null);
+ }
+
+ /** Represents a ResourceDescriptor. */
+ class ResourceDescriptor implements IResourceDescriptor {
+
+ /**
+ * Constructs a new ResourceDescriptor.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.api.IResourceDescriptor);
+
+ /** ResourceDescriptor type. */
+ public type: string;
+
+ /** ResourceDescriptor pattern. */
+ public pattern: string[];
+
+ /** ResourceDescriptor nameField. */
+ public nameField: string;
+
+ /** ResourceDescriptor history. */
+ public history: google.api.ResourceDescriptor.History;
+
+ /**
+ * Creates a new ResourceDescriptor instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns ResourceDescriptor instance
+ */
+ public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor;
+
+ /**
+ * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
+ * @param message ResourceDescriptor message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
+ * @param message ResourceDescriptor message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a ResourceDescriptor message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns ResourceDescriptor
+ * @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.api.ResourceDescriptor;
+
+ /**
+ * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns ResourceDescriptor
+ * @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.api.ResourceDescriptor;
+
+ /**
+ * Verifies a ResourceDescriptor 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 a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns ResourceDescriptor
+ */
+ public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor;
+
+ /**
+ * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.
+ * @param message ResourceDescriptor
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this ResourceDescriptor to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
+
+ namespace ResourceDescriptor {
+
+ /** History enum. */
+ enum History {
+ HISTORY_UNSPECIFIED = 0,
+ ORIGINALLY_SINGLE_PATTERN = 1,
+ FUTURE_MULTI_PATTERN = 2
+ }
+ }
+
+ /** Properties of a ResourceReference. */
+ interface IResourceReference {
+
+ /** ResourceReference type */
+ type?: (string|null);
+
+ /** ResourceReference childType */
+ childType?: (string|null);
+ }
+
+ /** Represents a ResourceReference. */
+ class ResourceReference implements IResourceReference {
+
+ /**
+ * Constructs a new ResourceReference.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.api.IResourceReference);
+
+ /** ResourceReference type. */
+ public type: string;
+
+ /** ResourceReference childType. */
+ public childType: string;
+
+ /**
+ * Creates a new ResourceReference instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns ResourceReference instance
+ */
+ public static create(properties?: google.api.IResourceReference): google.api.ResourceReference;
+
+ /**
+ * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
+ * @param message ResourceReference message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
+ * @param message ResourceReference message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a ResourceReference message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns ResourceReference
+ * @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.api.ResourceReference;
+
+ /**
+ * Decodes a ResourceReference message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns ResourceReference
+ * @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.api.ResourceReference;
+
+ /**
+ * Verifies a ResourceReference 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 a ResourceReference message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns ResourceReference
+ */
+ public static fromObject(object: { [k: string]: any }): google.api.ResourceReference;
+
+ /**
+ * Creates a plain object from a ResourceReference message. Also converts values to other types if specified.
+ * @param message ResourceReference
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this ResourceReference to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+ }
}
/** Namespace protobuf. */
@@ -3243,6 +3492,9 @@ export namespace google {
/** MessageOptions uninterpretedOption */
uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);
+
+ /** MessageOptions .google.api.resource */
+ ".google.api.resource"?: (google.api.IResourceDescriptor|null);
}
/** Represents a MessageOptions. */
@@ -3363,6 +3615,12 @@ export namespace google {
/** FieldOptions uninterpretedOption */
uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);
+
+ /** FieldOptions .google.api.fieldBehavior */
+ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null);
+
+ /** FieldOptions .google.api.resourceReference */
+ ".google.api.resourceReference"?: (google.api.IResourceReference|null);
}
/** Represents a FieldOptions. */
diff --git a/packages/google-cloud-oslogin/protos/protos.js b/packages/google-cloud-oslogin/protos/protos.js
index 9051ceb6c565..cb4b6020e8b5 100644
--- a/packages/google-cloud-oslogin/protos/protos.js
+++ b/packages/google-cloud-oslogin/protos/protos.js
@@ -2021,6 +2021,22 @@
*/
var common = {};
+ /**
+ * OperatingSystemType enum.
+ * @name google.cloud.oslogin.common.OperatingSystemType
+ * @enum {string}
+ * @property {number} OPERATING_SYSTEM_TYPE_UNSPECIFIED=0 OPERATING_SYSTEM_TYPE_UNSPECIFIED value
+ * @property {number} LINUX=1 LINUX value
+ * @property {number} WINDOWS=2 WINDOWS value
+ */
+ common.OperatingSystemType = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "OPERATING_SYSTEM_TYPE_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "LINUX"] = 1;
+ values[valuesById[2] = "WINDOWS"] = 2;
+ return values;
+ })();
+
common.PosixAccount = (function() {
/**
@@ -2036,6 +2052,8 @@
* @property {string|null} [gecos] PosixAccount gecos
* @property {string|null} [systemId] PosixAccount systemId
* @property {string|null} [accountId] PosixAccount accountId
+ * @property {google.cloud.oslogin.common.OperatingSystemType|null} [operatingSystemType] PosixAccount operatingSystemType
+ * @property {string|null} [name] PosixAccount name
*/
/**
@@ -2125,6 +2143,22 @@
*/
PosixAccount.prototype.accountId = "";
+ /**
+ * PosixAccount operatingSystemType.
+ * @member {google.cloud.oslogin.common.OperatingSystemType} operatingSystemType
+ * @memberof google.cloud.oslogin.common.PosixAccount
+ * @instance
+ */
+ PosixAccount.prototype.operatingSystemType = 0;
+
+ /**
+ * PosixAccount name.
+ * @member {string} name
+ * @memberof google.cloud.oslogin.common.PosixAccount
+ * @instance
+ */
+ PosixAccount.prototype.name = "";
+
/**
* Creates a new PosixAccount instance using the specified properties.
* @function create
@@ -2167,6 +2201,10 @@
writer.uint32(/* id 8, wireType 2 =*/66).string(message.systemId);
if (message.accountId != null && message.hasOwnProperty("accountId"))
writer.uint32(/* id 9, wireType 2 =*/74).string(message.accountId);
+ if (message.operatingSystemType != null && message.hasOwnProperty("operatingSystemType"))
+ writer.uint32(/* id 10, wireType 0 =*/80).int32(message.operatingSystemType);
+ if (message.name != null && message.hasOwnProperty("name"))
+ writer.uint32(/* id 11, wireType 2 =*/90).string(message.name);
return writer;
};
@@ -2228,6 +2266,12 @@
case 9:
message.accountId = reader.string();
break;
+ case 10:
+ message.operatingSystemType = reader.int32();
+ break;
+ case 11:
+ message.name = reader.string();
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -2290,6 +2334,18 @@
if (message.accountId != null && message.hasOwnProperty("accountId"))
if (!$util.isString(message.accountId))
return "accountId: string expected";
+ if (message.operatingSystemType != null && message.hasOwnProperty("operatingSystemType"))
+ switch (message.operatingSystemType) {
+ default:
+ return "operatingSystemType: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ if (message.name != null && message.hasOwnProperty("name"))
+ if (!$util.isString(message.name))
+ return "name: string expected";
return null;
};
@@ -2337,6 +2393,22 @@
message.systemId = String(object.systemId);
if (object.accountId != null)
message.accountId = String(object.accountId);
+ switch (object.operatingSystemType) {
+ case "OPERATING_SYSTEM_TYPE_UNSPECIFIED":
+ case 0:
+ message.operatingSystemType = 0;
+ break;
+ case "LINUX":
+ case 1:
+ message.operatingSystemType = 1;
+ break;
+ case "WINDOWS":
+ case 2:
+ message.operatingSystemType = 2;
+ break;
+ }
+ if (object.name != null)
+ message.name = String(object.name);
return message;
};
@@ -2371,6 +2443,8 @@
object.gecos = "";
object.systemId = "";
object.accountId = "";
+ object.operatingSystemType = options.enums === String ? "OPERATING_SYSTEM_TYPE_UNSPECIFIED" : 0;
+ object.name = "";
}
if (message.primary != null && message.hasOwnProperty("primary"))
object.primary = message.primary;
@@ -2396,6 +2470,10 @@
object.systemId = message.systemId;
if (message.accountId != null && message.hasOwnProperty("accountId"))
object.accountId = message.accountId;
+ if (message.operatingSystemType != null && message.hasOwnProperty("operatingSystemType"))
+ object.operatingSystemType = options.enums === String ? $root.google.cloud.oslogin.common.OperatingSystemType[message.operatingSystemType] : message.operatingSystemType;
+ if (message.name != null && message.hasOwnProperty("name"))
+ object.name = message.name;
return object;
};
@@ -2422,6 +2500,7 @@
* @property {string|null} [key] SshPublicKey key
* @property {number|Long|null} [expirationTimeUsec] SshPublicKey expirationTimeUsec
* @property {string|null} [fingerprint] SshPublicKey fingerprint
+ * @property {string|null} [name] SshPublicKey name
*/
/**
@@ -2463,6 +2542,14 @@
*/
SshPublicKey.prototype.fingerprint = "";
+ /**
+ * SshPublicKey name.
+ * @member {string} name
+ * @memberof google.cloud.oslogin.common.SshPublicKey
+ * @instance
+ */
+ SshPublicKey.prototype.name = "";
+
/**
* Creates a new SshPublicKey instance using the specified properties.
* @function create
@@ -2493,6 +2580,8 @@
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.expirationTimeUsec);
if (message.fingerprint != null && message.hasOwnProperty("fingerprint"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.fingerprint);
+ if (message.name != null && message.hasOwnProperty("name"))
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.name);
return writer;
};
@@ -2536,6 +2625,9 @@
case 3:
message.fingerprint = reader.string();
break;
+ case 4:
+ message.name = reader.string();
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -2580,6 +2672,9 @@
if (message.fingerprint != null && message.hasOwnProperty("fingerprint"))
if (!$util.isString(message.fingerprint))
return "fingerprint: string expected";
+ if (message.name != null && message.hasOwnProperty("name"))
+ if (!$util.isString(message.name))
+ return "name: string expected";
return null;
};
@@ -2608,6 +2703,8 @@
message.expirationTimeUsec = new $util.LongBits(object.expirationTimeUsec.low >>> 0, object.expirationTimeUsec.high >>> 0).toNumber();
if (object.fingerprint != null)
message.fingerprint = String(object.fingerprint);
+ if (object.name != null)
+ message.name = String(object.name);
return message;
};
@@ -2632,6 +2729,7 @@
} else
object.expirationTimeUsec = options.longs === String ? "0" : 0;
object.fingerprint = "";
+ object.name = "";
}
if (message.key != null && message.hasOwnProperty("key"))
object.key = message.key;
@@ -2642,6 +2740,8 @@
object.expirationTimeUsec = options.longs === String ? $util.Long.prototype.toString.call(message.expirationTimeUsec) : options.longs === Number ? new $util.LongBits(message.expirationTimeUsec.low >>> 0, message.expirationTimeUsec.high >>> 0).toNumber() : message.expirationTimeUsec;
if (message.fingerprint != null && message.hasOwnProperty("fingerprint"))
object.fingerprint = message.fingerprint;
+ if (message.name != null && message.hasOwnProperty("name"))
+ object.name = message.name;
return object;
};
@@ -3581,6 +3681,543 @@
return CustomHttpPattern;
})();
+ /**
+ * FieldBehavior enum.
+ * @name google.api.FieldBehavior
+ * @enum {string}
+ * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value
+ * @property {number} OPTIONAL=1 OPTIONAL value
+ * @property {number} REQUIRED=2 REQUIRED value
+ * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value
+ * @property {number} INPUT_ONLY=4 INPUT_ONLY value
+ * @property {number} IMMUTABLE=5 IMMUTABLE value
+ */
+ api.FieldBehavior = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "OPTIONAL"] = 1;
+ values[valuesById[2] = "REQUIRED"] = 2;
+ values[valuesById[3] = "OUTPUT_ONLY"] = 3;
+ values[valuesById[4] = "INPUT_ONLY"] = 4;
+ values[valuesById[5] = "IMMUTABLE"] = 5;
+ return values;
+ })();
+
+ api.ResourceDescriptor = (function() {
+
+ /**
+ * Properties of a ResourceDescriptor.
+ * @memberof google.api
+ * @interface IResourceDescriptor
+ * @property {string|null} [type] ResourceDescriptor type
+ * @property {Array.|null} [pattern] ResourceDescriptor pattern
+ * @property {string|null} [nameField] ResourceDescriptor nameField
+ * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history
+ */
+
+ /**
+ * Constructs a new ResourceDescriptor.
+ * @memberof google.api
+ * @classdesc Represents a ResourceDescriptor.
+ * @implements IResourceDescriptor
+ * @constructor
+ * @param {google.api.IResourceDescriptor=} [properties] Properties to set
+ */
+ function ResourceDescriptor(properties) {
+ this.pattern = [];
+ 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]];
+ }
+
+ /**
+ * ResourceDescriptor type.
+ * @member {string} type
+ * @memberof google.api.ResourceDescriptor
+ * @instance
+ */
+ ResourceDescriptor.prototype.type = "";
+
+ /**
+ * ResourceDescriptor pattern.
+ * @member {Array.} pattern
+ * @memberof google.api.ResourceDescriptor
+ * @instance
+ */
+ ResourceDescriptor.prototype.pattern = $util.emptyArray;
+
+ /**
+ * ResourceDescriptor nameField.
+ * @member {string} nameField
+ * @memberof google.api.ResourceDescriptor
+ * @instance
+ */
+ ResourceDescriptor.prototype.nameField = "";
+
+ /**
+ * ResourceDescriptor history.
+ * @member {google.api.ResourceDescriptor.History} history
+ * @memberof google.api.ResourceDescriptor
+ * @instance
+ */
+ ResourceDescriptor.prototype.history = 0;
+
+ /**
+ * Creates a new ResourceDescriptor instance using the specified properties.
+ * @function create
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {google.api.IResourceDescriptor=} [properties] Properties to set
+ * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance
+ */
+ ResourceDescriptor.create = function create(properties) {
+ return new ResourceDescriptor(properties);
+ };
+
+ /**
+ * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
+ * @function encode
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ResourceDescriptor.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.type != null && message.hasOwnProperty("type"))
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
+ if (message.pattern != null && message.pattern.length)
+ for (var i = 0; i < message.pattern.length; ++i)
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]);
+ if (message.nameField != null && message.hasOwnProperty("nameField"))
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);
+ if (message.history != null && message.hasOwnProperty("history"))
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a ResourceDescriptor message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {google.api.ResourceDescriptor} ResourceDescriptor
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ResourceDescriptor.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.api.ResourceDescriptor();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.type = reader.string();
+ break;
+ case 2:
+ if (!(message.pattern && message.pattern.length))
+ message.pattern = [];
+ message.pattern.push(reader.string());
+ break;
+ case 3:
+ message.nameField = reader.string();
+ break;
+ case 4:
+ message.history = reader.int32();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.api.ResourceDescriptor} ResourceDescriptor
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a ResourceDescriptor message.
+ * @function verify
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ ResourceDescriptor.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.type != null && message.hasOwnProperty("type"))
+ if (!$util.isString(message.type))
+ return "type: string expected";
+ if (message.pattern != null && message.hasOwnProperty("pattern")) {
+ if (!Array.isArray(message.pattern))
+ return "pattern: array expected";
+ for (var i = 0; i < message.pattern.length; ++i)
+ if (!$util.isString(message.pattern[i]))
+ return "pattern: string[] expected";
+ }
+ if (message.nameField != null && message.hasOwnProperty("nameField"))
+ if (!$util.isString(message.nameField))
+ return "nameField: string expected";
+ if (message.history != null && message.hasOwnProperty("history"))
+ switch (message.history) {
+ default:
+ return "history: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ return null;
+ };
+
+ /**
+ * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.api.ResourceDescriptor} ResourceDescriptor
+ */
+ ResourceDescriptor.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.api.ResourceDescriptor)
+ return object;
+ var message = new $root.google.api.ResourceDescriptor();
+ if (object.type != null)
+ message.type = String(object.type);
+ if (object.pattern) {
+ if (!Array.isArray(object.pattern))
+ throw TypeError(".google.api.ResourceDescriptor.pattern: array expected");
+ message.pattern = [];
+ for (var i = 0; i < object.pattern.length; ++i)
+ message.pattern[i] = String(object.pattern[i]);
+ }
+ if (object.nameField != null)
+ message.nameField = String(object.nameField);
+ switch (object.history) {
+ case "HISTORY_UNSPECIFIED":
+ case 0:
+ message.history = 0;
+ break;
+ case "ORIGINALLY_SINGLE_PATTERN":
+ case 1:
+ message.history = 1;
+ break;
+ case "FUTURE_MULTI_PATTERN":
+ case 2:
+ message.history = 2;
+ break;
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.api.ResourceDescriptor
+ * @static
+ * @param {google.api.ResourceDescriptor} message ResourceDescriptor
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ ResourceDescriptor.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.pattern = [];
+ if (options.defaults) {
+ object.type = "";
+ object.nameField = "";
+ object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0;
+ }
+ if (message.type != null && message.hasOwnProperty("type"))
+ object.type = message.type;
+ if (message.pattern && message.pattern.length) {
+ object.pattern = [];
+ for (var j = 0; j < message.pattern.length; ++j)
+ object.pattern[j] = message.pattern[j];
+ }
+ if (message.nameField != null && message.hasOwnProperty("nameField"))
+ object.nameField = message.nameField;
+ if (message.history != null && message.hasOwnProperty("history"))
+ object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history;
+ return object;
+ };
+
+ /**
+ * Converts this ResourceDescriptor to JSON.
+ * @function toJSON
+ * @memberof google.api.ResourceDescriptor
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ ResourceDescriptor.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ /**
+ * History enum.
+ * @name google.api.ResourceDescriptor.History
+ * @enum {string}
+ * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value
+ * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value
+ * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value
+ */
+ ResourceDescriptor.History = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1;
+ values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2;
+ return values;
+ })();
+
+ return ResourceDescriptor;
+ })();
+
+ api.ResourceReference = (function() {
+
+ /**
+ * Properties of a ResourceReference.
+ * @memberof google.api
+ * @interface IResourceReference
+ * @property {string|null} [type] ResourceReference type
+ * @property {string|null} [childType] ResourceReference childType
+ */
+
+ /**
+ * Constructs a new ResourceReference.
+ * @memberof google.api
+ * @classdesc Represents a ResourceReference.
+ * @implements IResourceReference
+ * @constructor
+ * @param {google.api.IResourceReference=} [properties] Properties to set
+ */
+ function ResourceReference(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]];
+ }
+
+ /**
+ * ResourceReference type.
+ * @member {string} type
+ * @memberof google.api.ResourceReference
+ * @instance
+ */
+ ResourceReference.prototype.type = "";
+
+ /**
+ * ResourceReference childType.
+ * @member {string} childType
+ * @memberof google.api.ResourceReference
+ * @instance
+ */
+ ResourceReference.prototype.childType = "";
+
+ /**
+ * Creates a new ResourceReference instance using the specified properties.
+ * @function create
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {google.api.IResourceReference=} [properties] Properties to set
+ * @returns {google.api.ResourceReference} ResourceReference instance
+ */
+ ResourceReference.create = function create(properties) {
+ return new ResourceReference(properties);
+ };
+
+ /**
+ * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
+ * @function encode
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ResourceReference.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.type != null && message.hasOwnProperty("type"))
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
+ if (message.childType != null && message.hasOwnProperty("childType"))
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ResourceReference.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a ResourceReference message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {google.api.ResourceReference} ResourceReference
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ResourceReference.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.api.ResourceReference();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.type = reader.string();
+ break;
+ case 2:
+ message.childType = reader.string();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a ResourceReference message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.api.ResourceReference} ResourceReference
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ResourceReference.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a ResourceReference message.
+ * @function verify
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ ResourceReference.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.type != null && message.hasOwnProperty("type"))
+ if (!$util.isString(message.type))
+ return "type: string expected";
+ if (message.childType != null && message.hasOwnProperty("childType"))
+ if (!$util.isString(message.childType))
+ return "childType: string expected";
+ return null;
+ };
+
+ /**
+ * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.api.ResourceReference} ResourceReference
+ */
+ ResourceReference.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.api.ResourceReference)
+ return object;
+ var message = new $root.google.api.ResourceReference();
+ if (object.type != null)
+ message.type = String(object.type);
+ if (object.childType != null)
+ message.childType = String(object.childType);
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a ResourceReference message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.api.ResourceReference
+ * @static
+ * @param {google.api.ResourceReference} message ResourceReference
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ ResourceReference.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults) {
+ object.type = "";
+ object.childType = "";
+ }
+ if (message.type != null && message.hasOwnProperty("type"))
+ object.type = message.type;
+ if (message.childType != null && message.hasOwnProperty("childType"))
+ object.childType = message.childType;
+ return object;
+ };
+
+ /**
+ * Converts this ResourceReference to JSON.
+ * @function toJSON
+ * @memberof google.api.ResourceReference
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ ResourceReference.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return ResourceReference;
+ })();
+
return api;
})();
@@ -8420,6 +9057,7 @@
* @property {boolean|null} [deprecated] MessageOptions deprecated
* @property {boolean|null} [mapEntry] MessageOptions mapEntry
* @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption
+ * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource
*/
/**
@@ -8478,6 +9116,14 @@
*/
MessageOptions.prototype.uninterpretedOption = $util.emptyArray;
+ /**
+ * MessageOptions .google.api.resource.
+ * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource
+ * @memberof google.protobuf.MessageOptions
+ * @instance
+ */
+ MessageOptions.prototype[".google.api.resource"] = null;
+
/**
* Creates a new MessageOptions instance using the specified properties.
* @function create
@@ -8513,6 +9159,8 @@
if (message.uninterpretedOption != null && message.uninterpretedOption.length)
for (var i = 0; i < message.uninterpretedOption.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
+ if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource"))
+ $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
return writer;
};
@@ -8564,6 +9212,9 @@
message.uninterpretedOption = [];
message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
+ case 1053:
+ message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32());
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -8620,6 +9271,11 @@
return "uninterpretedOption." + error;
}
}
+ if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) {
+ var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]);
+ if (error)
+ return ".google.api.resource." + error;
+ }
return null;
};
@@ -8653,6 +9309,11 @@
message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
}
}
+ if (object[".google.api.resource"] != null) {
+ if (typeof object[".google.api.resource"] !== "object")
+ throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected");
+ message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]);
+ }
return message;
};
@@ -8676,6 +9337,7 @@
object.noStandardDescriptorAccessor = false;
object.deprecated = false;
object.mapEntry = false;
+ object[".google.api.resource"] = null;
}
if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
object.messageSetWireFormat = message.messageSetWireFormat;
@@ -8690,6 +9352,8 @@
for (var j = 0; j < message.uninterpretedOption.length; ++j)
object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
}
+ if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource"))
+ object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options);
return object;
};
@@ -8720,6 +9384,8 @@
* @property {boolean|null} [deprecated] FieldOptions deprecated
* @property {boolean|null} [weak] FieldOptions weak
* @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption
+ * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior
+ * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference
*/
/**
@@ -8732,6 +9398,7 @@
*/
function FieldOptions(properties) {
this.uninterpretedOption = [];
+ this[".google.api.fieldBehavior"] = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -8794,6 +9461,22 @@
*/
FieldOptions.prototype.uninterpretedOption = $util.emptyArray;
+ /**
+ * FieldOptions .google.api.fieldBehavior.
+ * @member {Array.} .google.api.fieldBehavior
+ * @memberof google.protobuf.FieldOptions
+ * @instance
+ */
+ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray;
+
+ /**
+ * FieldOptions .google.api.resourceReference.
+ * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference
+ * @memberof google.protobuf.FieldOptions
+ * @instance
+ */
+ FieldOptions.prototype[".google.api.resourceReference"] = null;
+
/**
* Creates a new FieldOptions instance using the specified properties.
* @function create
@@ -8833,6 +9516,14 @@
if (message.uninterpretedOption != null && message.uninterpretedOption.length)
for (var i = 0; i < message.uninterpretedOption.length; ++i)
$root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
+ if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) {
+ writer.uint32(/* id 1052, wireType 2 =*/8418).fork();
+ for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
+ writer.int32(message[".google.api.fieldBehavior"][i]);
+ writer.ldelim();
+ }
+ if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference"))
+ $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim();
return writer;
};
@@ -8890,6 +9581,19 @@
message.uninterpretedOption = [];
message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
break;
+ case 1052:
+ if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length))
+ message[".google.api.fieldBehavior"] = [];
+ if ((tag & 7) === 2) {
+ var end2 = reader.uint32() + reader.pos;
+ while (reader.pos < end2)
+ message[".google.api.fieldBehavior"].push(reader.int32());
+ } else
+ message[".google.api.fieldBehavior"].push(reader.int32());
+ break;
+ case 1055:
+ message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32());
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -8964,6 +9668,27 @@
return "uninterpretedOption." + error;
}
}
+ if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) {
+ if (!Array.isArray(message[".google.api.fieldBehavior"]))
+ return ".google.api.fieldBehavior: array expected";
+ for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
+ switch (message[".google.api.fieldBehavior"][i]) {
+ default:
+ return ".google.api.fieldBehavior: enum value[] expected";
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ break;
+ }
+ }
+ if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) {
+ var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]);
+ if (error)
+ return ".google.api.resourceReference." + error;
+ }
return null;
};
@@ -9025,6 +9750,44 @@
message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
}
}
+ if (object[".google.api.fieldBehavior"]) {
+ if (!Array.isArray(object[".google.api.fieldBehavior"]))
+ throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected");
+ message[".google.api.fieldBehavior"] = [];
+ for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i)
+ switch (object[".google.api.fieldBehavior"][i]) {
+ default:
+ case "FIELD_BEHAVIOR_UNSPECIFIED":
+ case 0:
+ message[".google.api.fieldBehavior"][i] = 0;
+ break;
+ case "OPTIONAL":
+ case 1:
+ message[".google.api.fieldBehavior"][i] = 1;
+ break;
+ case "REQUIRED":
+ case 2:
+ message[".google.api.fieldBehavior"][i] = 2;
+ break;
+ case "OUTPUT_ONLY":
+ case 3:
+ message[".google.api.fieldBehavior"][i] = 3;
+ break;
+ case "INPUT_ONLY":
+ case 4:
+ message[".google.api.fieldBehavior"][i] = 4;
+ break;
+ case "IMMUTABLE":
+ case 5:
+ message[".google.api.fieldBehavior"][i] = 5;
+ break;
+ }
+ }
+ if (object[".google.api.resourceReference"] != null) {
+ if (typeof object[".google.api.resourceReference"] !== "object")
+ throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected");
+ message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]);
+ }
return message;
};
@@ -9041,8 +9804,10 @@
if (!options)
options = {};
var object = {};
- if (options.arrays || options.defaults)
+ if (options.arrays || options.defaults) {
object.uninterpretedOption = [];
+ object[".google.api.fieldBehavior"] = [];
+ }
if (options.defaults) {
object.ctype = options.enums === String ? "STRING" : 0;
object.packed = false;
@@ -9050,6 +9815,7 @@
object.lazy = false;
object.jstype = options.enums === String ? "JS_NORMAL" : 0;
object.weak = false;
+ object[".google.api.resourceReference"] = null;
}
if (message.ctype != null && message.hasOwnProperty("ctype"))
object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;
@@ -9068,6 +9834,13 @@
for (var j = 0; j < message.uninterpretedOption.length; ++j)
object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
}
+ if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) {
+ object[".google.api.fieldBehavior"] = [];
+ for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j)
+ object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j];
+ }
+ if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference"))
+ object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options);
return object;
};
diff --git a/packages/google-cloud-oslogin/protos/protos.json b/packages/google-cloud-oslogin/protos/protos.json
index 03ec70d918ed..322e5bfbaede 100644
--- a/packages/google-cloud-oslogin/protos/protos.json
+++ b/packages/google-cloud-oslogin/protos/protos.json
@@ -169,7 +169,18 @@
"php_namespace": "Google\\Cloud\\OsLogin\\Common"
},
"nested": {
+ "OperatingSystemType": {
+ "values": {
+ "OPERATING_SYSTEM_TYPE_UNSPECIFIED": 0,
+ "LINUX": 1,
+ "WINDOWS": 2
+ }
+ },
"PosixAccount": {
+ "options": {
+ "(google.api.resource).type": "oslogin.googleapis.com/PosixAccount",
+ "(google.api.resource).pattern": "users/{user}/projects/{project}"
+ },
"fields": {
"primary": {
"type": "bool",
@@ -205,11 +216,29 @@
},
"accountId": {
"type": "string",
- "id": 9
+ "id": 9,
+ "options": {
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
+ }
+ },
+ "operatingSystemType": {
+ "type": "OperatingSystemType",
+ "id": 10
+ },
+ "name": {
+ "type": "string",
+ "id": 11,
+ "options": {
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
+ }
}
}
},
"SshPublicKey": {
+ "options": {
+ "(google.api.resource).type": "oslogin.googleapis.com/SshPublicKey",
+ "(google.api.resource).pattern": "users/{user}/sshPublicKeys/{fingerprint}"
+ },
"fields": {
"key": {
"type": "string",
@@ -221,7 +250,17 @@
},
"fingerprint": {
"type": "string",
- "id": 3
+ "id": 3,
+ "options": {
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
+ }
+ },
+ "name": {
+ "type": "string",
+ "id": 4,
+ "options": {
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
+ }
}
}
}
@@ -235,7 +274,7 @@
"options": {
"go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations",
"java_multiple_files": true,
- "java_outer_classname": "HttpProto",
+ "java_outer_classname": "ResourceProto",
"java_package": "com.google.api",
"objc_class_prefix": "GAPI",
"cc_enable_arenas": true
@@ -327,6 +366,74 @@
"id": 2
}
}
+ },
+ "fieldBehavior": {
+ "rule": "repeated",
+ "type": "google.api.FieldBehavior",
+ "id": 1052,
+ "extend": "google.protobuf.FieldOptions"
+ },
+ "FieldBehavior": {
+ "values": {
+ "FIELD_BEHAVIOR_UNSPECIFIED": 0,
+ "OPTIONAL": 1,
+ "REQUIRED": 2,
+ "OUTPUT_ONLY": 3,
+ "INPUT_ONLY": 4,
+ "IMMUTABLE": 5
+ }
+ },
+ "resourceReference": {
+ "type": "google.api.ResourceReference",
+ "id": 1055,
+ "extend": "google.protobuf.FieldOptions"
+ },
+ "resource": {
+ "type": "google.api.ResourceDescriptor",
+ "id": 1053,
+ "extend": "google.protobuf.MessageOptions"
+ },
+ "ResourceDescriptor": {
+ "fields": {
+ "type": {
+ "type": "string",
+ "id": 1
+ },
+ "pattern": {
+ "rule": "repeated",
+ "type": "string",
+ "id": 2
+ },
+ "nameField": {
+ "type": "string",
+ "id": 3
+ },
+ "history": {
+ "type": "History",
+ "id": 4
+ }
+ },
+ "nested": {
+ "History": {
+ "values": {
+ "HISTORY_UNSPECIFIED": 0,
+ "ORIGINALLY_SINGLE_PATTERN": 1,
+ "FUTURE_MULTI_PATTERN": 2
+ }
+ }
+ }
+ },
+ "ResourceReference": {
+ "fields": {
+ "type": {
+ "type": "string",
+ "id": 1
+ },
+ "childType": {
+ "type": "string",
+ "id": 2
+ }
+ }
}
}
},
diff --git a/packages/google-cloud-oslogin/src/v1beta/doc/google/cloud/oslogin/common/doc_common.js b/packages/google-cloud-oslogin/src/v1beta/doc/google/cloud/oslogin/common/doc_common.js
index 711b05809220..2fa1e11d0def 100644
--- a/packages/google-cloud-oslogin/src/v1beta/doc/google/cloud/oslogin/common/doc_common.js
+++ b/packages/google-cloud-oslogin/src/v1beta/doc/google/cloud/oslogin/common/doc_common.js
@@ -46,6 +46,14 @@
* @property {string} accountId
* Output only. A POSIX account identifier.
*
+ * @property {number} operatingSystemType
+ * The operating system type where this account applies.
+ *
+ * The number should be among the values of [OperatingSystemType]{@link google.cloud.oslogin.common.OperatingSystemType}
+ *
+ * @property {string} name
+ * Output only. The canonical resource name.
+ *
* @typedef PosixAccount
* @memberof google.cloud.oslogin.common
* @see [google.cloud.oslogin.common.PosixAccount definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/oslogin/common/common.proto}
@@ -68,10 +76,38 @@ const PosixAccount = {
* @property {string} fingerprint
* Output only. The SHA-256 fingerprint of the SSH public key.
*
+ * @property {string} name
+ * Output only. The canonical resource name.
+ *
* @typedef SshPublicKey
* @memberof google.cloud.oslogin.common
* @see [google.cloud.oslogin.common.SshPublicKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/oslogin/common/common.proto}
*/
const SshPublicKey = {
// This is for documentation. Actual contents will be loaded by gRPC.
+};
+
+/**
+ * The operating system options for account entries.
+ *
+ * @enum {number}
+ * @memberof google.cloud.oslogin.common
+ */
+const OperatingSystemType = {
+
+ /**
+ * The operating system type associated with the user account information is
+ * unspecified.
+ */
+ OPERATING_SYSTEM_TYPE_UNSPECIFIED: 0,
+
+ /**
+ * Linux user account information.
+ */
+ LINUX: 1,
+
+ /**
+ * Windows user account information.
+ */
+ WINDOWS: 2
};
\ No newline at end of file
diff --git a/packages/google-cloud-oslogin/synth.metadata b/packages/google-cloud-oslogin/synth.metadata
index ce34f163f369..02be2adbf548 100644
--- a/packages/google-cloud-oslogin/synth.metadata
+++ b/packages/google-cloud-oslogin/synth.metadata
@@ -1,19 +1,19 @@
{
- "updateTime": "2019-10-01T11:25:00.211460Z",
+ "updateTime": "2019-10-09T11:20:50.867197Z",
"sources": [
{
"generator": {
"name": "artman",
- "version": "0.37.1",
- "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80"
+ "version": "0.38.0",
+ "dockerImage": "googleapis/artman@sha256:0d2f8d429110aeb8d82df6550ef4ede59d40df9062d260a1580fce688b0512bf"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "ce3c574d1266026cebea3a893247790bd68191c2",
- "internalRef": "272147209"
+ "sha": "2dec8f98383214ad4fafa7680eb0cc46d6531976",
+ "internalRef": "273619851"
}
},
{
diff --git a/packages/google-cloud-oslogin/test/gapic-v1beta.js b/packages/google-cloud-oslogin/test/gapic-v1beta.js
index df9c36078d74..28b25a60105c 100644
--- a/packages/google-cloud-oslogin/test/gapic-v1beta.js
+++ b/packages/google-cloud-oslogin/test/gapic-v1beta.js
@@ -228,10 +228,12 @@ describe('OsLoginServiceClient', () => {
const key = 'key106079';
const expirationTimeUsec = 2058878882;
const fingerprint = 'fingerprint-1375934236';
+ const name2 = 'name2-1052831874';
const expectedResponse = {
key: key,
expirationTimeUsec: expirationTimeUsec,
fingerprint: fingerprint,
+ name: name2,
};
// Mock Grpc layer
@@ -355,10 +357,12 @@ describe('OsLoginServiceClient', () => {
const key = 'key106079';
const expirationTimeUsec = 2058878882;
const fingerprint = 'fingerprint-1375934236';
+ const name2 = 'name2-1052831874';
const expectedResponse = {
key: key,
expirationTimeUsec: expirationTimeUsec,
fingerprint: fingerprint,
+ name: name2,
};
// Mock Grpc layer