-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: move to typescript code generation (#264)
* update from synthtool * move to typescript * update synth script and run it * convert system-test to ts * try this * lint * regenerate to pick up change for path template * update client * gts fix * update copyright * 2020 copyright * try this * fix unit test * re-generate * make sample test work * remove sample test for IAM policy * liny * remove doc, revert sample-test * add iam client to kmsClient * update sample-test * lint * makes samples test work * lint * update * convert system-tets to ts * rerun synthtool * sample test * fix * mix-in * update synthtool * run synthtool & test * test * manual add IamClient and pass unit tests * clean up * npm run lint * test samples * manual iam_service_config * ts client interface overload * test * test * return value * return list * clean up * remove console warn * sample-test work! * require module correctly * synthtool change * include all files in tarball, system-test passes * synthtool, all tests green * merge * fix for system-test * feedback * update dependencies * license aligned for helper.ts * remove helper.ts, tslint from synth.py * move script around * add comments to iamclient & synth.py * rename helperMethods.tmpl * rerun ynthtool * give auth the type * re set up scripts in package.json * add meaningful comment * add comments in helperMethods.tmpl * test * import * as packagejson from ../package.json; * remove any * run synthtool
- Loading branch information
1 parent
0fe9f5d
commit f1ce9e6
Showing
42 changed files
with
38,072 additions
and
39,227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
**/*.log | ||
**/node_modules | ||
.coverage | ||
coverage | ||
.nyc_output | ||
docs/ | ||
out/ | ||
build/ | ||
system-test/secrets.js | ||
system-test/*key.json | ||
**/*.lock | ||
**/package-lock.json | ||
*.lock | ||
.DS_Store | ||
package-lock.json | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* This part will be added into src/v1/key_management_service_client.ts by synth.py. | ||
* KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods. | ||
* But we don't support it now in micro-generators for rerouting one service to another and mix them in. | ||
* New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] | ||
* | ||
* So this is manually written for providing methods to the KMS client. | ||
* IamClient is created for KMS client in the constructor using src/helper.ts. | ||
* [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`. | ||
*/ | ||
|
||
getIamPolicy( | ||
request: protosTypes.google.iam.v1.GetIamPolicyRequest, | ||
options: gax.CallOptions, | ||
callback: protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback | ||
) { | ||
return this._iamClient.getIamPolicy(request, options, callback); | ||
} | ||
setIamPolicy( | ||
request: protosTypes.google.iam.v1.SetIamPolicyRequest, | ||
options: gax.CallOptions, | ||
callback: protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback | ||
) { | ||
return this._iamClient.setIamPolicy(request, options, callback); | ||
} | ||
testIamPermissions( | ||
request: protosTypes.google.iam.v1.TestIamPermissionsRequest, | ||
options: gax.CallOptions, | ||
callback?: protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback | ||
) { | ||
return this._iamClient.testIamPermissions(request, options, callback); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/google-cloud-kms/protos/google/cloud/common_resources.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// 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. | ||
// 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. | ||
|
||
// This file contains stub messages for common resources in GCP. | ||
// It is not intended to be directly generated, and is instead used by | ||
// other tooling to be able to match common resource patterns. | ||
syntax = "proto3"; | ||
|
||
package google.cloud; | ||
|
||
import "google/api/resource.proto"; | ||
|
||
|
||
option (google.api.resource_definition) = { | ||
type: "cloudresourcemanager.googleapis.com/Project" | ||
pattern: "projects/{project}" | ||
}; | ||
|
||
|
||
option (google.api.resource_definition) = { | ||
type: "cloudresourcemanager.googleapis.com/Organization" | ||
pattern: "organizations/{organization}" | ||
}; | ||
|
||
|
||
option (google.api.resource_definition) = { | ||
type: "cloudresourcemanager.googleapis.com/Folder" | ||
pattern: "folders/{folder}" | ||
}; | ||
|
||
|
||
option (google.api.resource_definition) = { | ||
type: "cloudbilling.googleapis.com/BillingAccount" | ||
pattern: "billingAccounts/{billing_account}" | ||
}; | ||
|
||
option (google.api.resource_definition) = { | ||
type: "locations.googleapis.com/Location" | ||
pattern: "projects/{project}/locations/{location}" | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/google-cloud-kms/protos/google/iam/v1/logging/audit_data.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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.iam.v1.logging; | ||
|
||
import "google/api/annotations.proto"; | ||
import "google/iam/v1/policy.proto"; | ||
|
||
option csharp_namespace = "Google.Cloud.Iam.V1.Logging"; | ||
option go_package = "google.golang.org/genproto/googleapis/iam/v1/logging;logging"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "AuditDataProto"; | ||
option java_package = "com.google.iam.v1.logging"; | ||
|
||
// Audit log information specific to Cloud IAM. This message is serialized | ||
// as an `Any` type in the `ServiceData` message of an | ||
// `AuditLog` message. | ||
message AuditData { | ||
// Policy delta between the original policy and the newly set policy. | ||
google.iam.v1.PolicyDelta policy_delta = 2; | ||
} |
Oops, something went wrong.