Skip to content

Commit

Permalink
feat: add name and operating system type fields (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and callmehiphop committed Oct 9, 2019
1 parent 51e4152 commit 5186134
Show file tree
Hide file tree
Showing 7 changed files with 1,224 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -16,16 +16,35 @@ 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";
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;

Expand All @@ -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
// <a href="https://www.ietf.org/rfc/rfc4253.txt" target="_blank">RFC4253</a>
// section 6.6.
Expand All @@ -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];
}
258 changes: 258 additions & 0 deletions packages/google-cloud-oslogin/protos/protos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1076,6 +1095,9 @@ export namespace google {

/** SshPublicKey fingerprint */
fingerprint?: (string|null);

/** SshPublicKey name */
name?: (string|null);
}

/** Represents a SshPublicKey. */
Expand All @@ -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
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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. */
Expand Down
Loading

0 comments on commit 5186134

Please sign in to comment.