Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Simplifying the newDataClient generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Vedder committed Feb 3, 2022
1 parent 070c51e commit 4905251
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions auth0/data_source_auth0_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import (
)

func newDataClient() *schema.Resource {
clientSchema := newComputedClientSchema()
clientSchema := datasourceSchemaFromResourceSchema(newClient().Schema)
delete(clientSchema, "client_secret_rotation_trigger")

addOptionalFieldsToSchema(clientSchema, "name", "client_id")

return &schema.Resource{
Expand All @@ -19,12 +21,6 @@ func newDataClient() *schema.Resource {
}
}

func newComputedClientSchema() map[string]*schema.Schema {
clientSchema := datasourceSchemaFromResourceSchema(newClient().Schema)
delete(clientSchema, "client_secret_rotation_trigger")
return clientSchema
}

func readDataClient(d *schema.ResourceData, m interface{}) error {
clientId := auth0.StringValue(String(d, "client_id"))
if clientId != "" {
Expand Down

0 comments on commit 4905251

Please sign in to comment.