Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/hydra/sdk/05_go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ func main() {
},
}
ory := ory.NewAPIClient(configuration)
resp, r, err := ory.OAuth2Api.CreateOAuth2Client(oryAuthedContext).OAuth2Client(oAuth2Client).Execute()
resp, r, err := ory.OAuth2API.CreateOAuth2Client(oryAuthedContext).OAuth2Client(oAuth2Client).Execute()
if err != nil {
switch r.StatusCode {
case http.StatusConflict:
fmt.Fprintf(os.Stderr, "Conflict when creating oAuth2Client: %v\n", err)
default:
fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.CreateOAuth2Client`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `OAuth2API.CreateOAuth2Client`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
// response from `CreateOAuth2Client`: OAuth2Client
fmt.Fprintf(os.Stdout, "Created client with name %s\n", resp.GetClientName())

clients, r, err := ory.OAuth2Api.ListOAuth2Clients(oryAuthedContext).ClientName(clientName).Execute()
clients, r, err := ory.OAuth2API.ListOAuth2Clients(oryAuthedContext).ClientName(clientName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.ListOAuth2Clients``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -106,5 +106,5 @@ func main() {

You can find more examples of SDK usage in the autogenerated documentation:

- [OAuth2Api API](https://github.com/ory/hydra-client-go/blob/master/docs/OAuth2API.md)
- [OAuth2API API](https://github.com/ory/hydra-client-go/blob/master/docs/OAuth2API.md)
- [OIDCApi API](https://github.com/ory/hydra-client-go/blob/master/docs/OidcAPI.md)
Loading