Documentation ¶
Index ¶
- func NewBundleDataSource() datasource.DataSource
- func NewBundleResource() resource.Resource
- type BundleDataSource
- func (d *BundleDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *BundleDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *BundleDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *BundleDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type BundleDataSourceModel
- type BundleResource
- func (r *BundleResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *BundleResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *BundleResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *BundleResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *BundleResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *BundleResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *BundleResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *BundleResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type BundleResourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBundleDataSource ¶
func NewBundleDataSource() datasource.DataSource
NewBundleDataSource creates a new instance of the BundleDataSource.
func NewBundleResource ¶
Types ¶
type BundleDataSource ¶
type BundleDataSource struct {
// contains filtered or unexported fields
}
BundleDataSource defines the data source implementation for the Terraform provider.
func (*BundleDataSource) Configure ¶
func (d *BundleDataSource) Configure( ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse, )
Configure configures the data source with the provider's client.
func (*BundleDataSource) Metadata ¶
func (d *BundleDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source's metadata, such as its type name.
func (*BundleDataSource) Read ¶
func (d *BundleDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read reads data from the external source and sets it in Terraform state. It retrieves the configuration data from Terraform, sends a request to the Entitle API to get the bundle data, converts the API response to the data source model, and saves it into Terraform state.
func (*BundleDataSource) Schema ¶
func (d *BundleDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema defines the expected structure of the data source.
type BundleDataSourceModel ¶
type BundleDataSourceModel struct { // ID identifier for the bundle resource in UUID format. ID types.String `tfsdk:"id" json:"id"` // Name the name of the bundle resource. Name types.String `tfsdk:"name" json:"name"` // Description the description of the bundle resource. Description types.String `tfsdk:"description" json:"description"` // Category the category of the resource. Category types.String `tfsdk:"category" json:"category"` // AllowedDurations the allowed durations for the resource AllowedDurations types.List `tfsdk:"allowed_durations" json:"allowedDurations"` // Workflow the id and name of the workflows associated with the resource Workflow *utils.IdNameModel `tfsdk:"workflow" json:"workflow"` // Tags list of tags associated with the resource Tags types.List `tfsdk:"tags" json:"tags"` // Roles list of roles associated with the resource Roles []*utils.Role `tfsdk:"roles" json:"roles"` }
BundleDataSourceModel defines the data model for FullBundleResultResponseSchema.
type BundleResource ¶
type BundleResource struct {
// contains filtered or unexported fields
}
BundleResource defines the resource implementation.
func (*BundleResource) Configure ¶
func (r *BundleResource) Configure( ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse, )
Configure is a function to set the client configuration for the BundleResource.
func (*BundleResource) Create ¶
func (r *BundleResource) Create( ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse, )
Create is responsible for creating a new resource of type Entitle Bundle.
It reads the Terraform plan data provided in req.Plan and maps it to the BundleResourceModel. Then, it 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 (*BundleResource) Delete ¶
func (r *BundleResource) Delete( ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse, )
Delete is responsible for deleting an existing resource of type Entitle Bundle.
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 (*BundleResource) ImportState ¶
func (r *BundleResource) 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 (*BundleResource) Metadata ¶
func (r *BundleResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata is a function to set the TypeName for the Entitle bundle resource.
func (*BundleResource) Read ¶
func (r *BundleResource) Read( ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse, )
Read is used to read an existing resource of type Entitle Bundle.
It retrieves the resource's data from the provider API requests. The retrieved data is then mapped to the BundleResourceModel, and the data is saved to Terraform state.
func (*BundleResource) Schema ¶
func (r *BundleResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema is a function to define the schema for the Entitle bundle resource.
func (*BundleResource) Update ¶
func (r *BundleResource) Update( ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse, )
Update handles updates to an existing resource of type Entitle Bundle.
It reads the updated Terraform plan data provided in req.Plan and maps it to the BundleResourceModel. Then, it 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 BundleResourceModel ¶
type BundleResourceModel struct { // ID identifier for the bundle resource in UUID format. ID types.String `tfsdk:"id" json:"id"` // Name the name of the bundle resource. Name types.String `tfsdk:"name" json:"name"` // Description the description of the bundle resource. Description types.String `tfsdk:"description" json:"description"` // Category the category of the resource. Category types.String `tfsdk:"category" json:"category"` // AllowedDurations the allowed durations for the resource AllowedDurations types.List `tfsdk:"allowed_durations" json:"allowedDurations"` // Workflow the id and name of the workflows associated with the resource Workflow *utils.IdNameModel `tfsdk:"workflow" json:"workflow"` // Tags list of tags associated with the resource Tags types.List `tfsdk:"tags" json:"tags"` // Roles list of roles associated with the resource Roles []*utils.Role `tfsdk:"roles" json:"roles"` }
BundleResourceModel describes the resource data model.