Documentation
¶
Overview ¶
resource REF: https://learn.microsoft.com/en-us/graph/api/resources/intune-rbac-operationapprovalpolicy?view=graph-rest-beta
Index ¶
- Constants
- func NewOperationApprovalPolicyResource() resource.Resource
- type OperationApprovalPolicyResource
- func (r *OperationApprovalPolicyResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *OperationApprovalPolicyResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *OperationApprovalPolicyResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *OperationApprovalPolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *OperationApprovalPolicyResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *OperationApprovalPolicyResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *OperationApprovalPolicyResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *OperationApprovalPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *OperationApprovalPolicyResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type OperationApprovalPolicyResourceModel
- type OperationApprovalPolicySetResourceModel
Constants ¶
const ( ResourceName = "graph_beta_device_management_operation_approval_policy" CreateTimeout = 180 UpdateTimeout = 180 ReadTimeout = 180 DeleteTimeout = 180 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OperationApprovalPolicyResource ¶
type OperationApprovalPolicyResource struct {
ProviderTypeName string
TypeName string
ReadPermissions []string
WritePermissions []string
ResourcePath string
// contains filtered or unexported fields
}
func (*OperationApprovalPolicyResource) Configure ¶
func (r *OperationApprovalPolicyResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure sets the client for the resource.
func (*OperationApprovalPolicyResource) Create ¶
func (r *OperationApprovalPolicyResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create handles the Create operation for Operation Approval Policy resources.
- Retrieves the planned configuration from the create request
- Constructs the resource request body from the plan
- Sends POST request to create the base resource and settings
- Sets initial state with planned values
- Calls Read operation to fetch the latest state from the API with retry
- Updates the final state with the fresh data from the API
func (*OperationApprovalPolicyResource) Delete ¶
func (r *OperationApprovalPolicyResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete handles the Delete operation for Operation Approval Policy resources.
- Retrieves the current state from the delete request
- Validates the state data and timeout configuration
- Sends DELETE request to remove the resource from the API
- Cleans up by removing the resource from Terraform state
func (*OperationApprovalPolicyResource) ImportState ¶
func (r *OperationApprovalPolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource state.
func (*OperationApprovalPolicyResource) Metadata ¶
func (r *OperationApprovalPolicyResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata returns the resource type name.
func (*OperationApprovalPolicyResource) ModifyPlan ¶
func (r *OperationApprovalPolicyResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan handles plan modification for operation approval policies
func (*OperationApprovalPolicyResource) Read ¶
func (r *OperationApprovalPolicyResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read handles the Read operation for Operation Approval Policy resources.
- Retrieves the current state from the read request
- Gets the base resource details from the API
- Maps the base resource details to Terraform state
func (*OperationApprovalPolicyResource) Schema ¶
func (r *OperationApprovalPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema returns the schema for the resource.
func (*OperationApprovalPolicyResource) Update ¶
func (r *OperationApprovalPolicyResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update handles the Update operation for Operation Approval Policy resources.
- Retrieves the planned configuration from the update request
- Retrieves the current state from the update request
- Constructs the resource request body from the plan
- Sends PATCH request to update the resource in the API
- Calls Read operation to fetch the latest state from the API with retry
- Updates the final state with the fresh data from the API
type OperationApprovalPolicyResourceModel ¶
type OperationApprovalPolicyResourceModel struct {
ID types.String `tfsdk:"id"`
DisplayName types.String `tfsdk:"display_name"`
Description types.String `tfsdk:"description"`
LastModifiedDateTime types.String `tfsdk:"last_modified_date_time"`
PolicyType types.String `tfsdk:"policy_type"`
PolicyPlatform types.String `tfsdk:"policy_platform"`
PolicySet OperationApprovalPolicySetResourceModel `tfsdk:"policy_set"`
ApproverGroupIds types.Set `tfsdk:"approver_group_ids"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
}
func MapRemoteStateToTerraform ¶
func MapRemoteStateToTerraform(ctx context.Context, data OperationApprovalPolicyResourceModel, policy graphmodels.OperationApprovalPolicyable) OperationApprovalPolicyResourceModel
MapRemoteStateToTerraform maps a remote operation approval policy to the Terraform resource model