Skip to content

Commit 9f7b7cc

Browse files
authored
fix(Context-Based Restrictions): add support for instance address type (#317)
Signed-off-by: Dylan <Dylan.Yu@ibm.com>
1 parent 3d1b4b2 commit 9f7b7cc

88 files changed

Lines changed: 280 additions & 88 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -12,7 +12,7 @@
1212
*/
1313

1414
/*
15-
* IBM OpenAPI SDK Code Generator Version: 3.108.0-56772134-20251111-102802
15+
* IBM OpenAPI SDK Code Generator Version: 3.114.4-9b56d441-20260612-210048
1616
*/
1717

1818
package com.ibm.cloud.platform_services.context_based_restrictions.v1;

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/APIType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/AccountSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/Action.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/Address.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -24,6 +24,7 @@
2424
* - AddressSubnet
2525
* - AddressVPC
2626
* - AddressServiceRef
27+
* - AddressInstance
2728
*/
2829
public class Address extends GenericModel {
2930
@SuppressWarnings("unused")
@@ -36,6 +37,7 @@ public class Address extends GenericModel {
3637
discriminatorMapping.put("subnet", AddressSubnet.class);
3738
discriminatorMapping.put("vpc", AddressVPC.class);
3839
discriminatorMapping.put("serviceRef", AddressServiceRef.class);
40+
discriminatorMapping.put("instance", AddressInstance.class);
3941
}
4042
/**
4143
* The type of address.
@@ -51,6 +53,8 @@ public interface Type {
5153
String VPC = "vpc";
5254
/** serviceRef. */
5355
String SERVICEREF = "serviceRef";
56+
/** instance. */
57+
String INSTANCE = "instance";
5458
}
5559

5660
protected String type;

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/AddressIPAddress.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/AddressIPAddressRange.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2026.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* 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 is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.cloud.platform_services.context_based_restrictions.v1.model;
15+
16+
/**
17+
* A single Instance address.
18+
*/
19+
public class AddressInstance extends Address {
20+
21+
/**
22+
* The type of address.
23+
*/
24+
public interface Type {
25+
/** instance. */
26+
String INSTANCE = "instance";
27+
}
28+
29+
30+
/**
31+
* Builder.
32+
*/
33+
public static class Builder {
34+
private String type;
35+
private String value;
36+
37+
/**
38+
* Instantiates a new Builder from an existing AddressInstance instance.
39+
*
40+
* @param addressInstance the instance to initialize the Builder with
41+
*/
42+
public Builder(Address addressInstance) {
43+
this.type = addressInstance.type;
44+
this.value = addressInstance.value;
45+
}
46+
47+
/**
48+
* Instantiates a new builder.
49+
*/
50+
public Builder() {
51+
}
52+
53+
/**
54+
* Instantiates a new builder with required properties.
55+
*
56+
* @param type the type
57+
* @param value the value
58+
*/
59+
public Builder(String type, String value) {
60+
this.type = type;
61+
this.value = value;
62+
}
63+
64+
/**
65+
* Builds a AddressInstance.
66+
*
67+
* @return the new AddressInstance instance
68+
*/
69+
public AddressInstance build() {
70+
return new AddressInstance(this);
71+
}
72+
73+
/**
74+
* Set the type.
75+
*
76+
* @param type the type
77+
* @return the AddressInstance builder
78+
*/
79+
public Builder type(String type) {
80+
this.type = type;
81+
return this;
82+
}
83+
84+
/**
85+
* Set the value.
86+
*
87+
* @param value the value
88+
* @return the AddressInstance builder
89+
*/
90+
public Builder value(String value) {
91+
this.value = value;
92+
return this;
93+
}
94+
}
95+
96+
protected AddressInstance() { }
97+
98+
protected AddressInstance(Builder builder) {
99+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.type,
100+
"type cannot be null");
101+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.value,
102+
"value cannot be null");
103+
type = builder.type;
104+
value = builder.value;
105+
}
106+
107+
/**
108+
* New builder.
109+
*
110+
* @return a AddressInstance builder
111+
*/
112+
public Builder newBuilder() {
113+
return new Builder(this);
114+
}
115+
}
116+

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/AddressServiceRef.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

modules/context-based-restrictions/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/model/AddressSubnet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

0 commit comments

Comments
 (0)