-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(IAM Policy Management): add support for policy templates (#194)
Signed-off-by: Shaun Colley <shaun.colley@ibm.com>
- Loading branch information
Showing
84 changed files
with
7,996 additions
and
52 deletions.
There are no files selected for viewing
319 changes: 311 additions & 8 deletions
319
...com/ibm/cloud/platform_services/iam_policy_management/v1/IamPolicyManagementExamples.java
Large diffs are not rendered by default.
Oops, something went wrong.
390 changes: 375 additions & 15 deletions
390
...in/java/com/ibm/cloud/platform_services/iam_policy_management/v1/IamPolicyManagement.java
Large diffs are not rendered by default.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...ibm/cloud/platform_services/iam_policy_management/v1/model/AssignmentResourceCreated.java
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,37 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2023. | ||
* | ||
* 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. | ||
*/ | ||
package com.ibm.cloud.platform_services.iam_policy_management.v1.model; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** | ||
* On success, includes the policy assigned. | ||
*/ | ||
public class AssignmentResourceCreated extends GenericModel { | ||
|
||
protected String id; | ||
|
||
protected AssignmentResourceCreated() { } | ||
|
||
/** | ||
* Gets the id. | ||
* | ||
* policy id. | ||
* | ||
* @return the id | ||
*/ | ||
public String getId() { | ||
return id; | ||
} | ||
} | ||
|
165 changes: 165 additions & 0 deletions
165
...m/cloud/platform_services/iam_policy_management/v1/model/CommitPolicyTemplateOptions.java
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,165 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2023. | ||
* | ||
* 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. | ||
*/ | ||
package com.ibm.cloud.platform_services.iam_policy_management.v1.model; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** | ||
* The commitPolicyTemplate options. | ||
*/ | ||
public class CommitPolicyTemplateOptions extends GenericModel { | ||
|
||
protected String policyTemplateId; | ||
protected String version; | ||
protected String ifMatch; | ||
|
||
/** | ||
* Builder. | ||
*/ | ||
public static class Builder { | ||
private String policyTemplateId; | ||
private String version; | ||
private String ifMatch; | ||
|
||
/** | ||
* Instantiates a new Builder from an existing CommitPolicyTemplateOptions instance. | ||
* | ||
* @param commitPolicyTemplateOptions the instance to initialize the Builder with | ||
*/ | ||
private Builder(CommitPolicyTemplateOptions commitPolicyTemplateOptions) { | ||
this.policyTemplateId = commitPolicyTemplateOptions.policyTemplateId; | ||
this.version = commitPolicyTemplateOptions.version; | ||
this.ifMatch = commitPolicyTemplateOptions.ifMatch; | ||
} | ||
|
||
/** | ||
* Instantiates a new builder. | ||
*/ | ||
public Builder() { | ||
} | ||
|
||
/** | ||
* Instantiates a new builder with required properties. | ||
* | ||
* @param policyTemplateId the policyTemplateId | ||
* @param version the version | ||
* @param ifMatch the ifMatch | ||
*/ | ||
public Builder(String policyTemplateId, String version, String ifMatch) { | ||
this.policyTemplateId = policyTemplateId; | ||
this.version = version; | ||
this.ifMatch = ifMatch; | ||
} | ||
|
||
/** | ||
* Builds a CommitPolicyTemplateOptions. | ||
* | ||
* @return the new CommitPolicyTemplateOptions instance | ||
*/ | ||
public CommitPolicyTemplateOptions build() { | ||
return new CommitPolicyTemplateOptions(this); | ||
} | ||
|
||
/** | ||
* Set the policyTemplateId. | ||
* | ||
* @param policyTemplateId the policyTemplateId | ||
* @return the CommitPolicyTemplateOptions builder | ||
*/ | ||
public Builder policyTemplateId(String policyTemplateId) { | ||
this.policyTemplateId = policyTemplateId; | ||
return this; | ||
} | ||
|
||
/** | ||
* Set the version. | ||
* | ||
* @param version the version | ||
* @return the CommitPolicyTemplateOptions builder | ||
*/ | ||
public Builder version(String version) { | ||
this.version = version; | ||
return this; | ||
} | ||
|
||
/** | ||
* Set the ifMatch. | ||
* | ||
* @param ifMatch the ifMatch | ||
* @return the CommitPolicyTemplateOptions builder | ||
*/ | ||
public Builder ifMatch(String ifMatch) { | ||
this.ifMatch = ifMatch; | ||
return this; | ||
} | ||
} | ||
|
||
protected CommitPolicyTemplateOptions() { } | ||
|
||
protected CommitPolicyTemplateOptions(Builder builder) { | ||
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.policyTemplateId, | ||
"policyTemplateId cannot be empty"); | ||
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.version, | ||
"version cannot be empty"); | ||
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.ifMatch, | ||
"ifMatch cannot be null"); | ||
policyTemplateId = builder.policyTemplateId; | ||
version = builder.version; | ||
ifMatch = builder.ifMatch; | ||
} | ||
|
||
/** | ||
* New builder. | ||
* | ||
* @return a CommitPolicyTemplateOptions builder | ||
*/ | ||
public Builder newBuilder() { | ||
return new Builder(this); | ||
} | ||
|
||
/** | ||
* Gets the policyTemplateId. | ||
* | ||
* The policy template ID. | ||
* | ||
* @return the policyTemplateId | ||
*/ | ||
public String policyTemplateId() { | ||
return policyTemplateId; | ||
} | ||
|
||
/** | ||
* Gets the version. | ||
* | ||
* The policy template version. | ||
* | ||
* @return the version | ||
*/ | ||
public String version() { | ||
return version; | ||
} | ||
|
||
/** | ||
* Gets the ifMatch. | ||
* | ||
* The revision number for updating a policy template version and must match the ETag value of the existing policy | ||
* template version. The Etag can be retrieved using the GET | ||
* /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the ETag response header. | ||
* | ||
* @return the ifMatch | ||
*/ | ||
public String ifMatch() { | ||
return ifMatch; | ||
} | ||
} | ||
|
61 changes: 61 additions & 0 deletions
61
...in/java/com/ibm/cloud/platform_services/iam_policy_management/v1/model/ConflictsWith.java
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,61 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2023. | ||
* | ||
* 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. | ||
*/ | ||
package com.ibm.cloud.platform_services.iam_policy_management.v1.model; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** | ||
* Details of conflicting resource. | ||
*/ | ||
public class ConflictsWith extends GenericModel { | ||
|
||
protected String etag; | ||
protected String role; | ||
protected String policy; | ||
|
||
protected ConflictsWith() { } | ||
|
||
/** | ||
* Gets the etag. | ||
* | ||
* The revision number of the resource. | ||
* | ||
* @return the etag | ||
*/ | ||
public String getEtag() { | ||
return etag; | ||
} | ||
|
||
/** | ||
* Gets the role. | ||
* | ||
* The conflicting role id. | ||
* | ||
* @return the role | ||
*/ | ||
public String getRole() { | ||
return role; | ||
} | ||
|
||
/** | ||
* Gets the policy. | ||
* | ||
* The conflicting policy id. | ||
* | ||
* @return the policy | ||
*/ | ||
public String getPolicy() { | ||
return policy; | ||
} | ||
} | ||
|
Oops, something went wrong.