11package com .salesforce .multicloudj .iam .model ;
22
3+ import lombok .Builder ;
34import lombok .Getter ;
45
56import java .util .Objects ;
1314 * <p>Permission boundary identifiers are provider-specific and translated internally:
1415 * - AWS: IAM Policy ARN format (arn:aws:iam::account:policy/name)
1516 * - GCP: Organization Policy constraint name or IAM Condition expression
16- * - AliCloud: Not supported (AliCloud RAM does not have permission boundaries )
17+ * - AliCloud: Control Policy name or ID (Resource Directory Control Policies )
1718 *
1819 * <p>Usage examples by provider:
1920 * <pre>
3132 * .permissionBoundary("constraints/compute.restrictLoadBalancerCreationForTypes")
3233 * .build();
3334 *
34- * // AliCloud Example (permission boundaries not supported )
35+ * // AliCloud Example (using Control Policy )
3536 * CreateOptions aliOptions = CreateOptions.builder()
3637 * .path("/foo/")
3738 * .maxSessionDuration(7200) // 2 hours
38- * // .permissionBoundary() - Not supported in AliCloud RAM
39+ * .permissionBoundary("cp-bp1example") // Control Policy ID
3940 * .build();
4041 * </pre>
4142 */
4243@ Getter
44+ @ Builder
4345public class CreateOptions {
4446 private final String path ;
4547 private final Integer maxSessionDuration ;
4648 private final String permissionBoundary ;
4749
48- private CreateOptions (Builder builder ) {
49- this .path = builder .path ;
50- this .maxSessionDuration = builder .maxSessionDuration ;
51- this .permissionBoundary = builder .permissionBoundary ;
52- }
53-
54- /**
55- * Creates a new builder for CreateOptions.
56- *
57- * @return a new Builder instance
58- */
59- public static Builder builder () {
60- return new Builder ();
61- }
62-
6350
6451 @ Override
6552 public boolean equals (Object o ) {
@@ -84,59 +71,4 @@ public String toString() {
8471 ", permissionBoundary='" + permissionBoundary + '\'' +
8572 '}' ;
8673 }
87-
88- /**
89- * Builder class for CreateOptions.
90- */
91- public static class Builder {
92- private String path ;
93- private Integer maxSessionDuration ;
94- private String permissionBoundary ;
95-
96- private Builder () {
97- }
98-
99- /**
100- * Sets the path for the identity.
101- *
102- * @param path the path (e.g., "/foo/") for organizing identities
103- * @return this Builder instance
104- */
105- public Builder path (String path ) {
106- this .path = path ;
107- return this ;
108- }
109-
110- /**
111- * Sets the maximum session duration in seconds.
112- *
113- * @param maxSessionDuration the maximum session duration (typically up to 12 hours = 43200 seconds)
114- * @return this Builder instance
115- */
116- public Builder maxSessionDuration (Integer maxSessionDuration ) {
117- this .maxSessionDuration = maxSessionDuration ;
118- return this ;
119- }
120-
121- /**
122- * Sets the permission boundary policy identifier.
123- *
124- * @param permissionBoundary the cloud-native identifier of the policy that acts as a permission boundary
125- * (AWS: policy ARN, GCP: constraint name, AliCloud: not supported)
126- * @return this Builder instance
127- */
128- public Builder permissionBoundary (String permissionBoundary ) {
129- this .permissionBoundary = permissionBoundary ;
130- return this ;
131- }
132-
133- /**
134- * Builds and returns a CreateOptions instance.
135- *
136- * @return a new CreateOptions instance
137- */
138- public CreateOptions build () {
139- return new CreateOptions (this );
140- }
141- }
14274}
0 commit comments