Documentation
¶
Overview ¶
resource REF: https://learn.microsoft.com/en-us/graph/api/resources/intune-companyterms-termsandconditions?view=graph-rest-beta
Index ¶
- Constants
- func NewTermsAndConditionsResource() resource.Resource
- type TermsAndConditionsResource
- func (r *TermsAndConditionsResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *TermsAndConditionsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *TermsAndConditionsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *TermsAndConditionsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *TermsAndConditionsResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *TermsAndConditionsResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *TermsAndConditionsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *TermsAndConditionsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *TermsAndConditionsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type TermsAndConditionsResourceModel
Constants ¶
const ( ResourceName = "graph_beta_device_management_terms_and_conditions" CreateTimeout = 180 UpdateTimeout = 180 ReadTimeout = 180 DeleteTimeout = 180 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TermsAndConditionsResource ¶
type TermsAndConditionsResource struct {
ProviderTypeName string
TypeName string
ReadPermissions []string
WritePermissions []string
ResourcePath string
// contains filtered or unexported fields
}
func (*TermsAndConditionsResource) Configure ¶
func (r *TermsAndConditionsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure sets the client for the resource.
func (*TermsAndConditionsResource) Create ¶
func (r *TermsAndConditionsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create handles the Create operation for Terms and Conditions 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
- 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 (*TermsAndConditionsResource) Delete ¶
func (r *TermsAndConditionsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete handles the Delete operation for Terms and Conditions 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 (*TermsAndConditionsResource) ImportState ¶
func (r *TermsAndConditionsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource state.
func (*TermsAndConditionsResource) Metadata ¶
func (r *TermsAndConditionsResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata returns the resource type name.
func (*TermsAndConditionsResource) ModifyPlan ¶
func (r *TermsAndConditionsResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan handles plan modification for terms and conditions
func (*TermsAndConditionsResource) Read ¶
func (r *TermsAndConditionsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read handles the Read operation for Terms and Conditions 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 (*TermsAndConditionsResource) Schema ¶
func (r *TermsAndConditionsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema returns the schema for the resource.
func (*TermsAndConditionsResource) Update ¶
func (r *TermsAndConditionsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update handles the Update operation for Terms and Conditions 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 TermsAndConditionsResourceModel ¶
type TermsAndConditionsResourceModel struct {
ID types.String `tfsdk:"id"`
DisplayName types.String `tfsdk:"display_name"`
Description types.String `tfsdk:"description"`
Title types.String `tfsdk:"title"`
BodyText types.String `tfsdk:"body_text"`
AcceptanceStatement types.String `tfsdk:"acceptance_statement"`
Version types.Int32 `tfsdk:"version"`
RoleScopeTagIds types.Set `tfsdk:"role_scope_tag_ids"`
CreatedDateTime types.String `tfsdk:"created_date_time"`
ModifiedDateTime types.String `tfsdk:"modified_date_time"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
}
func MapRemoteStateToTerraform ¶
func MapRemoteStateToTerraform(ctx context.Context, data TermsAndConditionsResourceModel, termsAndConditions graphmodels.TermsAndConditionsable) TermsAndConditionsResourceModel
MapRemoteStateToTerraform maps a remote terms and conditions to the Terraform resource model