Skip to content

Commit 3983ed9

Browse files
yoshi-automationbcoe
authored andcommitted
feat!: adds findingSecurityMarksPathTemplate (#122)
1 parent da61baa commit 3983ed9

File tree

5 files changed

+107
-1341
lines changed

5 files changed

+107
-1341
lines changed

packages/google-cloud-securitycenter/src/index.js

+21-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC
1+
// Copyright 2019 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -18,68 +18,69 @@
1818
/**
1919
* @namespace google.type
2020
*/
21-
2221
/**
23-
* @namespace google.type
22+
* @namespace google.longrunning
2423
*/
25-
2624
/**
27-
* @namespace google.cloud
25+
* @namespace google.protobuf
2826
*/
2927
/**
30-
* @namespace google.cloud.securitycenter
28+
* @namespace google.type
3129
*/
3230
/**
33-
* @namespace google.cloud.securitycenter.v1beta1
31+
* @namespace google.rpc
3432
*/
3533
/**
3634
* @namespace google.cloud.securitycenter.v1
3735
*/
36+
/**
37+
* @namespace google.cloud.securitycenter.v1beta1
38+
*/
3839
/**
3940
* @namespace google.iam.v1
4041
*/
42+
4143
/**
42-
* @namespace google.protobuf
44+
* @namespace google.cloud
4345
*/
4446
/**
45-
* @namespace google.longrunning
47+
* @namespace google.cloud.security-center
4648
*/
4749
/**
48-
* @namespace google.rpc
50+
* @namespace google.cloud.security-center.v1
4951
*/
5052

5153
'use strict';
5254

5355
// Import the clients for each version supported by this package.
5456
const gapic = Object.freeze({
55-
v1beta1: require('./v1beta1'),
5657
v1: require('./v1'),
5758
});
5859

5960
/**
60-
* The `securitycenter` package has the following named exports:
61+
* The `@google-cloud/security-center` package has the following named exports:
6162
*
6263
* - `SecurityCenterClient` - Reference to
63-
* {@link v1beta1.SecurityCenterClient}
64-
* - `v1beta1` - This is used for selecting or pinning a
64+
* {@link v1.SecurityCenterClient}
65+
* - `v1` - This is used for selecting or pinning a
6566
* particular backend service version. It exports:
6667
* - `SecurityCenterClient` - Reference to
67-
* {@link v1beta1.SecurityCenterClient}
68+
* {@link v1.SecurityCenterClient}
6869
*
6970
* @module {object} @google-cloud/security-center
70-
* @alias nodejs-securitycenter
71+
* @alias nodejs-security-center
7172
*
7273
* @example <caption>Install the client library with <a href="https://www.npmjs.com/">npm</a>:</caption>
7374
* npm install --save @google-cloud/security-center
7475
*
7576
* @example <caption>Import the client library:</caption>
76-
* const securitycenter = require('@google-cloud/security-center');
77+
* const security-center = require('@google-cloud/security-center');
7778
*
7879
* @example <caption>Create a client that uses <a href="https://goo.gl/64dyYX">Application Default Credentials (ADC)</a>:</caption>
79-
* const client = new securitycenter.SecurityCenterClient();
80+
* const client = new security-center.SecurityCenterClient();
8081
*
8182
* @example <caption>Create a client with <a href="https://goo.gl/RXp6VL">explicit credentials</a>:</caption>
82-
* const client = new securitycenter.SecurityCenterClient({
83+
* const client = new security-center.SecurityCenterClient({
8384
* projectId: 'your-project-id',
8485
* keyFilename: '/path/to/keyfile.json',
8586
* });
@@ -88,17 +89,10 @@ const gapic = Object.freeze({
8889
/**
8990
* @type {object}
9091
* @property {constructor} SecurityCenterClient
91-
* Reference to {@link v1beta1.SecurityCenterClient}
92+
* Reference to {@link v1.SecurityCenterClient}
9293
*/
9394
module.exports = gapic.v1;
9495

95-
/**
96-
* @type {object}
97-
* @property {constructor} SecurityCenterClient
98-
* Reference to {@link v1beta1.SecurityCenterClient}
99-
*/
100-
module.exports.v1beta1 = gapic.v1beta1;
101-
10296
/**
10397
* @type {object}
10498
* @property {constructor} SecurityCenterClient

packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js

+58
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ class SecurityCenterClient {
107107
findingPathTemplate: new gax.PathTemplate(
108108
'organizations/{organization}/sources/{source}/findings/{finding}'
109109
),
110+
findingSecurityMarksPathTemplate: new gax.PathTemplate(
111+
'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks'
112+
),
110113
organizationPathTemplate: new gax.PathTemplate(
111114
'organizations/{organization}'
112115
),
@@ -2511,6 +2514,22 @@ class SecurityCenterClient {
25112514
});
25122515
}
25132516

2517+
/**
2518+
* Return a fully-qualified finding_security_marks resource name string.
2519+
*
2520+
* @param {String} organization
2521+
* @param {String} source
2522+
* @param {String} finding
2523+
* @returns {String}
2524+
*/
2525+
findingSecurityMarksPath(organization, source, finding) {
2526+
return this._pathTemplates.findingSecurityMarksPathTemplate.render({
2527+
organization: organization,
2528+
source: source,
2529+
finding: finding,
2530+
});
2531+
}
2532+
25142533
/**
25152534
* Return a fully-qualified organization resource name string.
25162535
*
@@ -2609,6 +2628,45 @@ class SecurityCenterClient {
26092628
return this._pathTemplates.findingPathTemplate.match(findingName).finding;
26102629
}
26112630

2631+
/**
2632+
* Parse the findingSecurityMarksName from a finding_security_marks resource.
2633+
*
2634+
* @param {String} findingSecurityMarksName
2635+
* A fully-qualified path representing a finding_security_marks resources.
2636+
* @returns {String} - A string representing the organization.
2637+
*/
2638+
matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) {
2639+
return this._pathTemplates.findingSecurityMarksPathTemplate.match(
2640+
findingSecurityMarksName
2641+
).organization;
2642+
}
2643+
2644+
/**
2645+
* Parse the findingSecurityMarksName from a finding_security_marks resource.
2646+
*
2647+
* @param {String} findingSecurityMarksName
2648+
* A fully-qualified path representing a finding_security_marks resources.
2649+
* @returns {String} - A string representing the source.
2650+
*/
2651+
matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) {
2652+
return this._pathTemplates.findingSecurityMarksPathTemplate.match(
2653+
findingSecurityMarksName
2654+
).source;
2655+
}
2656+
2657+
/**
2658+
* Parse the findingSecurityMarksName from a finding_security_marks resource.
2659+
*
2660+
* @param {String} findingSecurityMarksName
2661+
* A fully-qualified path representing a finding_security_marks resources.
2662+
* @returns {String} - A string representing the finding.
2663+
*/
2664+
matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) {
2665+
return this._pathTemplates.findingSecurityMarksPathTemplate.match(
2666+
findingSecurityMarksName
2667+
).finding;
2668+
}
2669+
26122670
/**
26132671
* Parse the organizationName from a organization resource.
26142672
*

packages/google-cloud-securitycenter/synth.metadata

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-07-03T11:19:04.252185Z",
2+
"updateTime": "2019-07-16T21:57:58.657213Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.29.3",
8-
"dockerImage": "googleapis/artman@sha256:8900f94a81adaab0238965aa8a7b3648791f4f3a95ee65adc6a56cfcc3753101"
7+
"version": "0.30.0",
8+
"dockerImage": "googleapis/artman@sha256:a44d9fb6fe826ca0ea7d6f7be23c596346bed82ee513a0043f3c068279717439"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "69916b6ffbb7717fa009033351777d0c9909fb79",
16-
"internalRef": "256241904"
15+
"sha": "96d5a05171e99b6a2378eb0a3423f765351878b7",
16+
"internalRef": "258424288"
1717
}
1818
},
1919
{

packages/google-cloud-securitycenter/synth.py

+23-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
versions = ['v1beta1', 'v1']
2525
for version in versions:
2626
library = gapic.node_library('securitycenter', version)
27-
s.copy(library, excludes=['src/index.js', 'README.md', 'package.json', '.kokoro/sample-test.sh'])
27+
s.copy(library, excludes=['README.md', 'package.json', 'test/gapic-v1beta1.js'])
2828

2929
# Copy common templates
3030
common_templates = gcp.CommonTemplates()
3131
templates = common_templates.node_library()
32-
s.copy(templates)
32+
s.copy(templates, excludes=['.kokoro/samples-test.sh'])
3333

3434
s.replace('src/v1*/doc/google/cloud/securitycenter/v1*/doc_source.js',
3535
r"\[\\p\{L\}\\p\{N\}\]\(https:\/\/cloud\.google\.com\{\\p\{L\}\\p\{N\}_- \]\{0\,30\}\[\\p\{L\}\\p\{N\}\]\)\?",
@@ -47,6 +47,27 @@
4747
/**
4848
* @namespace google.type
4949
*/
50+
/**
51+
* @namespace google.longrunning
52+
*/
53+
/**
54+
* @namespace google.protobuf
55+
*/
56+
/**
57+
* @namespace google.type
58+
*/
59+
/**
60+
* @namespace google.rpc
61+
*/
62+
/**
63+
* @namespace google.cloud.securitycenter.v1
64+
*/
65+
/**
66+
* @namespace google.cloud.securitycenter.v1beta1
67+
*/
68+
/**
69+
* @namespace google.iam.v1
70+
*/
5071
""")
5172

5273
# [START fix-dead-link]

0 commit comments

Comments
 (0)