bundles

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

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

func NewBundleResource() resource.Resource

Types

type BundleDataSource

type BundleDataSource struct {
	// contains filtered or unexported fields
}

BundleDataSource defines the data source implementation for the Terraform provider.

func (*BundleDataSource) Configure

Configure configures the data source with the provider's client.

func (*BundleDataSource) Metadata

Metadata sets the data source's metadata, such as its type name.

func (*BundleDataSource) Read

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

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

Configure is a function to set the client configuration for the BundleResource.

func (*BundleResource) Create

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

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

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

Metadata is a function to set the TypeName for the Entitle bundle resource.

func (*BundleResource) Read

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

Schema is a function to define the schema for the Entitle bundle resource.

func (*BundleResource) Update

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL