-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from auth0/patch/DXCDT-103-post-sdk-v2-part-1
[3/3] DXCDT-103 Replace resource funcs to use context.Context and Diagnostics
- Loading branch information
Showing
29 changed files
with
490 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
package auth0 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
) | ||
|
||
func newDataGlobalClient() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: readDataGlobalClient, | ||
Schema: newClientSchema(), | ||
ReadContext: readDataGlobalClient, | ||
Schema: newClientSchema(), | ||
} | ||
} | ||
|
||
func readDataGlobalClient(d *schema.ResourceData, m interface{}) error { | ||
if err := readGlobalClientID(d, m); err != nil { | ||
func readDataGlobalClient(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { | ||
if err := readGlobalClientID(ctx, d, m); err != nil { | ||
return err | ||
} | ||
return readClient(d, m) | ||
return readClient(ctx, d, m) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.