Skip to content

Commit

Permalink
Add synth.py and update google-gax (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui authored and JustinBeckwith committed Jun 28, 2018
1 parent 71cb968 commit 12c1934
Show file tree
Hide file tree
Showing 13 changed files with 1,927 additions and 1,571 deletions.
3,263 changes: 1,741 additions & 1,522 deletions packages/google-cloud-oslogin/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/google-cloud-oslogin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"test-no-cover": "mocha test/*.js --no-timeouts",
"lint": "eslint src/ samples/ system-test/ test/ smoke-test/",
"lint": "eslint src/ samples/ system-test/ test/",
"prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js smoke-test/*.js",
"docs": "jsdoc -c .jsdoc.js",
"system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000"
},
"dependencies": {
"google-gax": "^0.16.0",
"google-gax": "^0.17.0",
"lodash.merge": "^4.6.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.oslogin.common;

import "google/api/annotations.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 POSIX account information associated with a Google account.
message PosixAccount {
// Only one POSIX account can be marked as primary.
bool primary = 1;

// The username of the POSIX account.
string username = 2;

// The user ID.
int64 uid = 3;

// The default group ID.
int64 gid = 4;

// The path to the home directory for this account.
string home_directory = 5;

// The path to the logic shell for this account.
string shell = 6;

// The GECOS (user information) entry for this account.
string gecos = 7;

// System identifier for which account the username or uid applies to.
// By default, the empty value is used.
string system_id = 8;

// Output only. A POSIX account identifier.
string account_id = 9;
}

// The SSH public key information associated with a Google account.
message SshPublicKey {
// Public key text in SSH format, defined by
// <a href="https://www.ietf.org/rfc/rfc4253.txt" target="_blank">RFC4253</a>
// section 6.6.
string key = 1;

// An expiration time in microseconds since epoch.
int64 expiration_time_usec = 2;

// Output only. The SHA-256 fingerprint of the SSH public key.
string fingerprint = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ syntax = "proto3";
package google.cloud.oslogin.v1beta;

import "google/api/annotations.proto";
import "google/cloud/oslogin/common.proto";
import "google/cloud/oslogin/common/common.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Cloud.OsLogin.V1Beta";
option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta;oslogin";
option java_multiple_files = true;
option java_outer_classname = "OsLoginProto";
option java_package = "com.google.cloud.oslogin.v1beta";
option csharp_namespace = "Google.Cloud.OsLogin.V1Beta";
option php_namespace = "Google\\Cloud\\OsLogin\\V1beta";


// Cloud OS Login API
//
// The Cloud OS Login API allows you to manage users and their associated SSH
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2017, Google LLC All rights reserved.
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -48,7 +48,7 @@
*
* @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.proto}
* @see [google.cloud.oslogin.common.PosixAccount definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/oslogin/common/common.proto}
*/
var PosixAccount = {
// This is for documentation. Actual contents will be loaded by gRPC.
Expand All @@ -70,7 +70,7 @@ var PosixAccount = {
*
* @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.proto}
* @see [google.cloud.oslogin.common.SshPublicKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/oslogin/common/common.proto}
*/
var SshPublicKey = {
// This is for documentation. Actual contents will be loaded by gRPC.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2017, Google LLC All rights reserved.
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Note: this file is purely for documentation. Any contents are not expected
// to be loaded as the JS file.

/**
* A generic empty message that you can re-use to avoid defining duplicated
* empty messages in your APIs. A typical example is to use it as the request
* or the response type of an API method. For instance:
*
* service Foo {
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
* }
*
* The JSON representation for `Empty` is empty JSON object `{}`.
* @typedef Empty
* @memberof google.protobuf
* @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto}
*/
var Empty = {
// This is for documentation. Actual contents will be loaded by gRPC.
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2017, Google LLC All rights reserved.
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-oslogin/src/v1beta/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2017, Google LLC All rights reserved.
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
36 changes: 18 additions & 18 deletions packages/google-cloud-oslogin/src/v1beta/os_login_service_client.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2017, Google LLC All rights reserved.
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -40,10 +40,10 @@ class OsLoginServiceClient {
* @param {string} [options.credentials.client_email]
* @param {string} [options.credentials.private_key]
* @param {string} [options.email] - Account email address. Required when
* usaing a .pem or .p12 keyFilename.
* using a .pem or .p12 keyFilename.
* @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
* .p12 key downloaded from the Google Developers Console. If you provide
* a path to a JSON file, the projectId option above is not necessary.
* a path to a JSON file, the projectId option below is not necessary.
* NOTE: .pem and .p12 require you to specify options.email as well.
* @param {number} [options.port] - The port on which to connect to
* the remote host.
Expand Down Expand Up @@ -74,14 +74,14 @@ class OsLoginServiceClient {
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
var gaxGrpc = gax.grpc(opts);
var gaxGrpc = new gax.GrpcClient(opts);

// Save the auth object to the client, for use by other methods.
this.auth = gaxGrpc.auth;

// Determine the client header string.
var clientHeader = [
`gl-node/${process.version.node}`,
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
`gapic/${VERSION}`,
Expand Down Expand Up @@ -216,9 +216,9 @@ class OsLoginServiceClient {
*
* @example
*
* const oslogin = require('@google-cloud/oslogin');
* const osLogin = require('@google-cloud/os-login');
*
* var client = new oslogin.v1beta.OsLoginServiceClient({
* var client = new osLogin.v1beta.OsLoginServiceClient({
* // optional auth parameters.
* });
*
Expand Down Expand Up @@ -256,9 +256,9 @@ class OsLoginServiceClient {
*
* @example
*
* const oslogin = require('@google-cloud/oslogin');
* const osLogin = require('@google-cloud/os-login');
*
* var client = new oslogin.v1beta.OsLoginServiceClient({
* var client = new osLogin.v1beta.OsLoginServiceClient({
* // optional auth parameters.
* });
*
Expand Down Expand Up @@ -298,9 +298,9 @@ class OsLoginServiceClient {
*
* @example
*
* const oslogin = require('@google-cloud/oslogin');
* const osLogin = require('@google-cloud/os-login');
*
* var client = new oslogin.v1beta.OsLoginServiceClient({
* var client = new osLogin.v1beta.OsLoginServiceClient({
* // optional auth parameters.
* });
*
Expand Down Expand Up @@ -346,9 +346,9 @@ class OsLoginServiceClient {
*
* @example
*
* const oslogin = require('@google-cloud/oslogin');
* const osLogin = require('@google-cloud/os-login');
*
* var client = new oslogin.v1beta.OsLoginServiceClient({
* var client = new osLogin.v1beta.OsLoginServiceClient({
* // optional auth parameters.
* });
*
Expand Down Expand Up @@ -400,9 +400,9 @@ class OsLoginServiceClient {
*
* @example
*
* const oslogin = require('@google-cloud/oslogin');
* const osLogin = require('@google-cloud/os-login');
*
* var client = new oslogin.v1beta.OsLoginServiceClient({
* var client = new osLogin.v1beta.OsLoginServiceClient({
* // optional auth parameters.
* });
*
Expand Down Expand Up @@ -462,9 +462,9 @@ class OsLoginServiceClient {
*
* @example
*
* const oslogin = require('@google-cloud/oslogin');
* const osLogin = require('@google-cloud/os-login');
*
* var client = new oslogin.v1beta.OsLoginServiceClient({
* var client = new osLogin.v1beta.OsLoginServiceClient({
* // optional auth parameters.
* });
*
Expand Down
30 changes: 30 additions & 0 deletions packages/google-cloud-oslogin/synth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import synthtool as s
import synthtool.gcp as gcp
import logging
from pathlib import Path
import subprocess

logging.basicConfig(level=logging.DEBUG)

gapic = gcp.GAPICGenerator()

versions = ['v1beta']

for version in versions:
library = gapic.node_library(
'os-login', version,
config_path="/google/cloud/oslogin/"
f"artman_oslogin_{version}.yaml")

# skip index, protos, package.json, and README.md
s.copy(
library,
excludes=['package.json', 'README.md', 'src/index.js'],
)

#
# Node.js specific cleanup
#
subprocess.run(['npm', 'ci'])
subprocess.run(['npm', 'run', 'prettier'])
subprocess.run(['npm', 'run', 'lint'])
1 change: 1 addition & 0 deletions packages/google-cloud-oslogin/system-test/no-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.warn('no system tests yet');
Loading

0 comments on commit 12c1934

Please sign in to comment.