peridot/vendor/github.com/ory/hydra-client-go/client/admin/admin_client.go
2022-07-07 22:13:21 +02:00

1424 lines
59 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new admin API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for admin API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
AcceptConsentRequest(params *AcceptConsentRequestParams, opts ...ClientOption) (*AcceptConsentRequestOK, error)
AcceptLoginRequest(params *AcceptLoginRequestParams, opts ...ClientOption) (*AcceptLoginRequestOK, error)
AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ...ClientOption) (*AcceptLogoutRequestOK, error)
CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error)
CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error)
DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error)
DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error)
DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error)
DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error)
FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error)
GetConsentRequest(params *GetConsentRequestParams, opts ...ClientOption) (*GetConsentRequestOK, error)
GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption) (*GetJSONWebKeyOK, error)
GetJSONWebKeySet(params *GetJSONWebKeySetParams, opts ...ClientOption) (*GetJSONWebKeySetOK, error)
GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOption) (*GetLoginRequestOK, error)
GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error)
GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error)
GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error)
IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error)
IsInstanceAlive(params *IsInstanceAliveParams, opts ...ClientOption) (*IsInstanceAliveOK, error)
ListOAuth2Clients(params *ListOAuth2ClientsParams, opts ...ClientOption) (*ListOAuth2ClientsOK, error)
ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams, opts ...ClientOption) (*ListSubjectConsentSessionsOK, error)
PatchOAuth2Client(params *PatchOAuth2ClientParams, opts ...ClientOption) (*PatchOAuth2ClientOK, error)
RejectConsentRequest(params *RejectConsentRequestParams, opts ...ClientOption) (*RejectConsentRequestOK, error)
RejectLoginRequest(params *RejectLoginRequestParams, opts ...ClientOption) (*RejectLoginRequestOK, error)
RejectLogoutRequest(params *RejectLogoutRequestParams, opts ...ClientOption) (*RejectLogoutRequestNoContent, error)
RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams, opts ...ClientOption) (*RevokeAuthenticationSessionNoContent, error)
RevokeConsentSessions(params *RevokeConsentSessionsParams, opts ...ClientOption) (*RevokeConsentSessionsNoContent, error)
UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...ClientOption) (*UpdateJSONWebKeyOK, error)
UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error)
UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
AcceptConsentRequest accepts a consent request
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf.
The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to
grant or deny the client access to the requested scope ("Application my-dropbox-app wants write access to all your private files").
The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted
or rejected the request.
This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access resources on his/her behalf.
The consent provider includes additional information, such as session data for access and ID tokens, and if the
consent request should be used as basis for future requests.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
*/
func (a *Client) AcceptConsentRequest(params *AcceptConsentRequestParams, opts ...ClientOption) (*AcceptConsentRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAcceptConsentRequestParams()
}
op := &runtime.ClientOperation{
ID: "acceptConsentRequest",
Method: "PUT",
PathPattern: "/oauth2/auth/requests/consent/accept",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &AcceptConsentRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*AcceptConsentRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for acceptConsentRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
AcceptLoginRequest accepts a login request
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
(sometimes called "identity provider") to authenticate the subject and then tell ORY Hydra now about it. The login
provider is an web-app you write and host, and it must be able to authenticate ("show the subject a login screen")
a subject (in OAuth2 the proper name for subject is "resource owner").
The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
This endpoint tells ORY Hydra that the subject has successfully authenticated and includes additional information such as
the subject's ID and if ORY Hydra should remember the subject's subject agent for future authentication attempts by setting
a cookie.
The response contains a redirect URL which the login provider should redirect the user-agent to.
*/
func (a *Client) AcceptLoginRequest(params *AcceptLoginRequestParams, opts ...ClientOption) (*AcceptLoginRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAcceptLoginRequestParams()
}
op := &runtime.ClientOperation{
ID: "acceptLoginRequest",
Method: "PUT",
PathPattern: "/oauth2/auth/requests/login/accept",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &AcceptLoginRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*AcceptLoginRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for acceptLoginRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
AcceptLogoutRequest accepts a logout request
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm that logout request.
No body is required.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
*/
func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ...ClientOption) (*AcceptLogoutRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAcceptLogoutRequestParams()
}
op := &runtime.ClientOperation{
ID: "acceptLogoutRequest",
Method: "PUT",
PathPattern: "/oauth2/auth/requests/logout/accept",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &AcceptLogoutRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*AcceptLogoutRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for acceptLogoutRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CreateJSONWebKeySet generates a new JSON web key
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys (RS256, ECDSA). If the specified JSON Web Key Set does not exist, it will be created.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
*/
func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateJSONWebKeySetParams()
}
op := &runtime.ClientOperation{
ID: "createJsonWebKeySet",
Method: "POST",
PathPattern: "/keys/{set}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateJSONWebKeySetReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CreateJSONWebKeySetCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createJsonWebKeySet: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CreateOAuth2Client creates an o auth 2 0 client
Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
*/
func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateOAuth2ClientParams()
}
op := &runtime.ClientOperation{
ID: "createOAuth2Client",
Method: "POST",
PathPattern: "/clients",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateOAuth2ClientReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CreateOAuth2ClientCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteJSONWebKey deletes a JSON web key
Use this endpoint to delete a single JSON Web Key.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
*/
func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteJSONWebKeyParams()
}
op := &runtime.ClientOperation{
ID: "deleteJsonWebKey",
Method: "DELETE",
PathPattern: "/keys/{set}/{kid}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteJSONWebKeyReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteJSONWebKeyNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteJsonWebKey: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteJSONWebKeySet deletes a JSON web key set
Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
*/
func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteJSONWebKeySetParams()
}
op := &runtime.ClientOperation{
ID: "deleteJsonWebKeySet",
Method: "DELETE",
PathPattern: "/keys/{set}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteJSONWebKeySetReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteJSONWebKeySetNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteJsonWebKeySet: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteOAuth2Client deletes an o auth 2 0 client
Delete an existing OAuth 2.0 Client by its ID.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
*/
func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteOAuth2ClientParams()
}
op := &runtime.ClientOperation{
ID: "deleteOAuth2Client",
Method: "DELETE",
PathPattern: "/clients/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteOAuth2ClientReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteOAuth2ClientNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteOAuth2Token deletes o auth2 access tokens from a client
This endpoint deletes OAuth2 access tokens issued for a client from the database
*/
func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteOAuth2TokenParams()
}
op := &runtime.ClientOperation{
ID: "deleteOAuth2Token",
Method: "DELETE",
PathPattern: "/oauth2/tokens",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteOAuth2TokenReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteOAuth2TokenNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteOAuth2Token: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
FlushInactiveOAuth2Tokens flushes expired o auth2 access tokens
This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which no tokens will be
not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted
automatically when performing the refresh flow.
*/
func (a *Client) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFlushInactiveOAuth2TokensParams()
}
op := &runtime.ClientOperation{
ID: "flushInactiveOAuth2Tokens",
Method: "POST",
PathPattern: "/oauth2/flush",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &FlushInactiveOAuth2TokensReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FlushInactiveOAuth2TokensNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for flushInactiveOAuth2Tokens: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetConsentRequest gets consent request information
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf.
The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to
grant or deny the client access to the requested scope ("Application my-dropbox-app wants write access to all your private files").
The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted
or rejected the request.
*/
func (a *Client) GetConsentRequest(params *GetConsentRequestParams, opts ...ClientOption) (*GetConsentRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetConsentRequestParams()
}
op := &runtime.ClientOperation{
ID: "getConsentRequest",
Method: "GET",
PathPattern: "/oauth2/auth/requests/consent",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetConsentRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetConsentRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getConsentRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetJSONWebKey fetches a JSON web key
This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
*/
func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption) (*GetJSONWebKeyOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetJSONWebKeyParams()
}
op := &runtime.ClientOperation{
ID: "getJsonWebKey",
Method: "GET",
PathPattern: "/keys/{set}/{kid}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetJSONWebKeyReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetJSONWebKeyOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getJsonWebKey: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetJSONWebKeySet retrieves a JSON web key set
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
*/
func (a *Client) GetJSONWebKeySet(params *GetJSONWebKeySetParams, opts ...ClientOption) (*GetJSONWebKeySetOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetJSONWebKeySetParams()
}
op := &runtime.ClientOperation{
ID: "getJsonWebKeySet",
Method: "GET",
PathPattern: "/keys/{set}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetJSONWebKeySetReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetJSONWebKeySetOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getJsonWebKeySet: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetLoginRequest gets a login request
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
(sometimes called "identity provider") to authenticate the subject and then tell ORY Hydra now about it. The login
provider is an web-app you write and host, and it must be able to authenticate ("show the subject a login screen")
a subject (in OAuth2 the proper name for subject is "resource owner").
The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
*/
func (a *Client) GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOption) (*GetLoginRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetLoginRequestParams()
}
op := &runtime.ClientOperation{
ID: "getLoginRequest",
Method: "GET",
PathPattern: "/oauth2/auth/requests/login",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetLoginRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetLoginRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getLoginRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetLogoutRequest gets a logout request
Use this endpoint to fetch a logout request.
*/
func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetLogoutRequestParams()
}
op := &runtime.ClientOperation{
ID: "getLogoutRequest",
Method: "GET",
PathPattern: "/oauth2/auth/requests/logout",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetLogoutRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetLogoutRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getLogoutRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetOAuth2Client gets an o auth 2 0 client
Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
*/
func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetOAuth2ClientParams()
}
op := &runtime.ClientOperation{
ID: "getOAuth2Client",
Method: "GET",
PathPattern: "/clients/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetOAuth2ClientReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetOAuth2ClientOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetVersion gets service version
This endpoint returns the service version typically notated using semantic versioning.
If the service supports TLS Edge Termination, this endpoint does not require the
`X-Forwarded-Proto` header to be set.
*/
func (a *Client) GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetVersionParams()
}
op := &runtime.ClientOperation{
ID: "getVersion",
Method: "GET",
PathPattern: "/version",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetVersionReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetVersionOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
IntrospectOAuth2Token introspects o auth2 tokens
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token
is neither expired nor revoked. If a token is active, additional information on the token will be included. You can
set additional data for a token by setting `accessTokenExtra` during the consent flow.
For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/).
*/
func (a *Client) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewIntrospectOAuth2TokenParams()
}
op := &runtime.ClientOperation{
ID: "introspectOAuth2Token",
Method: "POST",
PathPattern: "/oauth2/introspect",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &IntrospectOAuth2TokenReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*IntrospectOAuth2TokenOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for introspectOAuth2Token: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
IsInstanceAlive checks alive status
This endpoint returns a 200 status code when the HTTP server is up running.
This status does currently not include checks whether the database connection is working.
If the service supports TLS Edge Termination, this endpoint does not require the
`X-Forwarded-Proto` header to be set.
Be aware that if you are running multiple nodes of this service, the health status will never
refer to the cluster state, only to a single instance.
*/
func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams, opts ...ClientOption) (*IsInstanceAliveOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewIsInstanceAliveParams()
}
op := &runtime.ClientOperation{
ID: "isInstanceAlive",
Method: "GET",
PathPattern: "/health/alive",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &IsInstanceAliveReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*IsInstanceAliveOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for isInstanceAlive: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListOAuth2Clients lists o auth 2 0 clients
This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'.
Multiple links can be included in this header, and will be separated by a comma.
*/
func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams, opts ...ClientOption) (*ListOAuth2ClientsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListOAuth2ClientsParams()
}
op := &runtime.ClientOperation{
ID: "listOAuth2Clients",
Method: "GET",
PathPattern: "/clients",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListOAuth2ClientsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*ListOAuth2ClientsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listOAuth2Clients: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListSubjectConsentSessions lists all consent sessions of a subject
This endpoint lists all subject's granted consent sessions, including client and granted scope.
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
empty JSON array with status code 200 OK.
The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '<https://hydra-url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'.
Multiple links can be included in this header, and will be separated by a comma.
*/
func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams, opts ...ClientOption) (*ListSubjectConsentSessionsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListSubjectConsentSessionsParams()
}
op := &runtime.ClientOperation{
ID: "listSubjectConsentSessions",
Method: "GET",
PathPattern: "/oauth2/auth/sessions/consent",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListSubjectConsentSessionsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*ListSubjectConsentSessionsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listSubjectConsentSessions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PatchOAuth2Client patches an o auth 2 0 client
Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
*/
func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams, opts ...ClientOption) (*PatchOAuth2ClientOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPatchOAuth2ClientParams()
}
op := &runtime.ClientOperation{
ID: "patchOAuth2Client",
Method: "PATCH",
PathPattern: "/clients/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &PatchOAuth2ClientReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PatchOAuth2ClientOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for patchOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RejectConsentRequest rejects a consent request
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf.
The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to
grant or deny the client access to the requested scope ("Application my-dropbox-app wants write access to all your private files").
The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted
or rejected the request.
This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access resources on his/her behalf.
The consent provider must include a reason why the consent was not granted.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
*/
func (a *Client) RejectConsentRequest(params *RejectConsentRequestParams, opts ...ClientOption) (*RejectConsentRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewRejectConsentRequestParams()
}
op := &runtime.ClientOperation{
ID: "rejectConsentRequest",
Method: "PUT",
PathPattern: "/oauth2/auth/requests/consent/reject",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &RejectConsentRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*RejectConsentRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for rejectConsentRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RejectLoginRequest rejects a login request
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
(sometimes called "identity provider") to authenticate the subject and then tell ORY Hydra now about it. The login
provider is an web-app you write and host, and it must be able to authenticate ("show the subject a login screen")
a subject (in OAuth2 the proper name for subject is "resource owner").
The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the authentication
was be denied.
The response contains a redirect URL which the login provider should redirect the user-agent to.
*/
func (a *Client) RejectLoginRequest(params *RejectLoginRequestParams, opts ...ClientOption) (*RejectLoginRequestOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewRejectLoginRequestParams()
}
op := &runtime.ClientOperation{
ID: "rejectLoginRequest",
Method: "PUT",
PathPattern: "/oauth2/auth/requests/login/reject",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &RejectLoginRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*RejectLoginRequestOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for rejectLoginRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RejectLogoutRequest rejects a logout request
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny that logout request.
No body is required.
The response is empty as the logout provider has to chose what action to perform next.
*/
func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams, opts ...ClientOption) (*RejectLogoutRequestNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewRejectLogoutRequestParams()
}
op := &runtime.ClientOperation{
ID: "rejectLogoutRequest",
Method: "PUT",
PathPattern: "/oauth2/auth/requests/logout/reject",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &RejectLogoutRequestReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*RejectLogoutRequestNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for rejectLogoutRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RevokeAuthenticationSession invalidates all login sessions of a certain user invalidates a subject s authentication session
This endpoint invalidates a subject's authentication session. After revoking the authentication session, the subject
has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work with OpenID Connect
Front- or Back-channel logout.
*/
func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams, opts ...ClientOption) (*RevokeAuthenticationSessionNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewRevokeAuthenticationSessionParams()
}
op := &runtime.ClientOperation{
ID: "revokeAuthenticationSession",
Method: "DELETE",
PathPattern: "/oauth2/auth/sessions/login",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &RevokeAuthenticationSessionReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*RevokeAuthenticationSessionNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for revokeAuthenticationSession: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RevokeConsentSessions revokes consent sessions of a subject for a specific o auth 2 0 client
This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and invalidates all
associated OAuth 2.0 Access Tokens.
*/
func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams, opts ...ClientOption) (*RevokeConsentSessionsNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewRevokeConsentSessionsParams()
}
op := &runtime.ClientOperation{
ID: "revokeConsentSessions",
Method: "DELETE",
PathPattern: "/oauth2/auth/sessions/consent",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &RevokeConsentSessionsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*RevokeConsentSessionsNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for revokeConsentSessions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateJSONWebKey updates a JSON web key
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
*/
func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...ClientOption) (*UpdateJSONWebKeyOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateJSONWebKeyParams()
}
op := &runtime.ClientOperation{
ID: "updateJsonWebKey",
Method: "PUT",
PathPattern: "/keys/{set}/{kid}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UpdateJSONWebKeyReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*UpdateJSONWebKeyOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateJsonWebKey: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateJSONWebKeySet updates a JSON web key set
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
*/
func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateJSONWebKeySetParams()
}
op := &runtime.ClientOperation{
ID: "updateJsonWebKeySet",
Method: "PUT",
PathPattern: "/keys/{set}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UpdateJSONWebKeySetReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*UpdateJSONWebKeySetOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateJsonWebKeySet: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateOAuth2Client updates an o auth 2 0 client
Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
*/
func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateOAuth2ClientParams()
}
op := &runtime.ClientOperation{
ID: "updateOAuth2Client",
Method: "PUT",
PathPattern: "/clients/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UpdateOAuth2ClientReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*UpdateOAuth2ClientOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}