Skip to content

Commit

Permalink
Merge pull request #1835 from okta/update-sdk-version
Browse files Browse the repository at this point in the history
prep release 4.6.2
  • Loading branch information
duytiennguyen-okta committed Nov 28, 2023
2 parents 90fe8a0 + dc760ef commit 7370494
Show file tree
Hide file tree
Showing 33 changed files with 111 additions and 94 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 4.6.2 (November 28, 2023)

### BUG FIXES

* Correct updating an app when status is involved with the update [#1806](https://github.com/okta/terraform-provider-okta/pull/1806). Thanks, [@monde](https://github.com/monde)!
* Datasource okta_org_metadata incorrect value for domains.organization [#1810](https://github.com/okta/terraform-provider-okta/pull/1810). Thanks, [@monde](https://github.com/monde)!
* CustomDiff for status on okta_group_rule [#1813](https://github.com/okta/terraform-provider-okta/pull/1813). Thanks, [@monde](https://github.com/monde)!
* Update okta_idp_social resource docs [#1814](https://github.com/okta/terraform-provider-okta/pull/1814). Thanks, [@monde](https://github.com/monde)!
* Support array enum of object type in schemas [#1827](https://github.com/okta/terraform-provider-okta/pull/1827). Thanks, [@monde](https://github.com/monde)!
* Fix risk_score default broke customer without FF [#1829](https://github.com/okta/terraform-provider-okta/pull/1829). Thanks, [@duytiennguyen-okta](https://github.com/duytiennguyen-okta)!
* Resource okta_brand's email_domain_id is an attribute, not an argument [#1831](https://github.com/okta/terraform-provider-okta/pull/1831). Thanks, [@monde](https://github.com/monde)!
* Add header to local sdk files, update contribution notes [#1833](https://github.com/okta/terraform-provider-okta/pull/1833). Thanks, [@monde](https://github.com/monde)!

## 4.6.1 (November 2, 2023)

### BUG FIXES
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0
github.com/jarcoal/httpmock v1.3.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/okta/okta-sdk-golang/v3 v3.0.15
github.com/okta/okta-sdk-golang/v3 v3.0.18
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/stretchr/testify v1.8.4
gopkg.in/dnaeon/go-vcr.v3 v3.1.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/okta/okta-sdk-golang/v3 v3.0.15 h1:ow2UNcLNNqMZYfWky/O//wFTZGWwin33RUXYq3XOY0U=
github.com/okta/okta-sdk-golang/v3 v3.0.15/go.mod h1:G9c5Rn6odsHI6XSC6PBa91Z5CicB8dv8zOfceeTRaWA=
github.com/okta/okta-sdk-golang/v3 v3.0.18 h1:zlVtxmy1xrwaNN99iGZoplBWyuOyDaG4vfX1qoxx/r8=
github.com/okta/okta-sdk-golang/v3 v3.0.18/go.mod h1:G9c5Rn6odsHI6XSC6PBa91Z5CicB8dv8zOfceeTRaWA=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
Expand Down
2 changes: 1 addition & 1 deletion okta/brand.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func flattenBrand(brand *okta.BrandWithEmbedded) map[string]interface{} {
}

func getDefaultBrand(ctx context.Context, m interface{}) (*okta.BrandWithEmbedded, error) {
brands, _, err := getOktaV3ClientFromMetadata(m).CustomizationApi.ListBrands(ctx).Execute()
brands, _, err := getOktaV3ClientFromMetadata(m).CustomizationAPI.ListBrands(ctx).Execute()
if err != nil {
return nil, err
}
Expand Down
13 changes: 8 additions & 5 deletions okta/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

const (
OktaTerraformProviderVersion = "4.6.1"
OktaTerraformProviderVersion = "4.6.2"
OktaTerraformProviderUserAgent = "okta-terraform/" + OktaTerraformProviderVersion
)

Expand Down Expand Up @@ -207,7 +207,7 @@ func NewConfig(d *schema.ResourceData) *Config {
func (c *Config) IsClassicOrg(ctx context.Context) bool {
if !c.queriedWellKnown {
// Discover if the Okta Org is Classic or OIE
org, _, err := c.oktaSDKClientV3.OrgSettingApi.GetWellknownOrgMetadata(ctx).Execute()
org, _, err := c.oktaSDKClientV3.OrgSettingAPI.GetWellknownOrgMetadata(ctx).Execute()
if err != nil {
c.logger.Error("error querying GET /.well-known/okta-organization", "error", err)
return c.classicOrg
Expand Down Expand Up @@ -277,7 +277,7 @@ func (c *Config) verifyCredentials(ctx context.Context) error {
// GET /api/v1/users/me
// only for SSWS API token. Should we keep doing this?
if c.apiToken != "" {
if _, _, err := c.oktaSDKClientV3.UserApi.GetUser(ctx, "me").Execute(); err != nil {
if _, _, err := c.oktaSDKClientV3.UserAPI.GetUser(ctx, "me").Execute(); err != nil {
return fmt.Errorf("error with v3 SDK client: %v", err)
}
if _, _, err := c.oktaSDKClientV2.User.GetUser(ctx, "me"); err != nil {
Expand Down Expand Up @@ -524,9 +524,12 @@ func oktaV3SDKClient(c *Config) (client *okta.APIClient, err error) {
setters = append(setters, okta.WithTestingDisableHttpsCheck(true))
}

config := okta.NewConfiguration(setters...)
config, err := okta.NewConfiguration(setters...)
if err != nil {
return nil, err
}
client = okta.NewAPIClient(config)
return
return client, nil
}

func errHandler(resp *http.Response, err error, numTries int) (*http.Response, error) {
Expand Down
2 changes: 1 addition & 1 deletion okta/data_source_okta_auth_server_scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func dataSourceAuthServerScopes() *schema.Resource {
}

func dataSourceAuthServerScopesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
scopes, _, err := getOktaV3ClientFromMetadata(m).AuthorizationServerApi.ListOAuth2Scopes(ctx, d.Get("auth_server_id").(string)).Execute()
scopes, _, err := getOktaV3ClientFromMetadata(m).AuthorizationServerAPI.ListOAuth2Scopes(ctx, d.Get("auth_server_id").(string)).Execute()
if err != nil {
return diag.Errorf("failed to list auth server scopes: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion okta/data_source_okta_brand.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func dataSourceBrandRead(ctx context.Context, d *schema.ResourceData, m interfac
}
} else {
logger(m).Info("reading brand by ID", "id", brandID)
brand, _, err = getOktaV3ClientFromMetadata(m).CustomizationApi.GetBrand(ctx, brandID).Execute()
brand, _, err = getOktaV3ClientFromMetadata(m).CustomizationAPI.GetBrand(ctx, brandID).Execute()
if err != nil {
return diag.Errorf("failed to get brand: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion okta/data_source_okta_brands.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func dataSourceBrands() *schema.Resource {
}

func dataSourceBrandsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
brands, _, err := getOktaV3ClientFromMetadata(m).CustomizationApi.ListBrands(ctx).Execute()
brands, _, err := getOktaV3ClientFromMetadata(m).CustomizationAPI.ListBrands(ctx).Execute()
if err != nil {
return diag.Errorf("failed to list brands: %v", err)
}
Expand Down
1 change: 1 addition & 0 deletions okta/data_source_okta_default_signin_page.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package okta
2 changes: 1 addition & 1 deletion okta/data_source_okta_email_customization.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func dataSourceEmailCustomizationRead(ctx context.Context, d *schema.ResourceDat
return diag.Errorf("customization_id required for email customization")
}

customization, _, err := getOktaV3ClientFromMetadata(m).CustomizationApi.GetEmailCustomization(ctx, brandID.(string), templateName.(string), customizationId.(string)).Execute()
customization, _, err := getOktaV3ClientFromMetadata(m).CustomizationAPI.GetEmailCustomization(ctx, brandID.(string), templateName.(string), customizationId.(string)).Execute()
if err != nil {
return diag.Errorf("failed to get email template: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion okta/data_source_okta_email_customizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func dataSourceEmailCustomizationsRead(ctx context.Context, d *schema.ResourceDa
return diag.Errorf("template name required for email customizations: %v", err)
}

customizations, _, err := getOktaV3ClientFromMetadata(m).CustomizationApi.ListEmailCustomizations(ctx, brandID.(string), templateName.(string)).Execute()
customizations, _, err := getOktaV3ClientFromMetadata(m).CustomizationAPI.ListEmailCustomizations(ctx, brandID.(string), templateName.(string)).Execute()
if err != nil {
return diag.Errorf("failed to list email customizations: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions okta/data_source_okta_email_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func dataSourceEmailTemplateRead(ctx context.Context, d *schema.ResourceData, m
brandID, ok := d.GetOk("brand_id")
if ok {
logger(m).Info("reading brand by ID", "id", brandID.(string))
brand, _, err = getOktaV3ClientFromMetadata(m).CustomizationApi.GetBrand(ctx, brandID.(string)).Execute()
brand, _, err = getOktaV3ClientFromMetadata(m).CustomizationAPI.GetBrand(ctx, brandID.(string)).Execute()
if err != nil {
return diag.Errorf("failed to get brand for email template: %v", err)
}
Expand All @@ -45,7 +45,7 @@ func dataSourceEmailTemplateRead(ctx context.Context, d *schema.ResourceData, m
return diag.Errorf("name required for email template: %v", err)
}

template, _, err := getOktaV3ClientFromMetadata(m).CustomizationApi.GetEmailTemplate(ctx, brandID.(string), templateName.(string)).Execute()
template, _, err := getOktaV3ClientFromMetadata(m).CustomizationAPI.GetEmailTemplate(ctx, brandID.(string), templateName.(string)).Execute()
if err != nil {
return diag.Errorf("failed to get email template: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions okta/data_source_okta_email_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func dataSourceEmailTemplatesRead(ctx context.Context, d *schema.ResourceData, m
brandID, ok := d.GetOk("brand_id")
if ok {
logger(m).Info("reading brand by ID", "id", brandID.(string))
brand, _, err = getOktaV3ClientFromMetadata(m).CustomizationApi.GetBrand(ctx, brandID.(string)).Execute()
brand, _, err = getOktaV3ClientFromMetadata(m).CustomizationAPI.GetBrand(ctx, brandID.(string)).Execute()
if err != nil {
return diag.Errorf("failed to get brand for email templates: %v", err)
}
Expand Down Expand Up @@ -60,7 +60,7 @@ func dataSourceEmailTemplatesRead(ctx context.Context, d *schema.ResourceData, m
}

func collectEmailTempates(ctx context.Context, client *okta.APIClient, brand *okta.BrandWithEmbedded) ([]okta.EmailTemplate, error) {
templates, resp, err := client.CustomizationApi.ListEmailTemplates(ctx, brand.GetId()).Limit(int32(defaultPaginationLimit)).Execute()
templates, resp, err := client.CustomizationAPI.ListEmailTemplates(ctx, brand.GetId()).Limit(int32(defaultPaginationLimit)).Execute()
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion okta/data_source_okta_org_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (d *OrgMetadataDataSource) Read(ctx context.Context, req datasource.ReadReq
return
}

org, _, err := d.config.oktaSDKClientV3.OrgSettingApi.GetWellknownOrgMetadata(ctx).Execute()
org, _, err := d.config.oktaSDKClientV3.OrgSettingAPI.GetWellknownOrgMetadata(ctx).Execute()
if err != nil {
resp.Diagnostics.AddError(
"Error retrieving org metadata",
Expand Down
2 changes: 1 addition & 1 deletion okta/data_source_okta_theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func dataSourceThemeRead(ctx context.Context, d *schema.ResourceData, m interfac
}
themeID := tid.(string)

theme, _, err := getOktaV3ClientFromMetadata(m).CustomizationApi.GetBrandTheme(ctx, brandID, themeID).Execute()
theme, _, err := getOktaV3ClientFromMetadata(m).CustomizationAPI.GetBrandTheme(ctx, brandID, themeID).Execute()
if err != nil {
return diag.Errorf("failed to get email template: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion okta/data_source_okta_themes.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func dataSourceThemesRead(ctx context.Context, d *schema.ResourceData, m interfa
return diag.Errorf("brand_id required for themes: %v", err)
}

themes, _, err := getOktaV3ClientFromMetadata(m).CustomizationApi.ListBrandThemes(ctx, brandID.(string)).Execute()
themes, _, err := getOktaV3ClientFromMetadata(m).CustomizationAPI.ListBrandThemes(ctx, brandID.(string)).Execute()
if err != nil {
return diag.Errorf("failed to list brand themes: %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions okta/provider_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ func sweepBehaviors(client *testClient) error {

func sweepEmailCustomization(client *testClient) error {
ctx := context.Background()
brands, _, err := client.sdkV3Client.CustomizationApi.ListBrands(ctx).Execute()
brands, _, err := client.sdkV3Client.CustomizationAPI.ListBrands(ctx).Execute()
if err != nil {
return err
}
for _, brand := range brands {
templates, resp, err := client.sdkV3Client.CustomizationApi.ListEmailTemplates(ctx, brand.GetId()).Limit(int32(defaultPaginationLimit)).Execute()
templates, resp, err := client.sdkV3Client.CustomizationAPI.ListEmailTemplates(ctx, brand.GetId()).Limit(int32(defaultPaginationLimit)).Execute()
if err != nil {
continue
}
Expand All @@ -222,7 +222,7 @@ func sweepEmailCustomization(client *testClient) error {
}

for _, template := range templates {
_, _ = client.sdkV3Client.CustomizationApi.DeleteAllCustomizations(context.Background(), brand.GetId(), template.GetName()).Execute()
_, _ = client.sdkV3Client.CustomizationAPI.DeleteAllCustomizations(context.Background(), brand.GetId(), template.GetName()).Execute()
}
}

Expand Down
6 changes: 3 additions & 3 deletions okta/resource_okta_app_access_policy_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (r *appAccessPolicyAssignmentResource) Create(ctx context.Context, req reso

// assign policy to app
policyID := plan.PolicyID.ValueString()
_, err = r.oktaSDKClientV3.ApplicationPoliciesApi.AssignApplicationPolicy(ctx, appID, policyID).Execute()
_, err = r.oktaSDKClientV3.ApplicationPoliciesAPI.AssignApplicationPolicy(ctx, appID, policyID).Execute()
if err != nil {
resp.Diagnostics.AddError(
fmt.Sprintf("couldn't assign policy %q to app %q", policyID, appID),
Expand Down Expand Up @@ -215,7 +215,7 @@ func (r *appAccessPolicyAssignmentResource) Update(ctx context.Context, req reso
if !plan.PolicyID.Equal(state.PolicyID) {
// policy id has changed in the config, update
appID := plan.AppID.ValueString()
_, err = r.oktaSDKClientV3.ApplicationPoliciesApi.AssignApplicationPolicy(ctx, appID, plan.PolicyID.ValueString()).Execute()
_, err = r.oktaSDKClientV3.ApplicationPoliciesAPI.AssignApplicationPolicy(ctx, appID, plan.PolicyID.ValueString()).Execute()
if err != nil {
resp.Diagnostics.AddError(
fmt.Sprintf("couldn't re-assign policy %q to app %q", plan.PolicyID.ValueString(), appID),
Expand All @@ -240,7 +240,7 @@ func (r *appAccessPolicyAssignmentResource) ImportState(ctx context.Context, req
}

func (r *appAccessPolicyAssignmentResource) findAppSDKInnerResponse(ctx context.Context, appID string) (*okta.ListApplications200ResponseInner, error) {
appInnerResp, _, err := r.oktaSDKClientV3.ApplicationApi.GetApplication(ctx, appID).Execute()
appInnerResp, _, err := r.oktaSDKClientV3.ApplicationAPI.GetApplication(ctx, appID).Execute()
return appInnerResp, err
}

Expand Down
8 changes: 4 additions & 4 deletions okta/resource_okta_auth_server_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func resourceAuthServerScopeCreate(ctx context.Context, d *schema.ResourceData,
if err != nil {
return diag.Errorf("failed to build auth server scope: %v", err)
}
respScope, _, err := getOktaV3ClientFromMetadata(m).AuthorizationServerApi.CreateOAuth2Scope(ctx, d.Get("auth_server_id").(string)).OAuth2Scope(scope).Execute()
respScope, _, err := getOktaV3ClientFromMetadata(m).AuthorizationServerAPI.CreateOAuth2Scope(ctx, d.Get("auth_server_id").(string)).OAuth2Scope(scope).Execute()
if err != nil {
return diag.Errorf("failed to create auth server scope: %v", err)
}
Expand All @@ -82,7 +82,7 @@ func resourceAuthServerScopeCreate(ctx context.Context, d *schema.ResourceData,
}

func resourceAuthServerScopeRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
scope, resp, err := getOktaV3ClientFromMetadata(m).AuthorizationServerApi.GetOAuth2Scope(ctx, d.Get("auth_server_id").(string), d.Id()).Execute()
scope, resp, err := getOktaV3ClientFromMetadata(m).AuthorizationServerAPI.GetOAuth2Scope(ctx, d.Get("auth_server_id").(string), d.Id()).Execute()
if err := v3suppressErrorOn404(resp, err); err != nil {
return diag.Errorf("failed to get auth server scope: %v", err)
}
Expand All @@ -108,15 +108,15 @@ func resourceAuthServerScopeUpdate(ctx context.Context, d *schema.ResourceData,
if err != nil {
return diag.Errorf("failed to build auth server scope: %v", err)
}
_, _, err = getOktaV3ClientFromMetadata(m).AuthorizationServerApi.ReplaceOAuth2Scope(ctx, d.Get("auth_server_id").(string), d.Id()).OAuth2Scope(scope).Execute()
_, _, err = getOktaV3ClientFromMetadata(m).AuthorizationServerAPI.ReplaceOAuth2Scope(ctx, d.Get("auth_server_id").(string), d.Id()).OAuth2Scope(scope).Execute()
if err != nil {
return diag.Errorf("failed to update auth server scope: %v", err)
}
return resourceAuthServerScopeRead(ctx, d, m)
}

func resourceAuthServerScopeDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
resp, err := getOktaV3ClientFromMetadata(m).AuthorizationServerApi.DeleteOAuth2Scope(ctx, d.Get("auth_server_id").(string), d.Id()).Execute()
resp, err := getOktaV3ClientFromMetadata(m).AuthorizationServerAPI.DeleteOAuth2Scope(ctx, d.Get("auth_server_id").(string), d.Id()).Execute()
if err := v3suppressErrorOn404(resp, err); err != nil {
return diag.Errorf("failed to delete auth server scope: %v", err)
}
Expand Down
16 changes: 8 additions & 8 deletions okta/resource_okta_brand.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (r *brandResource) Create(ctx context.Context, req resource.CreateRequest,
return
}

createdBrand, _, err := r.oktaSDKClientV3.CustomizationApi.CreateBrand(ctx).CreateBrandRequest(createReqBody).Execute()
createdBrand, _, err := r.oktaSDKClientV3.CustomizationAPI.CreateBrand(ctx).CreateBrandRequest(createReqBody).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to create brand",
Expand All @@ -175,7 +175,7 @@ func (r *brandResource) Create(ctx context.Context, req resource.CreateRequest,
return
}

updatedBrand, _, err := r.oktaSDKClientV3.CustomizationApi.ReplaceBrand(ctx, createdBrand.GetId()).Brand(updateReqBody).Execute()
updatedBrand, _, err := r.oktaSDKClientV3.CustomizationAPI.ReplaceBrand(ctx, createdBrand.GetId()).Brand(updateReqBody).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to update brand",
Expand All @@ -184,7 +184,7 @@ func (r *brandResource) Create(ctx context.Context, req resource.CreateRequest,
return
}

brand, _, err := r.oktaSDKClientV3.CustomizationApi.GetBrand(ctx, updatedBrand.GetId()).Execute()
brand, _, err := r.oktaSDKClientV3.CustomizationAPI.GetBrand(ctx, updatedBrand.GetId()).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to read brand",
Expand Down Expand Up @@ -214,7 +214,7 @@ func (r *brandResource) Read(ctx context.Context, req resource.ReadRequest, resp
var err error

if state.BrandID.ValueString() == "default" {
brands, _, err := r.oktaSDKClientV3.CustomizationApi.ListBrands(ctx).Execute()
brands, _, err := r.oktaSDKClientV3.CustomizationAPI.ListBrands(ctx).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to get list brand",
Expand All @@ -229,7 +229,7 @@ func (r *brandResource) Read(ctx context.Context, req resource.ReadRequest, resp
}
}
} else {
brandWithEmbedded, _, err = r.oktaSDKClientV3.CustomizationApi.GetBrand(ctx, state.ID.ValueString()).Execute()
brandWithEmbedded, _, err = r.oktaSDKClientV3.CustomizationAPI.GetBrand(ctx, state.ID.ValueString()).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to read brand",
Expand Down Expand Up @@ -257,7 +257,7 @@ func (r *brandResource) Delete(ctx context.Context, req resource.DeleteRequest,
return
}

_, err := r.oktaSDKClientV3.CustomizationApi.DeleteBrand(ctx, state.ID.ValueString()).Execute()
_, err := r.oktaSDKClientV3.CustomizationAPI.DeleteBrand(ctx, state.ID.ValueString()).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to delete brand",
Expand All @@ -283,7 +283,7 @@ func (r *brandResource) Update(ctx context.Context, req resource.UpdateRequest,
return
}

updatedBrand, _, err := r.oktaSDKClientV3.CustomizationApi.ReplaceBrand(ctx, state.ID.ValueString()).Brand(reqBody).Execute()
updatedBrand, _, err := r.oktaSDKClientV3.CustomizationAPI.ReplaceBrand(ctx, state.ID.ValueString()).Brand(reqBody).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to update brand",
Expand All @@ -292,7 +292,7 @@ func (r *brandResource) Update(ctx context.Context, req resource.UpdateRequest,
return
}

brand, _, err := r.oktaSDKClientV3.CustomizationApi.GetBrand(ctx, updatedBrand.GetId()).Execute()
brand, _, err := r.oktaSDKClientV3.CustomizationAPI.GetBrand(ctx, updatedBrand.GetId()).Execute()
if err != nil {
resp.Diagnostics.AddError(
"failed to read brand",
Expand Down
Loading

0 comments on commit 7370494

Please sign in to comment.