Documentation
¶
Index ¶
- Variables
- func BuildField(d *schema.ResourceData, field string) optional.String
- func ExpandDelegateSelectors(ds []interface{}) []string
- func ExpandField(permissions []interface{}) []string
- func ExpandScopeSelector(scopeSelectors []interface{}) []nextgen.ScopeSelector
- func ExpandTags(tags []interface{}) map[string]string
- func FlattenDelgateSelectors(ds []string) []interface{}
- func FlattenTags(tags map[string]string) []string
- func GetDescriptionSchema(flag SchemaFlagType) *schema.Schema
- func GetIdentifierSchema(flag SchemaFlagType) *schema.Schema
- func GetNameSchema(flag SchemaFlagType) *schema.Schema
- func GetOrgIdSchema(flag SchemaFlagType) *schema.Schema
- func GetProjectIdSchema(flag SchemaFlagType) *schema.Schema
- func GetTagsSchema(flag SchemaFlagType) *schema.Schema
- func HandleApiError(err error, d *schema.ResourceData) diag.Diagnostics
- func MergeSchemas(src map[string]*schema.Schema, dest map[string]*schema.Schema)
- func SetCommonDataSourceSchema(s map[string]*schema.Schema)
- func SetCommonResourceSchema(s map[string]*schema.Schema)
- func SetMultiLevelDatasourceSchema(s map[string]*schema.Schema)
- func SetMultiLevelResourceSchema(s map[string]*schema.Schema)
- func SetOrgLevelDataSourceSchema(s map[string]*schema.Schema)
- func SetOrgLevelResourceSchema(s map[string]*schema.Schema)
- func SetProjectLevelDataSourceSchema(s map[string]*schema.Schema)
- func SetProjectLevelResourceSchema(s map[string]*schema.Schema)
- func SetSchemaFlagType(s *schema.Schema, flag SchemaFlagType)
- type SchemaFlagType
Constants ¶
This section is empty.
Variables ¶
var MultiLevelResourceImporter = &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") partCount := len(parts) isAccountConnector := partCount == 1 isOrgConnector := partCount == 2 isProjectConnector := partCount == 3 if isAccountConnector { d.SetId(parts[0]) d.Set("identifier", parts[0]) return []*schema.ResourceData{d}, nil } if isOrgConnector { d.SetId(parts[1]) d.Set("identifier", parts[1]) d.Set("org_id", parts[0]) return []*schema.ResourceData{d}, nil } if isProjectConnector { d.SetId(parts[2]) d.Set("identifier", parts[2]) d.Set("project_id", parts[1]) d.Set("org_id", parts[0]) return []*schema.ResourceData{d}, nil } return nil, fmt.Errorf("invalid identifier: %s", d.Id()) }, }
MultiLevelResourceImporter defines the importer configuration for all multi level resources. The format used for the id is as follows:
- Account Level: <identifier>
- Org Level: <org_id>/<identifier>
- Project Level: <org_id>/<project_id>/<identifier>
var OrgResourceImporter = &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") d.Set("org_id", parts[0]) d.Set("identifier", parts[1]) d.SetId(parts[1]) return []*schema.ResourceData{d}, nil }, }
OrgResourceImporter defines the importer configuration for all organization level resources. The id used for the import should be in the format <org_id>/<identifier>
var PipelineResourceImporter = &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") d.Set("org_id", parts[0]) d.Set("project_id", parts[1]) d.Set("pipeline_id", parts[2]) d.Set("identifier", parts[3]) d.SetId(parts[3]) return []*schema.ResourceData{d}, nil }, }
PipelineResourceImporter defines the importer configuration for all pipeline level resources.
var ProjectResourceImporter = &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") d.Set("org_id", parts[0]) d.Set("project_id", parts[1]) d.Set("identifier", parts[2]) d.SetId(parts[2]) return []*schema.ResourceData{d}, nil }, }
ProjectResourceImporter defines the importer configuration for all project level resources. The id used for the import should be in the format <org_id>/<project_id>/<identifier>
var SchemaFlagTypeValues = []string{ SchemaFlagTypes.Required.String(), SchemaFlagTypes.Optional.String(), SchemaFlagTypes.Computed.String(), }
var SchemaFlagTypes = struct { Required SchemaFlagType Optional SchemaFlagType Computed SchemaFlagType }{ Required: "Required", Optional: "Optional", Computed: "Computed", }
var TriggerResourceImporter = &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") d.Set("org_id", parts[0]) d.Set("project_id", parts[1]) d.Set("target_id", parts[2]) d.Set("identifier", parts[3]) d.SetId(parts[3]) return []*schema.ResourceData{d}, nil }, }
Functions ¶
func BuildField ¶ added in v0.2.12
func BuildField(d *schema.ResourceData, field string) optional.String
func ExpandDelegateSelectors ¶ added in v0.2.2
func ExpandDelegateSelectors(ds []interface{}) []string
func ExpandField ¶ added in v0.2.12
func ExpandField(permissions []interface{}) []string
func ExpandScopeSelector ¶ added in v0.2.13
func ExpandScopeSelector(scopeSelectors []interface{}) []nextgen.ScopeSelector
func ExpandTags ¶ added in v0.2.2
func FlattenDelgateSelectors ¶ added in v0.2.2
func FlattenDelgateSelectors(ds []string) []interface{}
func FlattenTags ¶ added in v0.2.2
func GetDescriptionSchema ¶ added in v0.2.2
func GetDescriptionSchema(flag SchemaFlagType) *schema.Schema
func GetIdentifierSchema ¶ added in v0.2.2
func GetIdentifierSchema(flag SchemaFlagType) *schema.Schema
func GetNameSchema ¶ added in v0.2.2
func GetNameSchema(flag SchemaFlagType) *schema.Schema
func GetOrgIdSchema ¶ added in v0.2.2
func GetOrgIdSchema(flag SchemaFlagType) *schema.Schema
func GetProjectIdSchema ¶ added in v0.2.2
func GetProjectIdSchema(flag SchemaFlagType) *schema.Schema
func GetTagsSchema ¶ added in v0.2.2
func GetTagsSchema(flag SchemaFlagType) *schema.Schema
func HandleApiError ¶ added in v0.2.2
func HandleApiError(err error, d *schema.ResourceData) diag.Diagnostics
func MergeSchemas ¶
func SetCommonDataSourceSchema ¶ added in v0.2.2
SetCommonDataSourceSchema sets the default schema objects used for most data sources.
func SetCommonResourceSchema ¶ added in v0.2.2
SetCommonResourceSchema sets the default schema objects used for most resources.
func SetMultiLevelDatasourceSchema ¶ added in v0.2.2
func SetMultiLevelResourceSchema ¶ added in v0.2.2
func SetOrgLevelDataSourceSchema ¶ added in v0.2.2
func SetOrgLevelResourceSchema ¶ added in v0.2.2
SetOrgLevelResourceSchema sets the default schema objects used for org level resources.
func SetProjectLevelDataSourceSchema ¶ added in v0.2.2
func SetProjectLevelResourceSchema ¶ added in v0.2.2
SetProjectLevelResourceSchema sets the default schema objects used for project level resources.
func SetSchemaFlagType ¶ added in v0.2.2
func SetSchemaFlagType(s *schema.Schema, flag SchemaFlagType)
Types ¶
type SchemaFlagType ¶ added in v0.2.2
type SchemaFlagType string
func (SchemaFlagType) String ¶ added in v0.2.2
func (e SchemaFlagType) String() string