Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #275 from jlew/exposeExternalName
Browse files Browse the repository at this point in the history
expose external_name to user profile
  • Loading branch information
quantumew authored Sep 9, 2019
2 parents d63d70b + 6939851 commit 974dfc1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
23 changes: 16 additions & 7 deletions okta/user_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ var (
ValidateFunc: validation.StringInSlice([]string{"PROFILE_MASTER", "OKTA", ""}, false),
Description: "SubSchema profile manager, if not set it will inherit its setting.",
},
"external_name": &schema.Schema{
Type: schema.TypeString,
Required: false,
Optional: true,
Description: "Subschema external name",
ForceNew: true,
},
}

userBaseSchemaSchema = map[string]*schema.Schema{
Expand Down Expand Up @@ -161,6 +168,7 @@ func syncUserSchema(d *schema.ResourceData, subschema *sdk.UserSubSchema) error
d.Set("min_length", subschema.MinLength)
d.Set("max_length", subschema.MaxLength)
d.Set("scope", subschema.Scope)
d.Set("external_name", subschema.ExternalName)

if subschema.Items != nil {
d.Set("array_type", subschema.Items.Type)
Expand Down Expand Up @@ -261,12 +269,13 @@ func getUserSubSchema(d *schema.ResourceData) *sdk.UserSubSchema {
Principal: "SELF",
},
},
Scope: d.Get("scope").(string),
Enum: convertInterfaceToStringArrNullable(d.Get("enum")),
Master: getNullableItem(d, "master"),
Items: getNullableItem(d, "array_type"),
MinLength: getNullableInt(d, "min_length"),
MaxLength: getNullableInt(d, "max_length"),
OneOf: getNullableOneOf(d),
Scope: d.Get("scope").(string),
Enum: convertInterfaceToStringArrNullable(d.Get("enum")),
Master: getNullableItem(d, "master"),
Items: getNullableItem(d, "array_type"),
MinLength: getNullableInt(d, "min_length"),
MaxLength: getNullableInt(d, "max_length"),
OneOf: getNullableOneOf(d),
ExternalName: d.Get("external_name").(string),
}
}
31 changes: 16 additions & 15 deletions sdk/user_schema_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,22 @@ type (
}

UserSubSchema struct {
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
Format string `json:"format,omitempty"`
Items *UserSchemaItem `json:"items,omitempty"`
Master *UserSchemaItem `json:"master,omitempty"`
MaxLength *int `json:"maxLength,omitempty"`
MinLength *int `json:"minLength,omitempty"`
Mutability string `json:"mutability,omitempty"`
OneOf []*UserSchemaEnum `json:"oneOf,omitempty"`
Permissions []*UserSchemaPermission `json:"permissions,omitempty"`
Required *bool `json:"required,omitempty"`
Scope string `json:"scope,omitempty"`
Title string `json:"title,omitempty"`
Type string `json:"type,omitempty"`
Union string `json:"union,omitempty"`
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
Format string `json:"format,omitempty"`
Items *UserSchemaItem `json:"items,omitempty"`
Master *UserSchemaItem `json:"master,omitempty"`
MaxLength *int `json:"maxLength,omitempty"`
MinLength *int `json:"minLength,omitempty"`
Mutability string `json:"mutability,omitempty"`
OneOf []*UserSchemaEnum `json:"oneOf,omitempty"`
Permissions []*UserSchemaPermission `json:"permissions,omitempty"`
Required *bool `json:"required,omitempty"`
Scope string `json:"scope,omitempty"`
Title string `json:"title,omitempty"`
Type string `json:"type,omitempty"`
Union string `json:"union,omitempty"`
ExternalName string `json:"externalName,omitempty"`
}

UserSubSchemaProperties struct {
Expand Down

0 comments on commit 974dfc1

Please sign in to comment.