policies

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

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

func NewPolicyResource() resource.Resource

Types

type PolicyDataSource

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

PolicyDataSource defines the data source implementation for the Terraform provider.

func (*PolicyDataSource) Configure

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

func (*PolicyDataSource) Metadata

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

func (*PolicyDataSource) Read

Read reads data from the external source and sets it in Terraform state.

func (*PolicyDataSource) Schema

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 (*PolicyResource) Create

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

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

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 (*PolicyResource) Read

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 (*PolicyResource) Update

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.

Jump to

Keyboard shortcuts

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