Skip to content

Commit 012e7ec

Browse files
Regenerate securitycenter client
1 parent 1d98ace commit 012e7ec

2 files changed

Lines changed: 183 additions & 3 deletions

File tree

  • google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1
  • google-cloud-clients/google-cloud-securitycenter
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/*
2+
* Copyright 2018 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.cloud.securitycenter.v1;
16+
17+
import com.google.api.pathtemplate.PathTemplate;
18+
import com.google.api.resourcenames.ResourceName;
19+
import com.google.common.base.Preconditions;
20+
import com.google.common.collect.ImmutableMap;
21+
import java.util.ArrayList;
22+
import java.util.List;
23+
import java.util.Map;
24+
25+
// AUTO-GENERATED DOCUMENTATION AND CLASS
26+
@javax.annotation.Generated("by GAPIC protoc plugin")
27+
public class AssetName implements ResourceName {
28+
29+
private static final PathTemplate PATH_TEMPLATE =
30+
PathTemplate.createWithoutUrlEncoding("organizations/{organization}/assets/{asset}");
31+
32+
private volatile Map<String, String> fieldValuesMap;
33+
34+
private final String organization;
35+
private final String asset;
36+
37+
public String getOrganization() {
38+
return organization;
39+
}
40+
41+
public String getAsset() {
42+
return asset;
43+
}
44+
45+
public static Builder newBuilder() {
46+
return new Builder();
47+
}
48+
49+
public Builder toBuilder() {
50+
return new Builder(this);
51+
}
52+
53+
private AssetName(Builder builder) {
54+
organization = Preconditions.checkNotNull(builder.getOrganization());
55+
asset = Preconditions.checkNotNull(builder.getAsset());
56+
}
57+
58+
public static AssetName of(String organization, String asset) {
59+
return newBuilder().setOrganization(organization).setAsset(asset).build();
60+
}
61+
62+
public static String format(String organization, String asset) {
63+
return newBuilder().setOrganization(organization).setAsset(asset).build().toString();
64+
}
65+
66+
public static AssetName parse(String formattedString) {
67+
if (formattedString.isEmpty()) {
68+
return null;
69+
}
70+
Map<String, String> matchMap =
71+
PATH_TEMPLATE.validatedMatch(
72+
formattedString, "AssetName.parse: formattedString not in valid format");
73+
return of(matchMap.get("organization"), matchMap.get("asset"));
74+
}
75+
76+
public static List<AssetName> parseList(List<String> formattedStrings) {
77+
List<AssetName> list = new ArrayList<>(formattedStrings.size());
78+
for (String formattedString : formattedStrings) {
79+
list.add(parse(formattedString));
80+
}
81+
return list;
82+
}
83+
84+
public static List<String> toStringList(List<AssetName> values) {
85+
List<String> list = new ArrayList<String>(values.size());
86+
for (AssetName value : values) {
87+
if (value == null) {
88+
list.add("");
89+
} else {
90+
list.add(value.toString());
91+
}
92+
}
93+
return list;
94+
}
95+
96+
public static boolean isParsableFrom(String formattedString) {
97+
return PATH_TEMPLATE.matches(formattedString);
98+
}
99+
100+
public Map<String, String> getFieldValuesMap() {
101+
if (fieldValuesMap == null) {
102+
synchronized (this) {
103+
if (fieldValuesMap == null) {
104+
ImmutableMap.Builder<String, String> fieldMapBuilder = ImmutableMap.builder();
105+
fieldMapBuilder.put("organization", organization);
106+
fieldMapBuilder.put("asset", asset);
107+
fieldValuesMap = fieldMapBuilder.build();
108+
}
109+
}
110+
}
111+
return fieldValuesMap;
112+
}
113+
114+
public String getFieldValue(String fieldName) {
115+
return getFieldValuesMap().get(fieldName);
116+
}
117+
118+
@Override
119+
public String toString() {
120+
return PATH_TEMPLATE.instantiate("organization", organization, "asset", asset);
121+
}
122+
123+
/** Builder for AssetName. */
124+
public static class Builder {
125+
126+
private String organization;
127+
private String asset;
128+
129+
public String getOrganization() {
130+
return organization;
131+
}
132+
133+
public String getAsset() {
134+
return asset;
135+
}
136+
137+
public Builder setOrganization(String organization) {
138+
this.organization = organization;
139+
return this;
140+
}
141+
142+
public Builder setAsset(String asset) {
143+
this.asset = asset;
144+
return this;
145+
}
146+
147+
private Builder() {}
148+
149+
private Builder(AssetName assetName) {
150+
organization = assetName.organization;
151+
asset = assetName.asset;
152+
}
153+
154+
public AssetName build() {
155+
return new AssetName(this);
156+
}
157+
}
158+
159+
@Override
160+
public boolean equals(Object o) {
161+
if (o == this) {
162+
return true;
163+
}
164+
if (o instanceof AssetName) {
165+
AssetName that = (AssetName) o;
166+
return (this.organization.equals(that.organization)) && (this.asset.equals(that.asset));
167+
}
168+
return false;
169+
}
170+
171+
@Override
172+
public int hashCode() {
173+
int h = 1;
174+
h *= 1000003;
175+
h ^= organization.hashCode();
176+
h *= 1000003;
177+
h ^= asset.hashCode();
178+
return h;
179+
}
180+
}

google-cloud-clients/google-cloud-securitycenter/synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"updateTime": "2019-04-10T07:53:48.675080Z",
2+
"updateTime": "2019-04-11T07:53:34.831348Z",
33
"sources": [
44
{
55
"generator": {
@@ -12,8 +12,8 @@
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "3f57de2fbe951640b587d9c2d503daf554747749",
16-
"internalRef": "242707837"
15+
"sha": "fecf169b1b202e7acd8c0bd3b1d1f5e52747fd63",
16+
"internalRef": "242946317"
1717
}
1818
}
1919
],

0 commit comments

Comments
 (0)