-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IAM Policy Assignment: S2S Policy Assignments #5499
Merged
+434
−487
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9176291
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 503d11b
IAM Policy Assignment: S2S Policy Assignments
siddhualluri a9a1abc
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 47705e5
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 3a33a5e
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 4988a85
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 209e99d
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 5b3801f
Merge remote-tracking branch 'upstream/master' into S2Sassignments
siddhualluri 60d6800
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 74231a4
Merge remote-tracking branch 'upstream/master' into S2Sassignments
siddhualluri 172bd9b
IAM Policy Assignment: S2S Policy Assignments
siddhualluri 560636f
IAM Policy Assignment: S2S Policy Assignments
siddhualluri f980af9
IAM Policy Assignment: S2S Policy Assignments
siddhualluri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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 |
---|---|---|
|
@@ -58,50 +58,6 @@ func DataSourceIBMIAMPolicyAssignments() *schema.Resource { | |
Type: schema.TypeString, | ||
}, | ||
}, | ||
"options": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Description: "The set of properties required for a policy assignment.", | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"root": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"requester_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"assignment_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "Passed in value to correlate with other assignments.", | ||
}, | ||
"template": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The template id where this policy is being assigned from.", | ||
}, | ||
"version": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The template version where this policy is being assigned from.", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
"id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
|
@@ -370,7 +326,7 @@ func ResourceIBMPolicyAssignmentAssignmentTargetDetailsToMap(model *iampolicyman | |
func ResourceIBMPolicyAssignmentResourceTargetDetailsToMap(model *iampolicymanagementv1.AssignmentTargetDetails) (map[string]interface{}, error) { | ||
modelMap := make(map[string]interface{}) | ||
if model.Type != nil { | ||
modelMap["version"] = *model.Type | ||
modelMap["type"] = *model.Type | ||
} | ||
if model.ID != nil { | ||
modelMap["id"] = *model.ID | ||
|
@@ -394,13 +350,6 @@ func DataSourceIBMPolicyAssignmentPolicyTemplateAssignmentItemsToMap(model iampo | |
} | ||
modelMap["target"] = targetMap | ||
} | ||
if model.Options != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove options from Schema |
||
optionsMap, err := DataSourceIBMPolicyAssignmentPolicyAssignmentV1OptionsToMap(model.Options) | ||
if err != nil { | ||
return modelMap, err | ||
} | ||
modelMap["options"] = []map[string]interface{}{optionsMap} | ||
} | ||
if model.ID != nil { | ||
modelMap["id"] = *model.ID | ||
} | ||
|
@@ -476,45 +425,6 @@ func DataSourceIBMPolicyAssignmentAssignmentTargetDetailsToMap(model *iampolicym | |
return modelMap, nil | ||
} | ||
|
||
func DataSourceIBMPolicyAssignmentPolicyAssignmentV1OptionsToMap(model *iampolicymanagementv1.PolicyAssignmentV1Options) (map[string]interface{}, error) { | ||
modelMap := make(map[string]interface{}) | ||
rootMap, err := DataSourceIBMPolicyAssignmentPolicyAssignmentV1OptionsRootToMap(model.Root) | ||
if err != nil { | ||
return modelMap, err | ||
} | ||
modelMap["root"] = []map[string]interface{}{rootMap} | ||
return modelMap, nil | ||
} | ||
|
||
func DataSourceIBMPolicyAssignmentPolicyAssignmentV1OptionsRootToMap(model *iampolicymanagementv1.PolicyAssignmentV1OptionsRoot) (map[string]interface{}, error) { | ||
modelMap := make(map[string]interface{}) | ||
if model.RequesterID != nil { | ||
modelMap["requester_id"] = *model.RequesterID | ||
} | ||
if model.AssignmentID != nil { | ||
modelMap["assignment_id"] = *model.AssignmentID | ||
} | ||
if model.Template != nil { | ||
templateMap, err := DataSourceIBMPolicyAssignmentPolicyAssignmentV1OptionsRootTemplateToMap(model.Template) | ||
if err != nil { | ||
return modelMap, err | ||
} | ||
modelMap["template"] = []map[string]interface{}{templateMap} | ||
} | ||
return modelMap, nil | ||
} | ||
|
||
func DataSourceIBMPolicyAssignmentPolicyAssignmentV1OptionsRootTemplateToMap(model *iampolicymanagementv1.PolicyAssignmentV1OptionsRootTemplate) (map[string]interface{}, error) { | ||
modelMap := make(map[string]interface{}) | ||
if model.ID != nil { | ||
modelMap["id"] = *model.ID | ||
} | ||
if model.Version != nil { | ||
modelMap["version"] = *model.Version | ||
} | ||
return modelMap, nil | ||
} | ||
|
||
func DataSourceIBMPolicyAssignmentPolicyAssignmentV1ResourcesToMap(model *iampolicymanagementv1.PolicyAssignmentV1Resources) (map[string]interface{}, error) { | ||
modelMap := make(map[string]interface{}) | ||
if model.Target != nil { | ||
|
@@ -665,17 +575,6 @@ func DataSourceIBMPolicyAssignmentPolicyTemplateAssignmentItemsPolicyAssignmentT | |
if model.Target != nil { | ||
modelMap["target"] = *model.Target | ||
} | ||
if model.Options != nil { | ||
options := []map[string]interface{}{} | ||
for _, optionsItem := range model.Options { | ||
optionsItemMap, err := DataSourceIBMPolicyAssignmentPolicyAssignmentOptionsToMap(&optionsItem) | ||
if err != nil { | ||
return modelMap, err | ||
} | ||
options = append(options, optionsItemMap) | ||
} | ||
modelMap["options"] = options | ||
} | ||
if model.ID != nil { | ||
modelMap["id"] = *model.ID | ||
} | ||
|
@@ -714,20 +613,6 @@ func DataSourceIBMPolicyAssignmentPolicyTemplateAssignmentItemsPolicyAssignmentT | |
return modelMap, nil | ||
} | ||
|
||
func DataSourceIBMPolicyAssignmentPolicyAssignmentOptionsToMap(model *iampolicymanagementv1.PolicyAssignmentOptions) (map[string]interface{}, error) { | ||
modelMap := make(map[string]interface{}) | ||
modelMap["subject_type"] = *model.SubjectType | ||
modelMap["subject_id"] = *model.SubjectID | ||
modelMap["root_requester_id"] = *model.RootRequesterID | ||
if model.RootTemplateID != nil { | ||
modelMap["root_template_id"] = *model.RootTemplateID | ||
} | ||
if model.RootTemplateVersion != nil { | ||
modelMap["root_template_version"] = *model.RootTemplateVersion | ||
} | ||
return modelMap, nil | ||
} | ||
|
||
func DataSourceIBMPolicyAssignmentPolicyAssignmentResourcesToMap(model *iampolicymanagementv1.PolicyAssignmentResources) (map[string]interface{}, error) { | ||
modelMap := make(map[string]interface{}) | ||
if model.Target != nil { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove options also from Schema