Documentation
¶
Index ¶
- func NewPolicyDataSource() datasource.DataSource
- func NewPolicyResource() resource.Resource
- type PolicyDataSource
- func (d *PolicyDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *PolicyDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *PolicyDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *PolicyDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type PolicyDataSourceModel
- type PolicyInGroupModel
- type PolicyResource
- func (r *PolicyResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *PolicyResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *PolicyResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *PolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *PolicyResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *PolicyResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *PolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *PolicyResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type PolicyResourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPolicyDataSource ¶
func NewPolicyDataSource() datasource.DataSource
NewPolicyDataSource creates a new instance of the PolicyDataSource.
func NewPolicyResource ¶
Types ¶
type PolicyDataSource ¶
type PolicyDataSource struct {
// contains filtered or unexported fields
}
PolicyDataSource defines the data source implementation for the Terraform provider.
func (*PolicyDataSource) Configure ¶
func (d *PolicyDataSource) Configure( ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse, )
Configure configures the data source with the provider's client.
func (*PolicyDataSource) Metadata ¶
func (d *PolicyDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source's metadata, such as its type name.
func (*PolicyDataSource) Read ¶
func (d *PolicyDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read reads data from the external source and sets it in Terraform state.
func (*PolicyDataSource) Schema ¶
func (d *PolicyDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema sets the schema for the data source.
type PolicyDataSourceModel ¶
type PolicyDataSourceModel struct { ID types.String `tfsdk:"id" json:"id"` Bundles []*utils.IdNameModel `tfsdk:"bundles" json:"bundles"` InGroups []*PolicyInGroupModel `tfsdk:"in_groups" json:"inGroups"` Roles []*utils.Role `tfsdk:"roles" json:"roles"` }
PolicyDataSourceModel defines the data model for FullPolicyResultResponseSchema.
type PolicyInGroupModel ¶
type PolicyInGroupModel struct { ID types.String `tfsdk:"id" json:"id"` Name types.String `tfsdk:"name" json:"name"` Type types.String `tfsdk:"type" json:"type"` }
PolicyInGroupModel represents the data model for policy in a group.
type PolicyResource ¶
type PolicyResource struct {
// contains filtered or unexported fields
}
PolicyResource defines the resource implementation.
func (*PolicyResource) Configure ¶
func (r *PolicyResource) Configure( ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse, )
func (*PolicyResource) Create ¶
func (r *PolicyResource) Create( ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse, )
Create this function is responsible for creating a new resource of type Entitle Policy.
Its reads the Terraform plan data provided in req.Plan and maps it to the PolicyResourceModel. And sends a request to the Entitle API to create the resource using API requests. If the creation is successful, it saves the resource's data into Terraform state.
func (*PolicyResource) Delete ¶
func (r *PolicyResource) Delete( ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse, )
Delete this function is responsible for deleting an existing resource of type
It reads the resource's data from Terraform state, extracts the unique identifier, and sends a request to delete the resource using API requests. If the deletion is successful, it removes the resource from Terraform state.
func (*PolicyResource) ImportState ¶
func (r *PolicyResource) ImportState( ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse, )
ImportState this function is used to import an existing resource's state into Terraform.
It extracts the resource's identifier from the import request and sets it in Terraform state using resource.ImportStatePassthroughID.
func (*PolicyResource) Metadata ¶
func (r *PolicyResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*PolicyResource) Read ¶
func (r *PolicyResource) Read( ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse, )
Read this function is used to read an existing resource of type Entitle Policy.
It retrieves the resource's data from the provider API requests. The retrieved data is then mapped to the PolicyResourceModel, and the data is saved to Terraform state.
func (*PolicyResource) Schema ¶
func (r *PolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*PolicyResource) Update ¶
func (r *PolicyResource) Update( ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse, )
Update this function handles updates to an existing resource of type Entitle Policy.
It reads the updated Terraform plan data provided in req.Plan and maps it to the PolicyResourceModel. And sends a request to the Entitle API to update the resource using API requests. If the update is successful, it saves the updated resource data into Terraform state.
type PolicyResourceModel ¶
type PolicyResourceModel struct { ID types.String `tfsdk:"id" json:"id"` Bundles []*utils.IdNameModel `tfsdk:"bundles" json:"bundles"` InGroups []*PolicyInGroupModel `tfsdk:"in_groups" json:"inGroups"` Roles []*utils.Role `tfsdk:"roles" json:"roles"` }
PolicyResourceModel describes the resource data model.