diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 8fd9b40..6a2fd7e 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -27,9 +27,9 @@ docs/IsReady503Response.md docs/JsonPatch.md docs/JsonWebKey.md docs/JsonWebKeySet.md -docs/JwkApi.md -docs/MetadataApi.md -docs/OAuth2Api.md +docs/JwkAPI.md +docs/MetadataAPI.md +docs/OAuth2API.md docs/OAuth2Client.md docs/OAuth2ClientTokenLifespans.md docs/OAuth2ConsentRequest.md @@ -40,7 +40,7 @@ docs/OAuth2LoginRequest.md docs/OAuth2LogoutRequest.md docs/OAuth2RedirectTo.md docs/OAuth2TokenExchange.md -docs/OidcApi.md +docs/OidcAPI.md docs/OidcConfiguration.md docs/OidcUserInfo.md docs/Pagination.md @@ -58,7 +58,7 @@ docs/VerifiableCredentialPrimingResponse.md docs/VerifiableCredentialProof.md docs/VerifiableCredentialResponse.md docs/Version.md -docs/WellknownApi.md +docs/WellknownAPI.md git_push.sh go.mod go.sum @@ -107,4 +107,9 @@ model_verifiable_credential_proof.go model_verifiable_credential_response.go model_version.go response.go +test/api_jwk_test.go +test/api_metadata_test.go +test/api_o_auth2_test.go +test/api_oidc_test.go +test/api_wellknown_test.go utils.go diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 6d54bbd..3769235 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.1 \ No newline at end of file +7.1.0 \ No newline at end of file diff --git a/api/openapi.yaml b/api/openapi.yaml index 635ac3e..7f53b57 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -7,7 +7,7 @@ info: license: name: Apache 2.0 title: Ory Hydra API - version: v2.2.0-rc.3 + version: v2.2.0 servers: - url: / tags: @@ -24,10 +24,10 @@ tags: paths: /.well-known/jwks.json: get: - description: "This endpoint returns JSON Web Keys required to verifying OpenID\ - \ Connect ID Tokens and,\nif enabled, OAuth 2.0 JWT Access Tokens. This endpoint\ - \ can be used with client libraries like\n[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa)\ - \ among others." + description: |- + This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and, + if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like + [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others. operationId: discoverJsonWebKeys responses: "200": @@ -47,11 +47,11 @@ paths: - wellknown /.well-known/openid-configuration: get: - description: "A mechanism for an OpenID Connect Relying Party to discover the\ - \ End-User's OpenID Provider and obtain information needed to interact with\ - \ it, including its OAuth 2.0 endpoint locations.\n\nPopular libraries for\ - \ OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),\ - \ and others.\nFor a full list of clients go here: https://openid.net/developers/certified/" + description: |- + A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and obtain information needed to interact with it, including its OAuth 2.0 endpoint locations. + + Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang), and others. + For a full list of clients go here: https://openid.net/developers/certified/ operationId: discoverOidcConfiguration responses: "200": @@ -71,12 +71,16 @@ paths: - oidc /admin/clients: get: - description: "This endpoint lists all clients in the database, and never returns\ - \ client secrets.\nAs a default it lists the first 100 clients." + description: |- + This endpoint lists all clients in the database, and never returns client secrets. + As a default it lists the first 100 clients. operationId: listOAuth2Clients parameters: - - description: "Items per Page\n\nThis is the number of items per page to return.\n\ - For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + - description: |- + Items per Page + + This is the number of items per page to return. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). explode: true in: query name: page_size @@ -88,8 +92,11 @@ paths: minimum: 1 type: integer style: form - - description: "Next Page Token\n\nThe next page token.\nFor details on pagination\ - \ please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + - description: |- + Next Page Token + + The next page token. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). explode: true in: query name: page_token @@ -134,9 +141,9 @@ paths: tags: - oAuth2 post: - description: "Create a new OAuth 2.0 client. If you pass `client_secret` the\ - \ secret is used, otherwise a random secret\nis generated. The secret is echoed\ - \ in the response. It is not possible to retrieve it later on." + description: |- + Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random secret + is generated. The secret is echoed in the response. It is not possible to retrieve it later on. operationId: createOAuth2Client requestBody: content: @@ -170,11 +177,13 @@ paths: - oAuth2 /admin/clients/{id}: delete: - description: "Delete an existing OAuth 2.0 Client by its ID.\n\nOAuth 2.0 clients\ - \ are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0\ - \ clients are\ngenerated for applications which want to consume your OAuth\ - \ 2.0 or OpenID Connect capabilities.\n\nMake sure that this endpoint is well\ - \ protected and only callable by first-party components." + description: |- + 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. + + Make sure that this endpoint is well protected and only callable by first-party components. operationId: deleteOAuth2Client parameters: - description: The id of the OAuth 2.0 Client. @@ -187,8 +196,9 @@ paths: style: simple responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -199,10 +209,11 @@ paths: tags: - oAuth2 get: - description: "Get an OAuth 2.0 client by its ID. This endpoint never returns\ - \ the client secret.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and\ - \ OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications\ - \ which want to consume your OAuth 2.0 or OpenID Connect capabilities." + description: |- + Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret. + + 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. operationId: getOAuth2Client parameters: - description: The id of the OAuth 2.0 Client. @@ -230,13 +241,13 @@ paths: tags: - oAuth2 patch: - description: "Patch an existing OAuth 2.0 Client using JSON Patch. If you pass\ - \ `client_secret`\nthe secret will be updated and returned via the API. This\ - \ is the\nonly time you will be able to retrieve the client secret, so write\ - \ it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth\ - \ 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated\ - \ for applications which want to consume your OAuth 2.0 or OpenID Connect\ - \ capabilities." + description: |- + Patch an existing OAuth 2.0 Client using JSON Patch. 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. operationId: patchOAuth2Client parameters: - description: The id of the OAuth 2.0 Client. @@ -278,13 +289,14 @@ paths: tags: - oAuth2 put: - description: "Replaces an existing OAuth 2.0 Client with the payload you send.\ - \ If you pass `client_secret` the secret is used,\notherwise the existing\ - \ secret is used.\n\nIf set, the secret is echoed in the response. It is not\ - \ possible to retrieve it later on.\n\nOAuth 2.0 Clients are used to perform\ - \ OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated\ - \ for applications which want to consume your OAuth 2.0 or OpenID Connect\ - \ capabilities." + description: |- + Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the secret is used, + otherwise the existing secret is used. + + If set, the secret is echoed in the response. It is not possible to retrieve it later on. + + 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. operationId: setOAuth2Client parameters: - description: OAuth 2.0 Client ID @@ -369,13 +381,10 @@ paths: - oAuth2 /admin/keys/{set}: delete: - description: "Use this endpoint to delete a complete JSON Web Key Set and all\ - \ the keys in that set.\n\nA 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." + description: |- + 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. operationId: deleteJsonWebKeySet parameters: - description: The JSON Web Key Set @@ -388,8 +397,9 @@ paths: style: simple responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -400,13 +410,10 @@ paths: tags: - jwk get: - description: "This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.\n\ - \nA 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." + description: |- + 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. operationId: getJsonWebKeySet parameters: - description: JSON Web Key Set ID @@ -434,16 +441,10 @@ paths: tags: - jwk post: - description: "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.\n\nA\ - \ 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." + description: |- + 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. operationId: createJsonWebKeySet parameters: - description: The JSON Web Key Set ID @@ -478,13 +479,10 @@ paths: tags: - jwk put: - description: "Use this method if you do not want to let Hydra generate the JWKs\ - \ for you, but instead save your own.\n\nA 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." + description: |- + 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. operationId: setJsonWebKeySet parameters: - description: The JSON Web Key Set ID @@ -519,13 +517,13 @@ paths: - jwk /admin/keys/{set}/{kid}: delete: - description: "Use this endpoint to delete a single JSON Web Key.\n\nA JSON Web\ - \ Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents\ - \ a cryptographic key. A\nJWK 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\nthis functionality to store cryptographic keys used for TLS and JSON\ - \ Web Tokens (such as OpenID Connect ID tokens),\nand allows storing user-defined\ - \ keys as well." + description: |- + 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. operationId: deleteJsonWebKey parameters: - description: The JSON Web Key Set @@ -546,8 +544,9 @@ paths: style: simple responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -595,13 +594,10 @@ paths: tags: - jwk put: - description: "Use this method if you do not want to let Hydra generate the JWKs\ - \ for you, but instead save your own.\n\nA 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." + description: |- + 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. operationId: setJsonWebKey parameters: - description: The JSON Web Key Set ID @@ -644,17 +640,17 @@ paths: - jwk /admin/oauth2/auth/requests/consent: get: - description: "When an authorization code, hybrid, or implicit OAuth 2.0 Flow\ - \ is initiated, Ory asks the login provider\nto authenticate the subject and\ - \ then tell Ory now about it. If the subject authenticated, he/she must now\ - \ be asked if\nthe OAuth 2.0 Client which initiated the flow should be allowed\ - \ to access the resources on the subject's behalf.\n\nThe consent challenge\ - \ is appended to the consent provider's URL to which the subject's user-agent\ - \ (browser) is redirected to. The consent\nprovider uses that challenge to\ - \ fetch information on the OAuth2 request and then tells Ory if the subject\ - \ accepted\nor rejected the request.\n\nThe default consent provider is available\ - \ via the Ory Managed Account Experience. To customize the consent provider,\ - \ please\nhead over to the OAuth 2.0 documentation." + description: |- + When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider + to authenticate the subject and then tell Ory 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 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 if the subject accepted + or rejected the request. + + The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please + head over to the OAuth 2.0 documentation. operationId: getOAuth2ConsentRequest parameters: - description: OAuth 2.0 Consent Request Challenge @@ -689,22 +685,23 @@ paths: - oAuth2 /admin/oauth2/auth/requests/consent/accept: put: - description: "When an authorization code, hybrid, or implicit OAuth 2.0 Flow\ - \ is initiated, Ory asks the login provider\nto authenticate the subject and\ - \ then tell Ory now about it. If the subject authenticated, he/she must now\ - \ be asked if\nthe OAuth 2.0 Client which initiated the flow should be allowed\ - \ to access the resources on the subject's behalf.\n\nThe consent challenge\ - \ is appended to the consent provider's URL to which the subject's user-agent\ - \ (browser) is redirected to. The consent\nprovider uses that challenge to\ - \ fetch information on the OAuth2 request and then tells Ory if the subject\ - \ accepted\nor rejected the request.\n\nThis endpoint tells Ory that the subject\ - \ has authorized the OAuth 2.0 client to access resources on his/her behalf.\n\ - The consent provider includes additional information, such as session data\ - \ for access and ID tokens, and if the\nconsent request should be used as\ - \ basis for future requests.\n\nThe response contains a redirect URL which\ - \ the consent provider should redirect the user-agent to.\n\nThe default consent\ - \ provider is available via the Ory Managed Account Experience. To customize\ - \ the consent provider, please\nhead over to the OAuth 2.0 documentation." + description: |- + When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider + to authenticate the subject and then tell Ory 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 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 if the subject accepted + or rejected the request. + + This endpoint tells Ory 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. + + The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please + head over to the OAuth 2.0 documentation. operationId: acceptOAuth2ConsentRequest parameters: - description: OAuth 2.0 Consent Request Challenge @@ -739,21 +736,22 @@ paths: - oAuth2 /admin/oauth2/auth/requests/consent/reject: put: - description: "When an authorization code, hybrid, or implicit OAuth 2.0 Flow\ - \ is initiated, Ory asks the login provider\nto authenticate the subject and\ - \ then tell Ory now about it. If the subject authenticated, he/she must now\ - \ be asked if\nthe OAuth 2.0 Client which initiated the flow should be allowed\ - \ to access the resources on the subject's behalf.\n\nThe consent challenge\ - \ is appended to the consent provider's URL to which the subject's user-agent\ - \ (browser) is redirected to. The consent\nprovider uses that challenge to\ - \ fetch information on the OAuth2 request and then tells Ory if the subject\ - \ accepted\nor rejected the request.\n\nThis endpoint tells Ory that the subject\ - \ has not authorized the OAuth 2.0 client to access resources on his/her behalf.\n\ - The consent provider must include a reason why the consent was not granted.\n\ - \nThe response contains a redirect URL which the consent provider should redirect\ - \ the user-agent to.\n\nThe default consent provider is available via the\ - \ Ory Managed Account Experience. To customize the consent provider, please\n\ - head over to the OAuth 2.0 documentation." + description: |- + When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider + to authenticate the subject and then tell Ory 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 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 if the subject accepted + or rejected the request. + + This endpoint tells Ory 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. + + The default consent provider is available via the Ory Managed Account Experience. To customize the consent provider, please + head over to the OAuth 2.0 documentation. operationId: rejectOAuth2ConsentRequest parameters: - description: OAuth 2.0 Consent Request Challenge @@ -788,17 +786,16 @@ paths: - oAuth2 /admin/oauth2/auth/requests/login: get: - description: "When an authorization code, hybrid, or implicit OAuth 2.0 Flow\ - \ is initiated, Ory asks the login provider\nto authenticate the subject and\ - \ then tell the Ory OAuth2 Service about it.\n\nPer default, the login provider\ - \ is Ory itself. You may use a different login provider which needs to be\ - \ a web-app\nyou write and host, and it must be able to authenticate (\"show\ - \ the subject a login screen\")\na subject (in OAuth2 the proper name for\ - \ subject is \"resource owner\").\n\nThe authentication challenge is appended\ - \ to the login provider URL to which the subject's user-agent (browser) is\ - \ redirected to. The login\nprovider uses that challenge to fetch information\ - \ on the OAuth2 request and then accept or reject the requested authentication\ - \ process." + description: |- + When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider + to authenticate the subject and then tell the Ory OAuth2 Service about it. + + Per default, the login provider is Ory itself. You may use a different login provider which needs to be a 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. operationId: getOAuth2LoginRequest parameters: - description: OAuth 2.0 Login Request Challenge @@ -833,17 +830,18 @@ paths: - oAuth2 /admin/oauth2/auth/requests/login/accept: put: - description: "When an authorization code, hybrid, or implicit OAuth 2.0 Flow\ - \ is initiated, Ory asks the login provider\nto authenticate the subject and\ - \ then tell the Ory OAuth2 Service about it.\n\nThe authentication challenge\ - \ is appended to the login provider URL to which the subject's user-agent\ - \ (browser) is redirected to. The login\nprovider uses that challenge to fetch\ - \ information on the OAuth2 request and then accept or reject the requested\ - \ authentication process.\n\nThis endpoint tells Ory that the subject has\ - \ successfully authenticated and includes additional information such as\n\ - the subject's ID and if Ory should remember the subject's subject agent for\ - \ future authentication attempts by setting\na cookie.\n\nThe response contains\ - \ a redirect URL which the login provider should redirect the user-agent to." + description: |- + When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider + to authenticate the subject and then tell the Ory OAuth2 Service about it. + + 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 that the subject has successfully authenticated and includes additional information such as + the subject's ID and if Ory 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. operationId: acceptOAuth2LoginRequest parameters: - description: OAuth 2.0 Login Request Challenge @@ -878,16 +876,17 @@ paths: - oAuth2 /admin/oauth2/auth/requests/login/reject: put: - description: "When an authorization code, hybrid, or implicit OAuth 2.0 Flow\ - \ is initiated, Ory asks the login provider\nto authenticate the subject and\ - \ then tell the Ory OAuth2 Service about it.\n\nThe authentication challenge\ - \ is appended to the login provider URL to which the subject's user-agent\ - \ (browser) is redirected to. The login\nprovider uses that challenge to fetch\ - \ information on the OAuth2 request and then accept or reject the requested\ - \ authentication process.\n\nThis endpoint tells Ory that the subject has\ - \ not authenticated and includes a reason why the authentication\nwas denied.\n\ - \nThe response contains a redirect URL which the login provider should redirect\ - \ the user-agent to." + description: |- + When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login provider + to authenticate the subject and then tell the Ory OAuth2 Service about it. + + 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 that the subject has not authenticated and includes a reason why the authentication + was denied. + + The response contains a redirect URL which the login provider should redirect the user-agent to. operationId: rejectOAuth2LoginRequest parameters: - description: OAuth 2.0 Login Request Challenge @@ -956,10 +955,10 @@ paths: - oAuth2 /admin/oauth2/auth/requests/logout/accept: put: - description: "When a user or an application requests Ory OAuth 2.0 to remove\ - \ the session state of a subject, this endpoint is used to confirm that logout\ - \ request.\n\nThe response contains a redirect URL which the consent provider\ - \ should redirect the user-agent to." + description: |- + When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this endpoint is used to confirm that logout request. + + The response contains a redirect URL which the consent provider should redirect the user-agent to. operationId: acceptOAuth2LogoutRequest parameters: - description: OAuth 2.0 Logout Request Challenge @@ -988,10 +987,11 @@ paths: - oAuth2 /admin/oauth2/auth/requests/logout/reject: put: - description: "When a user or an application requests Ory OAuth 2.0 to remove\ - \ the session state of a subject, this endpoint is used to deny that logout\ - \ request.\nNo HTTP request body is required.\n\nThe response is empty as\ - \ the logout provider has to chose what action to perform next." + description: |- + When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this endpoint is used to deny that logout request. + No HTTP request body is required. + + The response is empty as the logout provider has to chose what action to perform next. operationId: rejectOAuth2LogoutRequest parameters: - explode: true @@ -1003,8 +1003,9 @@ paths: style: form responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1032,8 +1033,10 @@ paths: schema: type: string style: form - - description: "OAuth 2.0 Client ID\n\nIf set, deletes only those consent sessions\ - \ that have been granted to the specified OAuth 2.0 Client ID." + - description: |- + OAuth 2.0 Client ID + + If set, deletes only those consent sessions that have been granted to the specified OAuth 2.0 Client ID. explode: true in: query name: client @@ -1054,8 +1057,9 @@ paths: style: form responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1066,14 +1070,17 @@ paths: tags: - oAuth2 get: - description: "This endpoint lists all subject's granted consent sessions, including\ - \ client and granted scope.\nIf the subject is unknown or has not granted\ - \ any consent sessions yet, the endpoint returns an\nempty JSON array with\ - \ status code 200 OK." + description: |- + 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. operationId: listOAuth2ConsentSessions parameters: - - description: "Items per Page\n\nThis is the number of items per page to return.\n\ - For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + - description: |- + Items per Page + + This is the number of items per page to return. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). explode: true in: query name: page_size @@ -1085,8 +1092,11 @@ paths: minimum: 1 type: integer style: form - - description: "Next Page Token\n\nThe next page token.\nFor details on pagination\ - \ please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + - description: |- + Next Page Token + + The next page token. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). explode: true in: query name: page_token @@ -1130,15 +1140,15 @@ paths: - oAuth2 /admin/oauth2/auth/sessions/login: delete: - description: "This endpoint invalidates authentication sessions. After revoking\ - \ the authentication session(s), the subject\nhas to re-authenticate at the\ - \ Ory OAuth2 Provider. This endpoint does not invalidate any tokens.\n\nIf\ - \ you send the subject in a query param, all authentication sessions that\ - \ belong to that subject are revoked.\nNo OpennID Connect Front- or Back-channel\ - \ logout is performed in this case.\n\nAlternatively, you can send a SessionID\ - \ via `sid` query param, in which case, only the session that is connected\n\ - to that SessionID is revoked. OpenID Connect Back-channel logout is performed\ - \ in this case." + description: |- + This endpoint invalidates authentication sessions. After revoking the authentication session(s), the subject + has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens. + + If you send the subject in a query param, all authentication sessions that belong to that subject are revoked. + No OpenID Connect Front- or Back-channel logout is performed in this case. + + Alternatively, you can send a SessionID via `sid` query param, in which case, only the session that is connected + to that SessionID is revoked. OpenID Connect Back-channel logout is performed in this case. operationId: revokeOAuth2LoginSessions parameters: - description: |- @@ -1165,8 +1175,9 @@ paths: style: form responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1178,11 +1189,10 @@ paths: - oAuth2 /admin/oauth2/introspect: post: - description: "The introspection endpoint allows to check if a token (both refresh\ - \ and access) is active or not. An active token\nis neither expired nor revoked.\ - \ If a token is active, additional information on the token will be included.\ - \ You can\nset additional data for a token by setting `session.access_token`\ - \ during the consent flow." + description: |- + 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 `session.access_token` during the consent flow. operationId: introspectOAuth2Token requestBody: content: @@ -1221,8 +1231,9 @@ paths: style: form responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1279,9 +1290,10 @@ paths: tags: - oAuth2 post: - description: "Use this endpoint to establish a trust relationship for a JWT\ - \ issuer\nto perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication\n\ - and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523)." + description: |- + Use this endpoint to establish a trust relationship for a JWT issuer + to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication + and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523). operationId: trustOAuth2JwtGrantIssuer requestBody: content: @@ -1307,11 +1319,12 @@ paths: - oAuth2 /admin/trust/grants/jwt-bearer/issuers/{id}: delete: - description: "Use this endpoint to delete trusted JWT Bearer Grant Type Issuer.\ - \ The ID is the one returned when you\ncreated the trust relationship.\n\n\ - Once deleted, the associated issuer will no longer be able to perform the\ - \ JSON Web Token (JWT) Profile\nfor OAuth 2.0 Client Authentication and Authorization\ - \ Grant." + description: |- + Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you + created the trust relationship. + + Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT) Profile + for OAuth 2.0 Client Authentication and Authorization Grant. operationId: deleteTrustedOAuth2JwtGrantIssuer parameters: - description: The id of the desired grant @@ -1324,8 +1337,9 @@ paths: style: simple responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1405,13 +1419,15 @@ paths: - oidc /health/alive: get: - description: "This endpoint returns a HTTP 200 status code when Ory Hydra is\ - \ accepting incoming\nHTTP requests. This status does currently not include\ - \ checks whether the database connection is working.\n\nIf the service supports\ - \ TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto`\ - \ header to be set.\n\nBe aware that if you are running multiple nodes of\ - \ this service, the health status will never\nrefer to the cluster state,\ - \ only to a single instance." + description: |- + This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming + HTTP requests. 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. operationId: isAlive responses: "200": @@ -1431,12 +1447,15 @@ paths: - metadata /health/ready: get: - description: "This endpoint returns a HTTP 200 status code when Ory Hydra is\ - \ up running and the environment dependencies (e.g.\nthe database) are responsive\ - \ as well.\n\nIf the service supports TLS Edge Termination, this endpoint\ - \ does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware\ - \ that if you are running multiple nodes of Ory Hydra, the health status will\ - \ never\nrefer to the cluster state, only to a single instance." + description: |- + This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment dependencies (e.g. + the database) are responsive as well. + + 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 Ory Hydra, the health status will never + refer to the cluster state, only to a single instance. operationId: isReady responses: "200": @@ -1464,8 +1483,9 @@ paths: operationId: oAuth2Authorize responses: "302": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1522,18 +1542,18 @@ paths: - oidc /oauth2/register/{id}: delete: - description: "This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`)\ - \ but is capable of facing the\npublic internet directly and can be used in\ - \ self-service. It implements the OpenID Connect\nDynamic Client Registration\ - \ Protocol. This feature needs to be enabled in the configuration. This endpoint\n\ - is disabled by default. It can be enabled by an administrator.\n\nTo use this\ - \ endpoint, you will need to present the client's authentication credentials.\ - \ If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`,\ - \ you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`,\ - \ present the Client ID and the Client Secret in the Authorization header.\n\ - \nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows.\ - \ Usually, OAuth 2.0 clients are\ngenerated for applications which want to\ - \ consume your OAuth 2.0 or OpenID Connect capabilities." + description: |- + This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the + public internet directly and can be used in self-service. It implements the OpenID Connect + Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint + is disabled by default. It can be enabled by an administrator. + + To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client + uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. + If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + + 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. operationId: deleteOidcDynamicClient parameters: - description: The id of the OAuth 2.0 Client. @@ -1546,8 +1566,9 @@ paths: style: simple responses: "204": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1561,14 +1582,14 @@ paths: tags: - oidc get: - description: "This endpoint behaves like the administrative counterpart (`getOAuth2Client`)\ - \ but is capable of facing the\npublic internet directly and can be used in\ - \ self-service. It implements the OpenID Connect\nDynamic Client Registration\ - \ Protocol.\n\nTo use this endpoint, you will need to present the client's\ - \ authentication credentials. If the OAuth2 Client\nuses the Token Endpoint\ - \ Authentication Method `client_secret_post`, you need to present the client\ - \ secret in the URL query.\nIf it uses `client_secret_basic`, present the\ - \ Client ID and the Client Secret in the Authorization header." + description: |- + This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the + public internet directly and can be used in self-service. It implements the OpenID Connect + Dynamic Client Registration Protocol. + + To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client + uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. + If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. operationId: getOidcDynamicClient parameters: - description: The id of the OAuth 2.0 Client. @@ -1598,20 +1619,22 @@ paths: tags: - oidc put: - description: "This endpoint behaves like the administrative counterpart (`setOAuth2Client`)\ - \ but is capable of facing the\npublic internet directly to be used by third\ - \ parties. It implements the OpenID Connect\nDynamic Client Registration Protocol.\n\ - \nThis feature is disabled per default. It can be enabled by a system administrator.\n\ - \nIf you pass `client_secret` the secret is used, otherwise the existing secret\ - \ is used. If set, the secret is echoed in the response.\nIt is not possible\ - \ to retrieve it later on.\n\nTo use this endpoint, you will need to present\ - \ the client's authentication credentials. If the OAuth2 Client\nuses the\ - \ Token Endpoint Authentication Method `client_secret_post`, you need to present\ - \ the client secret in the URL query.\nIf it uses `client_secret_basic`, present\ - \ the Client ID and the Client Secret in the Authorization header.\n\nOAuth\ - \ 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually,\ - \ OAuth 2.0 clients are\ngenerated for applications which want to consume\ - \ your OAuth 2.0 or OpenID Connect capabilities." + description: |- + This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of facing the + public internet directly to be used by third parties. It implements the OpenID Connect + Dynamic Client Registration Protocol. + + This feature is disabled per default. It can be enabled by a system administrator. + + If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the secret is echoed in the response. + It is not possible to retrieve it later on. + + To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client + uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. + If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + + 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. operationId: setOidcDynamicClient parameters: - description: OAuth 2.0 Client ID @@ -1656,12 +1679,11 @@ paths: - oidc /oauth2/revoke: post: - description: "Revoking a token (both access and refresh) means that the tokens\ - \ will be invalid. A revoked access token can no\nlonger be used to make access\ - \ requests, and a revoked refresh token can no longer be used to refresh an\ - \ access token.\nRevoking a refresh token also invalidates the access token\ - \ that was created with it. A token may only be revoked by\nthe client the\ - \ token was generated for." + description: |- + Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no + longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. + Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by + the client the token was generated for. operationId: revokeOAuth2Token requestBody: content: @@ -1670,8 +1692,9 @@ paths: $ref: '#/components/schemas/revokeOAuth2Token_request' responses: "200": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. default: content: application/json: @@ -1696,8 +1719,9 @@ paths: operationId: revokeOidcSession responses: "302": - description: "Empty responses are sent when, for example, resources are\ - \ deleted. The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. summary: OpenID Connect Front- and Back-channel Enabled Logout tags: - oidc @@ -1735,11 +1759,13 @@ paths: - oAuth2 /userinfo: get: - description: "This endpoint returns the payload of the ID Token, including `session.id_token`\ - \ values, of\nthe provided OAuth 2.0 Access Token's consent request.\n\nIn\ - \ the case of authentication error, a WWW-Authenticate header might be set\ - \ in the response\nwith more information about the error. See [the spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)\n\ - for more details about header format." + description: |- + This endpoint returns the payload of the ID Token, including `session.id_token` values, of + the provided OAuth 2.0 Access Token's consent request. + + In the case of authentication error, a WWW-Authenticate header might be set in the response + with more information about the error. See [the spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3) + for more details about header format. operationId: getOidcUserInfo responses: "200": @@ -1761,11 +1787,14 @@ paths: - oidc /version: get: - description: "This endpoint returns the version of Ory Hydra.\n\nIf the service\ - \ supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto`\ - \ header to be set.\n\nBe aware that if you are running multiple nodes of\ - \ this service, the version will never\nrefer to the cluster state, only to\ - \ a single instance." + description: |- + This endpoint returns the version of Ory Hydra. + + 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 version will never + refer to the cluster state, only to a single instance. operationId: getVersion responses: "200": @@ -1780,8 +1809,9 @@ paths: components: responses: emptyResponse: - description: "Empty responses are sent when, for example, resources are deleted.\ - \ The HTTP status code for empty responses is\ntypically 201." + description: |- + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + typically 201. errorOAuth2BadRequest: content: application/json: @@ -1896,6 +1926,9 @@ components: type: object acceptOAuth2ConsentRequest: properties: + context: + title: "JSONRawMessage represents a json.RawMessage that works well with\ + \ JSON, SQL, and Swagger." grant_access_token_audience: items: type: string @@ -1913,14 +1946,14 @@ components: title: NullTime implements sql.NullTime functionality. type: string remember: - description: "Remember, if set to true, tells ORY Hydra to remember this\ - \ consent authorization and reuse it if the same\nclient asks the same\ - \ user for the same, or a subset of, scope." + description: |- + Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same + client asks the same user for the same, or a subset of, scope. type: boolean remember_for: - description: "RememberFor sets how long the consent authorization should\ - \ be remembered for in seconds. If set to `0`, the\nauthorization will\ - \ be remembered indefinitely." + description: |- + RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the + authorization will be remembered indefinitely. format: int64 type: integer session: @@ -1933,13 +1966,11 @@ components: id_token: "" properties: access_token: - description: "AccessToken sets session data for the access and refresh token,\ - \ as well as any future tokens issued by the\nrefresh grant. Keep in mind\ - \ that this data will be available to anyone performing OAuth 2.0 Challenge\ - \ Introspection.\nIf only your services can perform OAuth 2.0 Challenge\ - \ Introspection, this is usually fine. But if third parties\ncan access\ - \ that endpoint as well, sensitive data from the session might be exposed\ - \ to them. Use with care!" + description: |- + AccessToken sets session data for the access and refresh token, as well as any future tokens issued by the + refresh grant. Keep in mind that this data will be available to anyone performing OAuth 2.0 Challenge Introspection. + If only your services can perform OAuth 2.0 Challenge Introspection, this is usually fine. But if third parties + can access that endpoint as well, sensitive data from the session might be exposed to them. Use with care! id_token: description: |- IDToken sets session data for the OpenID Connect ID token. Keep in mind that the session'id payloads are readable @@ -1949,9 +1980,9 @@ components: acceptOAuth2LoginRequest: properties: acr: - description: "ACR sets the Authentication AuthorizationContext Class Reference\ - \ value for this authentication session. You can use it\nto express that,\ - \ for example, a user authenticated using two factor authentication." + description: |- + ACR sets the Authentication AuthorizationContext Class Reference value for this authentication session. You can use it + to express that, for example, a user authenticated using two factor authentication. type: string amr: items: @@ -1963,47 +1994,48 @@ components: title: "JSONRawMessage represents a json.RawMessage that works well with\ \ JSON, SQL, and Swagger." extend_session_lifespan: - description: "Extend OAuth2 authentication session lifespan\n\nIf set to\ - \ `true`, the OAuth2 authentication cookie lifespan is extended. This\ - \ is for example useful if you want the user to be able to use `prompt=none`\ - \ continuously.\n\nThis value can only be set to `true` if the user has\ - \ an authentication, which is the case if the `skip` value is `true`." + description: |- + Extend OAuth2 authentication session lifespan + + If set to `true`, the OAuth2 authentication cookie lifespan is extended. This is for example useful if you want the user to be able to use `prompt=none` continuously. + + This value can only be set to `true` if the user has an authentication, which is the case if the `skip` value is `true`. type: boolean force_subject_identifier: - description: "ForceSubjectIdentifier forces the \"pairwise\" user ID of\ - \ the end-user that authenticated. The \"pairwise\" user ID refers to\ - \ the\n(Pairwise Identifier Algorithm)[http://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg]\ - \ of the OpenID\nConnect specification. It allows you to set an obfuscated\ - \ subject (\"user\") identifier that is unique to the client.\n\nPlease\ - \ note that this changes the user ID on endpoint /userinfo and sub claim\ - \ of the ID Token. It does not change the\nsub claim in the OAuth 2.0\ - \ Introspection.\n\nPer default, ORY Hydra handles this value with its\ - \ own algorithm. In case you want to set this yourself\nyou can use this\ - \ field. Please note that setting this field has no effect if `pairwise`\ - \ is not configured in\nORY Hydra or the OAuth 2.0 Client does not expect\ - \ a pairwise identifier (set via `subject_type` key in the client's\n\ - configuration).\n\nPlease also be aware that ORY Hydra is unable to properly\ - \ compute this value during authentication. This implies\nthat you have\ - \ to compute this value on every authentication process (probably depending\ - \ on the client ID or some\nother unique value).\n\nIf you fail to compute\ - \ the proper value, then authentication processes which have id_token_hint\ - \ set might fail." + description: |- + ForceSubjectIdentifier forces the "pairwise" user ID of the end-user that authenticated. The "pairwise" user ID refers to the + (Pairwise Identifier Algorithm)[http://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg] of the OpenID + Connect specification. It allows you to set an obfuscated subject ("user") identifier that is unique to the client. + + Please note that this changes the user ID on endpoint /userinfo and sub claim of the ID Token. It does not change the + sub claim in the OAuth 2.0 Introspection. + + Per default, ORY Hydra handles this value with its own algorithm. In case you want to set this yourself + you can use this field. Please note that setting this field has no effect if `pairwise` is not configured in + ORY Hydra or the OAuth 2.0 Client does not expect a pairwise identifier (set via `subject_type` key in the client's + configuration). + + Please also be aware that ORY Hydra is unable to properly compute this value during authentication. This implies + that you have to compute this value on every authentication process (probably depending on the client ID or some + other unique value). + + If you fail to compute the proper value, then authentication processes which have id_token_hint set might fail. type: string identity_provider_session_id: - description: "IdentityProviderSessionID is the session ID of the end-user\ - \ that authenticated.\nIf specified, we will use this value to propagate\ - \ the logout." + description: |- + IdentityProviderSessionID is the session ID of the end-user that authenticated. + If specified, we will use this value to propagate the logout. type: string remember: - description: "Remember, if set to true, tells ORY Hydra to remember this\ - \ user by telling the user agent (browser) to store\na cookie with authentication\ - \ data. If the same user performs another OAuth 2.0 Authorization Request,\ - \ he/she\nwill not be asked to log in again." + description: |- + Remember, if set to true, tells ORY Hydra to remember this user by telling the user agent (browser) to store + a cookie with authentication data. If the same user performs another OAuth 2.0 Authorization Request, he/she + will not be asked to log in again. type: boolean remember_for: - description: "RememberFor sets how long the authentication should be remembered\ - \ for in seconds. If set to `0`, the\nauthorization will be remembered\ - \ for the duration of the browser session (using a session cookie)." + description: |- + RememberFor sets how long the authentication should be remembered for in seconds. If set to `0`, the + authorization will be remembered for the duration of the browser session (using a session cookie). format: int64 type: integer subject: @@ -2017,8 +2049,10 @@ components: description: Create JSON Web Key Set Request Body properties: alg: - description: "JSON Web Key Algorithm\n\nThe algorithm to be used for creating\ - \ the key. Supports `RS256`, `ES256`, `ES512`, `HS512`, and `HS256`." + description: |- + JSON Web Key Algorithm + + The algorithm to be used for creating the key. Supports `RS256`, `ES256`, `ES512`, `HS512`, and `HS256`. type: string kid: description: |- @@ -2187,8 +2221,9 @@ components: type: string type: object introspectedOAuth2Token: - description: "Introspection contains an access token's session data as specified\ - \ by\n[IETF RFC 7662](https://tools.ietf.org/html/rfc7662)" + description: |- + Introspection contains an access token's session data as specified by + [IETF RFC 7662](https://tools.ietf.org/html/rfc7662) example: ext: key: "" @@ -2209,14 +2244,16 @@ components: username: username properties: active: - description: "Active is a boolean indicator of whether or not the presented\ - \ token\nis currently active. The specifics of a token's \"active\" state\n\ - will vary depending on the implementation of the authorization\nserver\ - \ and the information it keeps about its tokens, but a \"true\"\nvalue\ - \ return for the \"active\" property will generally indicate\nthat a given\ - \ token has been issued by this authorization server,\nhas not been revoked\ - \ by the resource owner, and is within its\ngiven time window of validity\ - \ (e.g., after its issuance time and\nbefore its expiration time)." + description: |- + Active is a boolean indicator of whether or not the presented token + is currently active. The specifics of a token's "active" state + will vary depending on the implementation of the authorization + server and the information it keeps about its tokens, but a "true" + value return for the "active" property will generally indicate + that a given token has been issued by this authorization server, + has not been revoked by the resource owner, and is within its + given time window of validity (e.g., after its issuance time and + before its expiration time). type: boolean aud: description: Audience contains a list of the token's intended audiences. @@ -2229,9 +2266,9 @@ components: requested this token. type: string exp: - description: "Expires at is an integer timestamp, measured in the number\ - \ of seconds\nsince January 1 1970 UTC, indicating when this token will\ - \ expire." + description: |- + Expires at is an integer timestamp, measured in the number of seconds + since January 1 1970 UTC, indicating when this token will expire. format: int64 type: integer ext: @@ -2239,18 +2276,20 @@ components: description: Extra is arbitrary data set by the session. type: object iat: - description: "Issued at is an integer timestamp, measured in the number\ - \ of seconds\nsince January 1 1970 UTC, indicating when this token was\n\ - originally issued." + description: |- + Issued at is an integer timestamp, measured in the number of seconds + since January 1 1970 UTC, indicating when this token was + originally issued. format: int64 type: integer iss: description: IssuerURL is a string representing the issuer of this token type: string nbf: - description: "NotBefore is an integer timestamp, measured in the number\ - \ of seconds\nsince January 1 1970 UTC, indicating when this token is\ - \ not to be\nused before." + description: |- + NotBefore is an integer timestamp, measured in the number of seconds + since January 1 1970 UTC, indicating when this token is not to be + used before. format: int64 type: integer obfuscated_subject: @@ -2264,9 +2303,10 @@ components: scopes associated with this token. type: string sub: - description: "Subject of the token, as defined in JWT [RFC7519].\nUsually\ - \ a machine-readable identifier of the resource owner who\nauthorized\ - \ this token." + description: |- + Subject of the token, as defined in JWT [RFC7519]. + Usually a machine-readable identifier of the resource owner who + authorized this token. type: string token_type: description: "TokenType is the introspected token's type, typically `Bearer`." @@ -2287,8 +2327,10 @@ components: description: A JSONPatch document as defined by RFC 6902 properties: from: - description: "This field is used together with operation \"move\" and uses\ - \ JSON Pointer notation.\n\nLearn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5)." + description: |- + This field is used together with operation "move" and uses JSON Pointer notation. + + Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5). example: /name type: string op: @@ -2297,13 +2339,17 @@ components: example: replace type: string path: - description: "The path to the target path. Uses JSON pointer notation.\n\ - \nLearn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5)." + description: |- + The path to the target path. Uses JSON pointer notation. + + Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5). example: /name type: string value: - description: "The value to be used within the operations.\n\nLearn more\ - \ [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5)." + description: |- + The value to be used within the operations. + + Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5). example: foobar required: - op @@ -2337,11 +2383,12 @@ components: alg: RS256 properties: alg: - description: "The \"alg\" (algorithm) parameter identifies the algorithm\ - \ intended for\nuse with the key. The values used should either be registered\ - \ in the\nIANA \"JSON Web Signature and Encryption Algorithms\" registry\n\ - established by [JWA] or be a value that contains a Collision-\nResistant\ - \ Name." + description: |- + The "alg" (algorithm) parameter identifies the algorithm intended for + use with the key. The values used should either be registered in the + IANA "JSON Web Signature and Encryption Algorithms" registry + established by [JWA] or be a value that contains a Collision- + Resistant Name. example: RS256 type: string crv: @@ -2363,23 +2410,25 @@ components: example: GawgguFyGrWKav7AX4VKUg type: string kid: - description: "The \"kid\" (key ID) parameter is used to match a specific\ - \ key. This\nis used, for instance, to choose among a set of keys within\ - \ a JWK Set\nduring key rollover. The structure of the \"kid\" value\ - \ is\nunspecified. When \"kid\" values are used within a JWK Set, different\n\ - keys within the JWK Set SHOULD use distinct \"kid\" values. (One\nexample\ - \ in which different keys might use the same \"kid\" value is if\nthey\ - \ have different \"kty\" (key type) values but are considered to be\n\ - equivalent alternatives by the application using them.) The \"kid\"\n\ - value is a case-sensitive string." + description: |- + The "kid" (key ID) parameter is used to match a specific key. This + is used, for instance, to choose among a set of keys within a JWK Set + during key rollover. The structure of the "kid" value is + unspecified. When "kid" values are used within a JWK Set, different + keys within the JWK Set SHOULD use distinct "kid" values. (One + example in which different keys might use the same "kid" value is if + they have different "kty" (key type) values but are considered to be + equivalent alternatives by the application using them.) The "kid" + value is a case-sensitive string. example: 1603dfe0af8f4596 type: string kty: - description: "The \"kty\" (key type) parameter identifies the cryptographic\ - \ algorithm\nfamily used with the key, such as \"RSA\" or \"EC\". \"kty\"\ - \ values should\neither be registered in the IANA \"JSON Web Key Types\"\ - \ registry\nestablished by [JWA] or be a value that contains a Collision-\n\ - Resistant Name. The \"kty\" value is a case-sensitive string." + description: |- + The "kty" (key type) parameter identifies the cryptographic algorithm + family used with the key, such as "RSA" or "EC". "kty" values should + either be registered in the IANA "JSON Web Key Types" registry + established by [JWA] or be a value that contains a Collision- + Resistant Name. The "kty" value is a case-sensitive string. example: RSA type: string "n": @@ -2406,12 +2455,14 @@ components: example: f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU type: string x5c: - description: "The \"x5c\" (X.509 certificate chain) parameter contains a\ - \ chain of one\nor more PKIX certificates [RFC5280]. The certificate\ - \ chain is\nrepresented as a JSON array of certificate value strings.\ - \ Each\nstring in the array is a base64-encoded (Section 4 of [RFC4648]\ - \ --\nnot base64url-encoded) DER [ITU.X690.1994] PKIX certificate value.\n\ - The PKIX certificate containing the key value MUST be the first\ncertificate." + description: |- + The "x5c" (X.509 certificate chain) parameter contains a chain of one + or more PKIX certificates [RFC5280]. The certificate chain is + represented as a JSON array of certificate value strings. Each + string in the array is a base64-encoded (Section 4 of [RFC4648] -- + not base64url-encoded) DER [ITU.X690.1994] PKIX certificate value. + The PKIX certificate containing the key value MUST be the first + certificate. items: type: string type: array @@ -2468,11 +2519,14 @@ components: alg: RS256 properties: keys: - description: "List of JSON Web Keys\n\nThe value of the \"keys\" parameter\ - \ is an array of JSON Web Key (JWK)\nvalues. By default, the order of\ - \ the JWK values within the array does\nnot imply an order of preference\ - \ among them, although applications\nof JWK Sets can choose to assign\ - \ a meaning to the order for their\npurposes, if desired." + description: |- + List of JSON Web Keys + + The value of the "keys" parameter is an array of JSON Web Key (JWK) + values. By default, the order of the JWK values within the array does + not imply an order of preference among them, although applications + of JWK Sets can choose to assign a meaning to the order for their + purposes, if desired. items: $ref: '#/components/schemas/jsonWebKey' type: array @@ -2489,9 +2543,9 @@ components: title: NullTime implements sql.NullTime functionality. type: string oAuth2Client: - description: "OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect\ - \ flows. Usually, OAuth 2.0 clients are\ngenerated for applications which\ - \ want to consume your OAuth 2.0 or OpenID Connect capabilities." + description: |- + 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. example: metadata: "" token_endpoint_auth_signing_alg: token_endpoint_auth_signing_alg @@ -2542,6 +2596,7 @@ components: sector_identifier_uri: sector_identifier_uri frontchannel_logout_session_required: true frontchannel_logout_uri: frontchannel_logout_uri + skip_logout_consent: true refresh_token_grant_id_token_lifespan: refresh_token_grant_id_token_lifespan implicit_grant_id_token_lifespan: implicit_grant_id_token_lifespan client_secret_expires_at: 0 @@ -2558,10 +2613,12 @@ components: - response_types properties: access_token_strategy: - description: "OAuth 2.0 Access Token Strategy\n\nAccessTokenStrategy is\ - \ the strategy used to generate access tokens.\nValid options are `jwt`\ - \ and `opaque`. `jwt` is a bad idea, see https://www.ory.sh/docs/hydra/advanced#json-web-tokens\n\ - Setting the stragegy here overrides the global setting in `strategies.access_token`." + description: |- + OAuth 2.0 Access Token Strategy + + AccessTokenStrategy is the strategy used to generate access tokens. + Valid options are `jwt` and `opaque`. `jwt` is a bad idea, see https://www.ory.sh/docs/hydra/advanced#json-web-tokens + Setting the stragegy here overrides the global setting in `strategies.access_token`. type: string allowed_cors_origins: items: @@ -2594,11 +2651,12 @@ components: title: Time duration type: string backchannel_logout_session_required: - description: "OpenID Connect Back-Channel Logout Session Required\n\nBoolean\ - \ value specifying whether the RP requires that a sid (session ID) Claim\ - \ be included in the Logout\nToken to identify the RP session with the\ - \ OP when the backchannel_logout_uri is used.\nIf omitted, the default\ - \ value is false." + description: |- + OpenID Connect Back-Channel Logout Session Required + + Boolean value specifying whether the RP requires that a sid (session ID) Claim be included in the Logout + Token to identify the RP session with the OP when the backchannel_logout_uri is used. + If omitted, the default value is false. type: boolean backchannel_logout_uri: description: |- @@ -2616,7 +2674,7 @@ components: description: |- OAuth 2.0 Client ID - The ID is autogenerated and immutable. + The ID is immutable. If no ID is provided, a UUID4 will be generated. type: string client_name: description: |- @@ -2626,9 +2684,11 @@ components: end-user during authorization. type: string client_secret: - description: "OAuth 2.0 Client Secret\n\nThe secret will be included in\ - \ the create request as cleartext, and then\nnever again. The secret is\ - \ kept in hashed format and is not recoverable once lost." + description: |- + OAuth 2.0 Client Secret + + The secret will be included in the create request as cleartext, and then + never again. The secret is kept in hashed format and is not recoverable once lost. type: string client_secret_expires_at: description: |- @@ -2638,9 +2698,12 @@ components: format: int64 type: integer client_uri: - description: "OAuth 2.0 Client URI\n\nClientURI is a URL string of a web\ - \ page providing information about the client.\nIf present, the server\ - \ SHOULD display this URL to the end-user in\na clickable fashion." + description: |- + OAuth 2.0 Client URI + + ClientURI is a URL string of a web page providing information about the client. + If present, the server SHOULD display this URL to the end-user in + a clickable fashion. type: string contacts: items: @@ -2656,19 +2719,21 @@ components: format: date-time type: string frontchannel_logout_session_required: - description: "OpenID Connect Front-Channel Logout Session Required\n\nBoolean\ - \ value specifying whether the RP requires that iss (issuer) and sid (session\ - \ ID) query parameters be\nincluded to identify the RP session with the\ - \ OP when the frontchannel_logout_uri is used.\nIf omitted, the default\ - \ value is false." + description: |- + OpenID Connect Front-Channel Logout Session Required + + Boolean value specifying whether the RP requires that iss (issuer) and sid (session ID) query parameters be + included to identify the RP session with the OP when the frontchannel_logout_uri is used. + If omitted, the default value is false. type: boolean frontchannel_logout_uri: - description: "OpenID Connect Front-Channel Logout URI\n\nRP URL that will\ - \ cause the RP to log itself out when rendered in an iframe by the OP.\ - \ An iss (issuer) query\nparameter and a sid (session ID) query parameter\ - \ MAY be included by the OP to enable the RP to validate the\nrequest\ - \ and to determine which of the potentially multiple sessions is to be\ - \ logged out; if either is\nincluded, both MUST be." + description: |- + OpenID Connect Front-Channel Logout URI + + RP URL that will cause the RP to log itself out when rendered in an iframe by the OP. An iss (issuer) query + parameter and a sid (session ID) query parameter MAY be included by the OP to enable the RP to validate the + request and to determine which of the potentially multiple sessions is to be logged out; if either is + included, both MUST be. type: string grant_types: items: @@ -2689,31 +2754,28 @@ components: title: Time duration type: string jwks: - description: "OAuth 2.0 Client JSON Web Key Set\n\nClient's JSON Web Key\ - \ Set [JWK] document, passed by value. The semantics of the jwks parameter\ - \ are the same as\nthe jwks_uri parameter, other than that the JWK Set\ - \ is passed by value, rather than by reference. This parameter\nis intended\ - \ only to be used by Clients that, for some reason, are unable to use\ - \ the jwks_uri parameter, for\ninstance, by native applications that might\ - \ not have a location to host the contents of the JWK Set. If a Client\n\ - can use jwks_uri, it MUST NOT use jwks. One significant downside of jwks\ - \ is that it does not enable key rotation\n(which jwks_uri does, as described\ - \ in Section 10 of OpenID Connect Core 1.0 [OpenID.Core]). The jwks_uri\ - \ and jwks\nparameters MUST NOT be used together." + description: |- + OAuth 2.0 Client JSON Web Key Set + + Client's JSON Web Key Set [JWK] document, passed by value. The semantics of the jwks parameter are the same as + the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter + is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for + instance, by native applications that might not have a location to host the contents of the JWK Set. If a Client + can use jwks_uri, it MUST NOT use jwks. One significant downside of jwks is that it does not enable key rotation + (which jwks_uri does, as described in Section 10 of OpenID Connect Core 1.0 [OpenID.Core]). The jwks_uri and jwks + parameters MUST NOT be used together. jwks_uri: - description: "OAuth 2.0 Client JSON Web Key Set URL\n\nURL for the Client's\ - \ JSON Web Key Set [JWK] document. If the Client signs requests to the\ - \ Server, it contains\nthe signing key(s) the Server uses to validate\ - \ signatures from the Client. The JWK Set MAY also contain the\nClient's\ - \ encryption keys(s), which are used by the Server to encrypt responses\ - \ to the Client. When both signing\nand encryption keys are made available,\ - \ a use (Key Use) parameter value is REQUIRED for all keys in the referenced\n\ - JWK Set to indicate each key's intended usage. Although some algorithms\ - \ allow the same key to be used for both\nsignatures and encryption, doing\ - \ so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY\ - \ be used\nto provide X.509 representations of keys provided. When used,\ - \ the bare key values MUST still be present and MUST\nmatch those in the\ - \ certificate." + description: |- + OAuth 2.0 Client JSON Web Key Set URL + + URL for the Client's JSON Web Key Set [JWK] document. If the Client signs requests to the Server, it contains + the signing key(s) the Server uses to validate signatures from the Client. The JWK Set MAY also contain the + Client's encryption keys(s), which are used by the Server to encrypt responses to the Client. When both signing + and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced + JWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both + signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used + to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST + match those in the certificate. type: string jwt_bearer_grant_access_token_lifespan: description: "Specify a time duration in milliseconds, seconds, minutes,\ @@ -2737,10 +2799,12 @@ components: Owner is a string identifying the owner of the OAuth 2.0 Client. type: string policy_uri: - description: "OAuth 2.0 Client Policy URI\n\nPolicyURI is a URL string that\ - \ points to a human-readable privacy policy document\nthat describes how\ - \ the deployment organization collects, uses,\nretains, and discloses\ - \ personal data." + description: |- + OAuth 2.0 Client Policy URI + + PolicyURI is a URL string that points to a human-readable privacy policy document + that describes how the deployment organization collects, uses, + retains, and discloses personal data. type: string post_logout_redirect_uris: items: @@ -2773,19 +2837,24 @@ components: title: Time duration type: string registration_access_token: - description: "OpenID Connect Dynamic Client Registration Access Token\n\n\ - RegistrationAccessToken can be used to update, get, or delete the OAuth2\ - \ Client. It is sent when creating a client\nusing Dynamic Client Registration." + description: |- + OpenID Connect Dynamic Client Registration Access Token + + RegistrationAccessToken can be used to update, get, or delete the OAuth2 Client. It is sent when creating a client + using Dynamic Client Registration. type: string registration_client_uri: - description: "OpenID Connect Dynamic Client Registration URL\n\nRegistrationClientURI\ - \ is the URL used to update, get, or delete the OAuth2 Client." + description: |- + OpenID Connect Dynamic Client Registration URL + + RegistrationClientURI is the URL used to update, get, or delete the OAuth2 Client. type: string request_object_signing_alg: - description: "OpenID Connect Request Object Signing Algorithm\n\nJWS [JWS]\ - \ alg algorithm [JWA] that MUST be used for signing Request Objects sent\ - \ to the OP. All Request Objects\nfrom this Client MUST be rejected, if\ - \ not signed with this algorithm." + description: |- + OpenID Connect Request Object Signing Algorithm + + JWS [JWS] alg algorithm [JWA] that MUST be used for signing Request Objects sent to the OP. All Request Objects + from this Client MUST be rejected, if not signed with this algorithm. type: string request_uris: items: @@ -2800,9 +2869,12 @@ components: \ JSON for SQL storage." type: array scope: - description: "OAuth 2.0 Client Scope\n\nScope is a string containing a space-separated\ - \ list of scope values (as\ndescribed in Section 3.3 of OAuth 2.0 [RFC6749])\ - \ that the client\ncan use when requesting access tokens." + description: |- + OAuth 2.0 Client Scope + + Scope is a string containing a space-separated list of scope values (as + described in Section 3.3 of OAuth 2.0 [RFC6749]) that the client + can use when requesting access tokens. example: scope1 scope-2 scope.3 scope:4 type: string sector_identifier_uri: @@ -2817,6 +2889,11 @@ components: SkipConsent skips the consent screen for this client. This field can only be set from the admin API. type: boolean + skip_logout_consent: + description: |- + SkipLogoutConsent skips the logout consent screen for this client. This field can only + be set from the admin API. + type: boolean subject_type: description: |- OpenID Connect Subject Type @@ -2826,14 +2903,15 @@ components: type: string token_endpoint_auth_method: default: client_secret_basic - description: "OAuth 2.0 Token Endpoint Authentication Method\n\nRequested\ - \ Client Authentication method for the Token Endpoint. The options are:\n\ - \n`client_secret_basic`: (default) Send `client_id` and `client_secret`\ - \ as `application/x-www-form-urlencoded` encoded in the HTTP Authorization\ - \ header.\n`client_secret_post`: Send `client_id` and `client_secret`\ - \ as `application/x-www-form-urlencoded` in the HTTP body.\n`private_key_jwt`:\ - \ Use JSON Web Tokens to authenticate the client.\n`none`: Used for public\ - \ clients (native apps, mobile apps) which can not have secrets." + description: |- + OAuth 2.0 Token Endpoint Authentication Method + + Requested Client Authentication method for the Token Endpoint. The options are: + + `client_secret_basic`: (default) Send `client_id` and `client_secret` as `application/x-www-form-urlencoded` encoded in the HTTP Authorization header. + `client_secret_post`: Send `client_id` and `client_secret` as `application/x-www-form-urlencoded` in the HTTP body. + `private_key_jwt`: Use JSON Web Tokens to authenticate the client. + `none`: Used for public clients (native apps, mobile apps) which can not have secrets. type: string token_endpoint_auth_signing_alg: description: |- @@ -2858,12 +2936,12 @@ components: format: date-time type: string userinfo_signed_response_alg: - description: "OpenID Connect Request Userinfo Signed Response Algorithm\n\ - \nJWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses. If\ - \ this is specified, the response will be JWT\n[JWT] serialized, and signed\ - \ using JWS. The default, if omitted, is for the UserInfo Response to\ - \ return the Claims\nas a UTF-8 encoded JSON object using the application/json\ - \ content-type." + description: |- + OpenID Connect Request Userinfo Signed Response Algorithm + + JWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses. If this is specified, the response will be JWT + [JWT] serialized, and signed using JWS. The default, if omitted, is for the UserInfo Response to return the Claims + as a UTF-8 encoded JSON object using the application/json content-type. type: string title: OAuth 2.0 Client type: object @@ -3008,6 +3086,7 @@ components: sector_identifier_uri: sector_identifier_uri frontchannel_logout_session_required: true frontchannel_logout_uri: frontchannel_logout_uri + skip_logout_consent: true refresh_token_grant_id_token_lifespan: refresh_token_grant_id_token_lifespan implicit_grant_id_token_lifespan: implicit_grant_id_token_lifespan client_secret_expires_at: 0 @@ -3028,9 +3107,9 @@ components: - requested_scope properties: acr: - description: "ACR represents the Authentication AuthorizationContext Class\ - \ Reference value for this authentication session. You can use it\nto\ - \ express that, for example, a user authenticated using two factor authentication." + description: |- + ACR represents the Authentication AuthorizationContext Class Reference value for this authentication session. You can use it + to express that, for example, a user authenticated using two factor authentication. type: string amr: items: @@ -3063,11 +3142,10 @@ components: oidc_context: $ref: '#/components/schemas/oAuth2ConsentRequestOpenIDConnectContext' request_url: - description: "RequestURL is the original OAuth 2.0 Authorization URL requested\ - \ by the OAuth 2.0 client. It is the URL which\ninitiates the OAuth 2.0\ - \ Authorization Code or OAuth 2.0 Implicit flow. This URL is typically\ - \ not needed, but\nmight come in handy if you want to deal with additional\ - \ request parameters." + description: |- + RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It is the URL which + initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but + might come in handy if you want to deal with additional request parameters. type: string requested_access_token_audience: items: @@ -3082,15 +3160,15 @@ components: \ JSON for SQL storage." type: array skip: - description: "Skip, if true, implies that the client has requested the same\ - \ scopes from the same user previously.\nIf true, you must not ask the\ - \ user to grant the requested scopes. You must however either allow or\ - \ deny the\nconsent request using the usual API call." + description: |- + Skip, if true, implies that the client has requested the same scopes from the same user previously. + If true, you must not ask the user to grant the requested scopes. You must however either allow or deny the + consent request using the usual API call. type: boolean subject: - description: "Subject is the user ID of the end-user that authenticated.\ - \ Now, that end user needs to grant or deny the scope\nrequested by the\ - \ OAuth 2.0 client." + description: |- + Subject is the user ID of the end-user that authenticated. Now, that end user needs to grant or deny the scope + requested by the OAuth 2.0 client. type: string required: - challenge @@ -3110,36 +3188,29 @@ components: display: display properties: acr_values: - description: "ACRValues is the Authentication AuthorizationContext Class\ - \ Reference requested in the OAuth 2.0 Authorization request.\nIt is a\ - \ parameter defined by OpenID Connect and expresses which level of authentication\ - \ (e.g. 2FA) is required.\n\nOpenID Connect defines it as follows:\n>\ - \ Requested Authentication AuthorizationContext Class Reference values.\ - \ Space-separated string that specifies the acr values\nthat the Authorization\ - \ Server is being requested to use for processing this Authentication\ - \ Request, with the\nvalues appearing in order of preference. The Authentication\ - \ AuthorizationContext Class satisfied by the authentication\nperformed\ - \ is returned as the acr Claim Value, as specified in Section 2. The acr\ - \ Claim is requested as a\nVoluntary Claim by this parameter." + description: |- + ACRValues is the Authentication AuthorizationContext Class Reference requested in the OAuth 2.0 Authorization request. + It is a parameter defined by OpenID Connect and expresses which level of authentication (e.g. 2FA) is required. + + OpenID Connect defines it as follows: + > Requested Authentication AuthorizationContext Class Reference values. Space-separated string that specifies the acr values + that the Authorization Server is being requested to use for processing this Authentication Request, with the + values appearing in order of preference. The Authentication AuthorizationContext Class satisfied by the authentication + performed is returned as the acr Claim Value, as specified in Section 2. The acr Claim is requested as a + Voluntary Claim by this parameter. items: type: string type: array display: - description: "Display is a string value that specifies how the Authorization\ - \ Server displays the authentication and consent user interface pages\ - \ to the End-User.\nThe defined values are:\npage: The Authorization Server\ - \ SHOULD display the authentication and consent UI consistent with a full\ - \ User Agent page view. If the display parameter is not specified, this\ - \ is the default display mode.\npopup: The Authorization Server SHOULD\ - \ display the authentication and consent UI consistent with a popup User\ - \ Agent window. The popup User Agent window should be of an appropriate\ - \ size for a login-focused dialog and should not obscure the entire window\ - \ that it is popping up over.\ntouch: The Authorization Server SHOULD\ - \ display the authentication and consent UI consistent with a device that\ - \ leverages a touch interface.\nwap: The Authorization Server SHOULD display\ - \ the authentication and consent UI consistent with a \"feature phone\"\ - \ type display.\n\nThe Authorization Server MAY also attempt to detect\ - \ the capabilities of the User Agent and present an appropriate display." + description: |- + Display is a string value that specifies how the Authorization Server displays the authentication and consent user interface pages to the End-User. + The defined values are: + page: The Authorization Server SHOULD display the authentication and consent UI consistent with a full User Agent page view. If the display parameter is not specified, this is the default display mode. + popup: The Authorization Server SHOULD display the authentication and consent UI consistent with a popup User Agent window. The popup User Agent window should be of an appropriate size for a login-focused dialog and should not obscure the entire window that it is popping up over. + touch: The Authorization Server SHOULD display the authentication and consent UI consistent with a device that leverages a touch interface. + wap: The Authorization Server SHOULD display the authentication and consent UI consistent with a "feature phone" type display. + + The Authorization Server MAY also attempt to detect the capabilities of the User Agent and present an appropriate display. type: string id_token_hint_claims: additionalProperties: {} @@ -3155,14 +3226,12 @@ components: phone number in the format specified for the phone_number Claim. The use of this parameter is optional. type: string ui_locales: - description: "UILocales is the End-User'id preferred languages and scripts\ - \ for the user interface, represented as a\nspace-separated list of BCP47\ - \ [RFC5646] language tag values, ordered by preference. For instance,\ - \ the value\n\"fr-CA fr en\" represents a preference for French as spoken\ - \ in Canada, then French (without a region designation),\nfollowed by\ - \ English (without a region designation). An error SHOULD NOT result if\ - \ some or all of the requested\nlocales are not supported by the OpenID\ - \ Provider." + description: |- + UILocales is the End-User'id preferred languages and scripts for the user interface, represented as a + space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value + "fr-CA fr en" represents a preference for French as spoken in Canada, then French (without a region designation), + followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested + locales are not supported by the OpenID Provider. items: type: string type: array @@ -3247,6 +3316,7 @@ components: sector_identifier_uri: sector_identifier_uri frontchannel_logout_session_required: true frontchannel_logout_uri: frontchannel_logout_uri + skip_logout_consent: true refresh_token_grant_id_token_lifespan: refresh_token_grant_id_token_lifespan implicit_grant_id_token_lifespan: implicit_grant_id_token_lifespan client_secret_expires_at: 0 @@ -3274,6 +3344,7 @@ components: session: access_token: "" id_token: "" + context: "" grant_access_token_audience: - grant_access_token_audience - grant_access_token_audience @@ -3285,6 +3356,9 @@ components: properties: consent_request: $ref: '#/components/schemas/oAuth2ConsentRequest' + context: + title: "JSONRawMessage represents a json.RawMessage that works well with\ + \ JSON, SQL, and Swagger." expires_at: $ref: '#/components/schemas/oAuth2ConsentSession_expires_at' grant_access_token_audience: @@ -3304,14 +3378,18 @@ components: title: NullTime implements sql.NullTime functionality. type: string remember: - description: "Remember Consent\n\nRemember, if set to true, tells ORY Hydra\ - \ to remember this consent authorization and reuse it if the same\nclient\ - \ asks the same user for the same, or a subset of, scope." + description: |- + Remember Consent + + Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same + client asks the same user for the same, or a subset of, scope. type: boolean remember_for: - description: "Remember Consent For\n\nRememberFor sets how long the consent\ - \ authorization should be remembered for in seconds. If set to `0`, the\n\ - authorization will be remembered indefinitely." + description: |- + Remember Consent For + + RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the + authorization will be remembered indefinitely. format: int64 type: integer session: @@ -3391,6 +3469,7 @@ components: sector_identifier_uri: sector_identifier_uri frontchannel_logout_session_required: true frontchannel_logout_uri: frontchannel_logout_uri + skip_logout_consent: true refresh_token_grant_id_token_lifespan: refresh_token_grant_id_token_lifespan implicit_grant_id_token_lifespan: implicit_grant_id_token_lifespan client_secret_expires_at: 0 @@ -3422,11 +3501,10 @@ components: oidc_context: $ref: '#/components/schemas/oAuth2ConsentRequestOpenIDConnectContext' request_url: - description: "RequestURL is the original OAuth 2.0 Authorization URL requested\ - \ by the OAuth 2.0 client. It is the URL which\ninitiates the OAuth 2.0\ - \ Authorization Code or OAuth 2.0 Implicit flow. This URL is typically\ - \ not needed, but\nmight come in handy if you want to deal with additional\ - \ request parameters." + description: |- + RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It is the URL which + initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but + might come in handy if you want to deal with additional request parameters. type: string requested_access_token_audience: items: @@ -3448,25 +3526,22 @@ components: channel logout. It's value can generally be used to associate consecutive login requests by a certain user. type: string skip: - description: "Skip, if true, implies that the client has requested the same\ - \ scopes from the same user previously.\nIf true, you can skip asking\ - \ the user to grant the requested scopes, and simply forward the user\ - \ to the redirect URL.\n\nThis feature allows you to update / set session\ - \ information." + description: |- + Skip, if true, implies that the client has requested the same scopes from the same user previously. + If true, you can skip asking the user to grant the requested scopes, and simply forward the user to the redirect URL. + + This feature allows you to update / set session information. type: boolean subject: - description: "Subject is the user ID of the end-user that authenticated.\ - \ Now, that end user needs to grant or deny the scope\nrequested by the\ - \ OAuth 2.0 client. If this value is set and `skip` is true, you MUST\ - \ include this subject type\nwhen accepting the login request, or the\ - \ request will fail." + description: |- + Subject is the user ID of the end-user that authenticated. Now, that end user needs to grant or deny the scope + requested by the OAuth 2.0 client. If this value is set and `skip` is true, you MUST include this subject type + when accepting the login request, or the request will fail. type: string required: - challenge - client - request_url - - requested_access_token_audience - - requested_scope - skip - subject title: Contains information on an ongoing login request. @@ -3525,6 +3600,7 @@ components: sector_identifier_uri: sector_identifier_uri frontchannel_logout_session_required: true frontchannel_logout_uri: frontchannel_logout_uri + skip_logout_consent: true refresh_token_grant_id_token_lifespan: refresh_token_grant_id_token_lifespan implicit_grant_id_token_lifespan: implicit_grant_id_token_lifespan client_secret_expires_at: 0 @@ -3586,7 +3662,7 @@ components: access_token: access_token refresh_token: refresh_token scope: scope - id_token: 6 + id_token: id_token token_type: token_type expires_in: 0 properties: @@ -3594,19 +3670,19 @@ components: description: The access token issued by the authorization server. type: string expires_in: - description: "The lifetime in seconds of the access token. For\nexample,\ - \ the value \"3600\" denotes that the access token will\nexpire in one\ - \ hour from the time the response was generated." + description: |- + The lifetime in seconds of the access token. For + example, the value "3600" denotes that the access token will + expire in one hour from the time the response was generated. format: int64 type: integer id_token: description: To retrieve a refresh token request the id_token scope. - format: int64 - type: integer + type: string refresh_token: - description: "The refresh token, which can be used to obtain new\naccess\ - \ tokens. To retrieve it add the scope \"offline\" to your access token\ - \ request." + description: |- + The refresh token, which can be used to obtain new + access tokens. To retrieve it add the scope "offline" to your access token request. type: string scope: description: The scope of the access token @@ -3703,33 +3779,39 @@ components: example: https://playground.ory.sh/ory-hydra/public/oauth2/auth type: string backchannel_logout_session_supported: - description: "OpenID Connect Back-Channel Logout Session Required\n\nBoolean\ - \ value specifying whether the OP can pass a sid (session ID) Claim in\ - \ the Logout Token to identify the RP\nsession with the OP. If supported,\ - \ the sid Claim is also included in ID Tokens issued by the OP" + description: |- + OpenID Connect Back-Channel Logout Session Required + + Boolean value specifying whether the OP can pass a sid (session ID) Claim in the Logout Token to identify the RP + session with the OP. If supported, the sid Claim is also included in ID Tokens issued by the OP type: boolean backchannel_logout_supported: - description: "OpenID Connect Back-Channel Logout Supported\n\nBoolean value\ - \ specifying whether the OP supports back-channel logout, with true indicating\ - \ support." + description: |- + OpenID Connect Back-Channel Logout Supported + + Boolean value specifying whether the OP supports back-channel logout, with true indicating support. type: boolean claims_parameter_supported: - description: "OpenID Connect Claims Parameter Parameter Supported\n\nBoolean\ - \ value specifying whether the OP supports use of the claims parameter,\ - \ with true indicating support." + description: |- + OpenID Connect Claims Parameter Parameter Supported + + Boolean value specifying whether the OP supports use of the claims parameter, with true indicating support. type: boolean claims_supported: - description: "OpenID Connect Supported Claims\n\nJSON array containing a\ - \ list of the Claim Names of the Claims that the OpenID Provider MAY be\ - \ able to supply\nvalues for. Note that for privacy or other reasons,\ - \ this might not be an exhaustive list." + description: |- + OpenID Connect Supported Claims + + JSON array containing a list of the Claim Names of the Claims that the OpenID Provider MAY be able to supply + values for. Note that for privacy or other reasons, this might not be an exhaustive list. items: type: string type: array code_challenge_methods_supported: - description: "OAuth 2.0 PKCE Supported Code Challenge Methods\n\nJSON array\ - \ containing a list of Proof Key for Code Exchange (PKCE) [RFC7636] code\ - \ challenge methods supported\nby this authorization server." + description: |- + OAuth 2.0 PKCE Supported Code Challenge Methods + + JSON array containing a list of Proof Key for Code Exchange (PKCE) [RFC7636] code challenge methods supported + by this authorization server. items: type: string type: array @@ -3754,16 +3836,18 @@ components: URL at the OP to which an RP can perform a redirect to request that the End-User be logged out at the OP. type: string frontchannel_logout_session_supported: - description: "OpenID Connect Front-Channel Logout Session Required\n\nBoolean\ - \ value specifying whether the OP can pass iss (issuer) and sid (session\ - \ ID) query parameters to identify\nthe RP session with the OP when the\ - \ frontchannel_logout_uri is used. If supported, the sid Claim is also\n\ - included in ID Tokens issued by the OP." + description: |- + OpenID Connect Front-Channel Logout Session Required + + Boolean value specifying whether the OP can pass iss (issuer) and sid (session ID) query parameters to identify + the RP session with the OP when the frontchannel_logout_uri is used. If supported, the sid Claim is also + included in ID Tokens issued by the OP. type: boolean frontchannel_logout_supported: - description: "OpenID Connect Front-Channel Logout Supported\n\nBoolean value\ - \ specifying whether the OP supports HTTP-based logout, with true indicating\ - \ support." + description: |- + OpenID Connect Front-Channel Logout Supported + + Boolean value specifying whether the OP supports HTTP-based logout, with true indicating support. type: boolean grant_types_supported: description: |- @@ -3791,26 +3875,25 @@ components: type: string type: array issuer: - description: "OpenID Connect Issuer URL\n\nAn URL using the https scheme\ - \ with no query or fragment component that the OP asserts as its IssuerURL\ - \ Identifier.\nIf IssuerURL discovery is supported , this value MUST be\ - \ identical to the issuer value returned\nby WebFinger. This also MUST\ - \ be identical to the iss Claim value in ID Tokens issued from this IssuerURL." + description: |- + OpenID Connect Issuer URL + + An URL using the https scheme with no query or fragment component that the OP asserts as its IssuerURL Identifier. + If IssuerURL discovery is supported , this value MUST be identical to the issuer value returned + by WebFinger. This also MUST be identical to the iss Claim value in ID Tokens issued from this IssuerURL. example: https://playground.ory.sh/ory-hydra/public/ type: string jwks_uri: - description: "OpenID Connect Well-Known JSON Web Keys URL\n\nURL of the\ - \ OP's JSON Web Key Set [JWK] document. This contains the signing key(s)\ - \ the RP uses to validate\nsignatures from the OP. The JWK Set MAY also\ - \ contain the Server's encryption key(s), which are used by RPs\nto encrypt\ - \ requests to the Server. When both signing and encryption keys are made\ - \ available, a use (Key Use)\nparameter value is REQUIRED for all keys\ - \ in the referenced JWK Set to indicate each key's intended usage.\nAlthough\ - \ some algorithms allow the same key to be used for both signatures and\ - \ encryption, doing so is\nNOT RECOMMENDED, as it is less secure. The\ - \ JWK x5c parameter MAY be used to provide X.509 representations of\n\ - keys provided. When used, the bare key values MUST still be present and\ - \ MUST match those in the certificate." + description: |- + OpenID Connect Well-Known JSON Web Keys URL + + URL of the OP's JSON Web Key Set [JWK] document. This contains the signing key(s) the RP uses to validate + signatures from the OP. The JWK Set MAY also contain the Server's encryption key(s), which are used by RPs + to encrypt requests to the Server. When both signing and encryption keys are made available, a use (Key Use) + parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key's intended usage. + Although some algorithms allow the same key to be used for both signatures and encryption, doing so is + NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of + keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. example: "https://{slug}.projects.oryapis.com/.well-known/jwks.json" type: string registration_endpoint: @@ -3818,25 +3901,27 @@ components: example: https://playground.ory.sh/ory-hydra/admin/client type: string request_object_signing_alg_values_supported: - description: "OpenID Connect Supported Request Object Signing Algorithms\n\ - \nJSON array containing a list of the JWS signing algorithms (alg values)\ - \ supported by the OP for Request Objects,\nwhich are described in Section\ - \ 6.1 of OpenID Connect Core 1.0 [OpenID.Core]. These algorithms are used\ - \ both when\nthe Request Object is passed by value (using the request\ - \ parameter) and when it is passed by reference\n(using the request_uri\ - \ parameter)." + description: |- + OpenID Connect Supported Request Object Signing Algorithms + + JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for Request Objects, + which are described in Section 6.1 of OpenID Connect Core 1.0 [OpenID.Core]. These algorithms are used both when + the Request Object is passed by value (using the request parameter) and when it is passed by reference + (using the request_uri parameter). items: type: string type: array request_parameter_supported: - description: "OpenID Connect Request Parameter Supported\n\nBoolean value\ - \ specifying whether the OP supports use of the request parameter, with\ - \ true indicating support." + description: |- + OpenID Connect Request Parameter Supported + + Boolean value specifying whether the OP supports use of the request parameter, with true indicating support. type: boolean request_uri_parameter_supported: - description: "OpenID Connect Request URI Parameter Supported\n\nBoolean\ - \ value specifying whether the OP supports use of the request_uri parameter,\ - \ with true indicating support." + description: |- + OpenID Connect Request URI Parameter Supported + + Boolean value specifying whether the OP supports use of the request_uri parameter, with true indicating support. type: boolean require_request_uri_registration: description: |- @@ -3854,10 +3939,11 @@ components: type: string type: array response_types_supported: - description: "OAuth 2.0 Supported Response Types\n\nJSON array containing\ - \ a list of the OAuth 2.0 response_type values that this OP supports.\ - \ Dynamic OpenID\nProviders MUST support the code, id_token, and the token\ - \ id_token Response Type values." + description: |- + OAuth 2.0 Supported Response Types + + JSON array containing a list of the OAuth 2.0 response_type values that this OP supports. Dynamic OpenID + Providers MUST support the code, id_token, and the token id_token Response Type values. items: type: string type: array @@ -3868,11 +3954,11 @@ components: URL of the authorization server's OAuth 2.0 revocation endpoint. type: string scopes_supported: - description: "OAuth 2.0 Supported Scope Values\n\nJSON array containing\ - \ a list of the OAuth 2.0 [RFC6749] scope values that this server supports.\ - \ The server MUST\nsupport the openid scope value. Servers MAY choose\ - \ not to advertise some supported scope values even when this parameter\ - \ is used" + description: |- + OAuth 2.0 Supported Scope Values + + JSON array containing a list of the OAuth 2.0 [RFC6749] scope values that this server supports. The server MUST + support the openid scope value. Servers MAY choose not to advertise some supported scope values even when this parameter is used items: type: string type: array @@ -3890,11 +3976,11 @@ components: example: https://playground.ory.sh/ory-hydra/public/oauth2/token type: string token_endpoint_auth_methods_supported: - description: "OAuth 2.0 Supported Client Authentication Methods\n\nJSON\ - \ array containing a list of Client Authentication methods supported by\ - \ this Token Endpoint. The options are\nclient_secret_post, client_secret_basic,\ - \ client_secret_jwt, and private_key_jwt, as described in Section 9 of\ - \ OpenID Connect Core 1.0" + description: |- + OAuth 2.0 Supported Client Authentication Methods + + JSON array containing a list of Client Authentication methods supported by this Token Endpoint. The options are + client_secret_post, client_secret_basic, client_secret_jwt, and private_key_jwt, as described in Section 9 of OpenID Connect Core 1.0 items: type: string type: array @@ -3913,10 +3999,10 @@ components: type: string type: array userinfo_signing_alg_values_supported: - description: "OpenID Connect Supported Userinfo Signing Algorithm\n\nJSON\ - \ array containing a list of the JWS [JWS] signing algorithms (alg values)\ - \ [JWA] supported by the UserInfo Endpoint to encode the Claims in a JWT\ - \ [JWT]." + description: |- + OpenID Connect Supported Userinfo Signing Algorithm + + JSON array containing a list of the JWS [JWS] signing algorithms (alg values) [JWA] supported by the UserInfo Endpoint to encode the Claims in a JWT [JWT]. items: type: string type: array @@ -4074,36 +4160,49 @@ components: properties: page_size: default: 250 - description: "Items per page\n\nThis is the number of items per page to\ - \ return.\nFor details on pagination please head over to the [pagination\ - \ documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + Items per page + + This is the number of items per page to return. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). format: int64 maximum: 1000 minimum: 1 type: integer page_token: default: "1" - description: "Next Page Token\n\nThe next page token.\nFor details on pagination\ - \ please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + Next Page Token + + The next page token. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). minimum: 1 type: string type: object paginationHeaders: properties: link: - description: "The link header contains pagination links.\n\nFor details\ - \ on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).\n\ - \nin: header" + description: |- + The link header contains pagination links. + + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). + + in: header type: string x-total-count: - description: "The total number of clients.\n\nin: header" + description: |- + The total number of clients. + + in: header type: string type: object rejectOAuth2Request: properties: error: - description: "The error should follow the OAuth2 error format (e.g. `invalid_request`,\ - \ `login_required`).\n\nDefaults to `request_denied`." + description: |- + The error should follow the OAuth2 error format (e.g. `invalid_request`, `login_required`). + + Defaults to `request_denied`. type: string error_debug: description: |- @@ -4129,69 +4228,92 @@ components: properties: page_size: default: 250 - description: "Items per page\n\nThis is the number of items per page to\ - \ return.\nFor details on pagination please head over to the [pagination\ - \ documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + Items per page + + This is the number of items per page to return. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). format: int64 maximum: 1000 minimum: 1 type: integer page_token: default: "1" - description: "Next Page Token\n\nThe next page token.\nFor details on pagination\ - \ please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + Next Page Token + + The next page token. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). minimum: 1 type: string type: object tokenPaginationHeaders: properties: link: - description: "The link header contains pagination links.\n\nFor details\ - \ on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).\n\ - \nin: header" + description: |- + The link header contains pagination links. + + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). + + in: header type: string x-total-count: - description: "The total number of clients.\n\nin: header" + description: |- + The total number of clients. + + in: header type: string type: object tokenPaginationRequestParameters: - description: "The `Link` HTTP header contains multiple links (`first`, `next`,\ - \ `last`, `previous`) formatted as:\n`;\ - \ rel=\"{page}\"`\n\nFor details on pagination please head over to the [pagination\ - \ documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + The `Link` HTTP header contains multiple links (`first`, `next`, `last`, `previous`) formatted as: + `; rel="{page}"` + + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). properties: page_size: default: 250 - description: "Items per Page\n\nThis is the number of items per page to\ - \ return.\nFor details on pagination please head over to the [pagination\ - \ documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + Items per Page + + This is the number of items per page to return. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). format: int64 maximum: 500 minimum: 1 type: integer page_token: default: "1" - description: "Next Page Token\n\nThe next page token.\nFor details on pagination\ - \ please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + Next Page Token + + The next page token. + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). minimum: 1 type: string title: Pagination Request Parameters type: object tokenPaginationResponseHeaders: - description: "The `Link` HTTP header contains multiple links (`first`, `next`,\ - \ `last`, `previous`) formatted as:\n`;\ - \ rel=\"{page}\"`\n\nFor details on pagination please head over to the [pagination\ - \ documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination)." + description: |- + The `Link` HTTP header contains multiple links (`first`, `next`, `last`, `previous`) formatted as: + `; rel="{page}"` + + For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). properties: link: - description: "The Link HTTP Header\n\nThe `Link` header contains a comma-delimited\ - \ list of links to the following pages:\n\nfirst: The first page of results.\n\ - next: The next page of results.\nprev: The previous page of results.\n\ - last: The last page of results.\n\nPages are omitted if they do not exist.\ - \ For example, if there is no next page, the `next` link is omitted. Examples:\n\ - \n; rel=\"first\",;\ - \ rel=\"next\",; rel=\"prev\",;\ - \ rel=\"last\"" + description: |- + The Link HTTP Header + + The `Link` header contains a comma-delimited list of links to the following pages: + + first: The first page of results. + next: The next page of results. + prev: The previous page of results. + last: The last page of results. + + Pages are omitted if they do not exist. For example, if there is no next page, the `next` link is omitted. Examples: + + ; rel="first",; rel="next",; rel="prev",; rel="last" type: string x-total-count: description: |- @@ -4362,16 +4484,17 @@ components: introspectOAuth2Token_request: properties: scope: - description: "An optional, space separated list of required scopes. If the\ - \ access token was not granted one of the\nscopes, the result of active\ - \ will be false." + description: |- + An optional, space separated list of required scopes. If the access token was not granted one of the + scopes, the result of active will be false. type: string x-formData-name: scope token: - description: "The string value of the token. For access tokens, this\nis\ - \ the \"access_token\" value returned from the token endpoint\ndefined\ - \ in OAuth 2.0. For refresh tokens, this is the \"refresh_token\"\nvalue\ - \ returned." + description: |- + The string value of the token. For access tokens, this + is the "access_token" value returned from the token endpoint + defined in OAuth 2.0. For refresh tokens, this is the "refresh_token" + value returned. required: - token type: string diff --git a/api_jwk.go b/api_jwk.go index a9c4885..d2b9ce2 100644 --- a/api_jwk.go +++ b/api_jwk.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -14,14 +14,14 @@ package client import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" "strings" ) -type JwkApi interface { +type JwkAPI interface { /* CreateJsonWebKeySet Create JSON Web Key @@ -32,13 +32,13 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set ID - @return JwkApiCreateJsonWebKeySetRequest + @return JwkAPICreateJsonWebKeySetRequest */ - CreateJsonWebKeySet(ctx context.Context, set string) JwkApiCreateJsonWebKeySetRequest + CreateJsonWebKeySet(ctx context.Context, set string) JwkAPICreateJsonWebKeySetRequest // CreateJsonWebKeySetExecute executes the request // @return JsonWebKeySet - CreateJsonWebKeySetExecute(r JwkApiCreateJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) + CreateJsonWebKeySetExecute(r JwkAPICreateJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) /* DeleteJsonWebKey Delete JSON Web Key @@ -53,12 +53,12 @@ and allows storing user-defined keys as well. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set @param kid The JSON Web Key ID (kid) - @return JwkApiDeleteJsonWebKeyRequest + @return JwkAPIDeleteJsonWebKeyRequest */ - DeleteJsonWebKey(ctx context.Context, set string, kid string) JwkApiDeleteJsonWebKeyRequest + DeleteJsonWebKey(ctx context.Context, set string, kid string) JwkAPIDeleteJsonWebKeyRequest // DeleteJsonWebKeyExecute executes the request - DeleteJsonWebKeyExecute(r JwkApiDeleteJsonWebKeyRequest) (*http.Response, error) + DeleteJsonWebKeyExecute(r JwkAPIDeleteJsonWebKeyRequest) (*http.Response, error) /* DeleteJsonWebKeySet Delete JSON Web Key Set @@ -69,12 +69,12 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set - @return JwkApiDeleteJsonWebKeySetRequest + @return JwkAPIDeleteJsonWebKeySetRequest */ - DeleteJsonWebKeySet(ctx context.Context, set string) JwkApiDeleteJsonWebKeySetRequest + DeleteJsonWebKeySet(ctx context.Context, set string) JwkAPIDeleteJsonWebKeySetRequest // DeleteJsonWebKeySetExecute executes the request - DeleteJsonWebKeySetExecute(r JwkApiDeleteJsonWebKeySetRequest) (*http.Response, error) + DeleteJsonWebKeySetExecute(r JwkAPIDeleteJsonWebKeySetRequest) (*http.Response, error) /* GetJsonWebKey Get JSON Web Key @@ -84,13 +84,13 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set JSON Web Key Set ID @param kid JSON Web Key ID - @return JwkApiGetJsonWebKeyRequest + @return JwkAPIGetJsonWebKeyRequest */ - GetJsonWebKey(ctx context.Context, set string, kid string) JwkApiGetJsonWebKeyRequest + GetJsonWebKey(ctx context.Context, set string, kid string) JwkAPIGetJsonWebKeyRequest // GetJsonWebKeyExecute executes the request // @return JsonWebKeySet - GetJsonWebKeyExecute(r JwkApiGetJsonWebKeyRequest) (*JsonWebKeySet, *http.Response, error) + GetJsonWebKeyExecute(r JwkAPIGetJsonWebKeyRequest) (*JsonWebKeySet, *http.Response, error) /* GetJsonWebKeySet Retrieve a JSON Web Key Set @@ -101,13 +101,13 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set JSON Web Key Set ID - @return JwkApiGetJsonWebKeySetRequest + @return JwkAPIGetJsonWebKeySetRequest */ - GetJsonWebKeySet(ctx context.Context, set string) JwkApiGetJsonWebKeySetRequest + GetJsonWebKeySet(ctx context.Context, set string) JwkAPIGetJsonWebKeySetRequest // GetJsonWebKeySetExecute executes the request // @return JsonWebKeySet - GetJsonWebKeySetExecute(r JwkApiGetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) + GetJsonWebKeySetExecute(r JwkAPIGetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) /* SetJsonWebKey Set JSON Web Key @@ -119,13 +119,13 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set ID @param kid JSON Web Key ID - @return JwkApiSetJsonWebKeyRequest + @return JwkAPISetJsonWebKeyRequest */ - SetJsonWebKey(ctx context.Context, set string, kid string) JwkApiSetJsonWebKeyRequest + SetJsonWebKey(ctx context.Context, set string, kid string) JwkAPISetJsonWebKeyRequest // SetJsonWebKeyExecute executes the request // @return JsonWebKey - SetJsonWebKeyExecute(r JwkApiSetJsonWebKeyRequest) (*JsonWebKey, *http.Response, error) + SetJsonWebKeyExecute(r JwkAPISetJsonWebKeyRequest) (*JsonWebKey, *http.Response, error) /* SetJsonWebKeySet Update a JSON Web Key Set @@ -136,31 +136,31 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set ID - @return JwkApiSetJsonWebKeySetRequest + @return JwkAPISetJsonWebKeySetRequest */ - SetJsonWebKeySet(ctx context.Context, set string) JwkApiSetJsonWebKeySetRequest + SetJsonWebKeySet(ctx context.Context, set string) JwkAPISetJsonWebKeySetRequest // SetJsonWebKeySetExecute executes the request // @return JsonWebKeySet - SetJsonWebKeySetExecute(r JwkApiSetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) + SetJsonWebKeySetExecute(r JwkAPISetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) } -// JwkApiService JwkApi service -type JwkApiService service +// JwkAPIService JwkAPI service +type JwkAPIService service -type JwkApiCreateJsonWebKeySetRequest struct { +type JwkAPICreateJsonWebKeySetRequest struct { ctx context.Context - ApiService JwkApi + ApiService JwkAPI set string createJsonWebKeySet *CreateJsonWebKeySet } -func (r JwkApiCreateJsonWebKeySetRequest) CreateJsonWebKeySet(createJsonWebKeySet CreateJsonWebKeySet) JwkApiCreateJsonWebKeySetRequest { +func (r JwkAPICreateJsonWebKeySetRequest) CreateJsonWebKeySet(createJsonWebKeySet CreateJsonWebKeySet) JwkAPICreateJsonWebKeySetRequest { r.createJsonWebKeySet = &createJsonWebKeySet return r } -func (r JwkApiCreateJsonWebKeySetRequest) Execute() (*JsonWebKeySet, *http.Response, error) { +func (r JwkAPICreateJsonWebKeySetRequest) Execute() (*JsonWebKeySet, *http.Response, error) { return r.ApiService.CreateJsonWebKeySetExecute(r) } @@ -173,10 +173,10 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set ID - @return JwkApiCreateJsonWebKeySetRequest + @return JwkAPICreateJsonWebKeySetRequest */ -func (a *JwkApiService) CreateJsonWebKeySet(ctx context.Context, set string) JwkApiCreateJsonWebKeySetRequest { - return JwkApiCreateJsonWebKeySetRequest{ +func (a *JwkAPIService) CreateJsonWebKeySet(ctx context.Context, set string) JwkAPICreateJsonWebKeySetRequest { + return JwkAPICreateJsonWebKeySetRequest{ ApiService: a, ctx: ctx, set: set, @@ -185,7 +185,7 @@ func (a *JwkApiService) CreateJsonWebKeySet(ctx context.Context, set string) Jwk // Execute executes the request // @return JsonWebKeySet -func (a *JwkApiService) CreateJsonWebKeySetExecute(r JwkApiCreateJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) { +func (a *JwkAPIService) CreateJsonWebKeySetExecute(r JwkAPICreateJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -193,13 +193,13 @@ func (a *JwkApiService) CreateJsonWebKeySetExecute(r JwkApiCreateJsonWebKeySetRe localVarReturnValue *JsonWebKeySet ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkApiService.CreateJsonWebKeySet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkAPIService.CreateJsonWebKeySet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/keys/{set}" - localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterToString(r.set, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterValueToString(r.set, "set")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -237,9 +237,9 @@ func (a *JwkApiService) CreateJsonWebKeySetExecute(r JwkApiCreateJsonWebKeySetRe return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -255,7 +255,8 @@ func (a *JwkApiService) CreateJsonWebKeySetExecute(r JwkApiCreateJsonWebKeySetRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -271,14 +272,14 @@ func (a *JwkApiService) CreateJsonWebKeySetExecute(r JwkApiCreateJsonWebKeySetRe return localVarReturnValue, localVarHTTPResponse, nil } -type JwkApiDeleteJsonWebKeyRequest struct { +type JwkAPIDeleteJsonWebKeyRequest struct { ctx context.Context - ApiService JwkApi + ApiService JwkAPI set string kid string } -func (r JwkApiDeleteJsonWebKeyRequest) Execute() (*http.Response, error) { +func (r JwkAPIDeleteJsonWebKeyRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteJsonWebKeyExecute(r) } @@ -295,10 +296,10 @@ and allows storing user-defined keys as well. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set @param kid The JSON Web Key ID (kid) - @return JwkApiDeleteJsonWebKeyRequest + @return JwkAPIDeleteJsonWebKeyRequest */ -func (a *JwkApiService) DeleteJsonWebKey(ctx context.Context, set string, kid string) JwkApiDeleteJsonWebKeyRequest { - return JwkApiDeleteJsonWebKeyRequest{ +func (a *JwkAPIService) DeleteJsonWebKey(ctx context.Context, set string, kid string) JwkAPIDeleteJsonWebKeyRequest { + return JwkAPIDeleteJsonWebKeyRequest{ ApiService: a, ctx: ctx, set: set, @@ -307,21 +308,21 @@ func (a *JwkApiService) DeleteJsonWebKey(ctx context.Context, set string, kid st } // Execute executes the request -func (a *JwkApiService) DeleteJsonWebKeyExecute(r JwkApiDeleteJsonWebKeyRequest) (*http.Response, error) { +func (a *JwkAPIService) DeleteJsonWebKeyExecute(r JwkAPIDeleteJsonWebKeyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkApiService.DeleteJsonWebKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkAPIService.DeleteJsonWebKey") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/keys/{set}/{kid}" - localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterToString(r.set, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"kid"+"}", url.PathEscape(parameterToString(r.kid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterValueToString(r.set, "set")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"kid"+"}", url.PathEscape(parameterValueToString(r.kid, "kid")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -354,9 +355,9 @@ func (a *JwkApiService) DeleteJsonWebKeyExecute(r JwkApiDeleteJsonWebKeyRequest) return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -372,20 +373,21 @@ func (a *JwkApiService) DeleteJsonWebKeyExecute(r JwkApiDeleteJsonWebKeyRequest) newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type JwkApiDeleteJsonWebKeySetRequest struct { +type JwkAPIDeleteJsonWebKeySetRequest struct { ctx context.Context - ApiService JwkApi + ApiService JwkAPI set string } -func (r JwkApiDeleteJsonWebKeySetRequest) Execute() (*http.Response, error) { +func (r JwkAPIDeleteJsonWebKeySetRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteJsonWebKeySetExecute(r) } @@ -398,10 +400,10 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set - @return JwkApiDeleteJsonWebKeySetRequest + @return JwkAPIDeleteJsonWebKeySetRequest */ -func (a *JwkApiService) DeleteJsonWebKeySet(ctx context.Context, set string) JwkApiDeleteJsonWebKeySetRequest { - return JwkApiDeleteJsonWebKeySetRequest{ +func (a *JwkAPIService) DeleteJsonWebKeySet(ctx context.Context, set string) JwkAPIDeleteJsonWebKeySetRequest { + return JwkAPIDeleteJsonWebKeySetRequest{ ApiService: a, ctx: ctx, set: set, @@ -409,20 +411,20 @@ func (a *JwkApiService) DeleteJsonWebKeySet(ctx context.Context, set string) Jwk } // Execute executes the request -func (a *JwkApiService) DeleteJsonWebKeySetExecute(r JwkApiDeleteJsonWebKeySetRequest) (*http.Response, error) { +func (a *JwkAPIService) DeleteJsonWebKeySetExecute(r JwkAPIDeleteJsonWebKeySetRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkApiService.DeleteJsonWebKeySet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkAPIService.DeleteJsonWebKeySet") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/keys/{set}" - localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterToString(r.set, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterValueToString(r.set, "set")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -455,9 +457,9 @@ func (a *JwkApiService) DeleteJsonWebKeySetExecute(r JwkApiDeleteJsonWebKeySetRe return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -473,21 +475,22 @@ func (a *JwkApiService) DeleteJsonWebKeySetExecute(r JwkApiDeleteJsonWebKeySetRe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type JwkApiGetJsonWebKeyRequest struct { +type JwkAPIGetJsonWebKeyRequest struct { ctx context.Context - ApiService JwkApi + ApiService JwkAPI set string kid string } -func (r JwkApiGetJsonWebKeyRequest) Execute() (*JsonWebKeySet, *http.Response, error) { +func (r JwkAPIGetJsonWebKeyRequest) Execute() (*JsonWebKeySet, *http.Response, error) { return r.ApiService.GetJsonWebKeyExecute(r) } @@ -499,10 +502,10 @@ This endpoint returns a singular JSON Web Key contained in a set. It is identifi @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set JSON Web Key Set ID @param kid JSON Web Key ID - @return JwkApiGetJsonWebKeyRequest + @return JwkAPIGetJsonWebKeyRequest */ -func (a *JwkApiService) GetJsonWebKey(ctx context.Context, set string, kid string) JwkApiGetJsonWebKeyRequest { - return JwkApiGetJsonWebKeyRequest{ +func (a *JwkAPIService) GetJsonWebKey(ctx context.Context, set string, kid string) JwkAPIGetJsonWebKeyRequest { + return JwkAPIGetJsonWebKeyRequest{ ApiService: a, ctx: ctx, set: set, @@ -512,7 +515,7 @@ func (a *JwkApiService) GetJsonWebKey(ctx context.Context, set string, kid strin // Execute executes the request // @return JsonWebKeySet -func (a *JwkApiService) GetJsonWebKeyExecute(r JwkApiGetJsonWebKeyRequest) (*JsonWebKeySet, *http.Response, error) { +func (a *JwkAPIService) GetJsonWebKeyExecute(r JwkAPIGetJsonWebKeyRequest) (*JsonWebKeySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -520,14 +523,14 @@ func (a *JwkApiService) GetJsonWebKeyExecute(r JwkApiGetJsonWebKeyRequest) (*Jso localVarReturnValue *JsonWebKeySet ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkApiService.GetJsonWebKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkAPIService.GetJsonWebKey") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/keys/{set}/{kid}" - localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterToString(r.set, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"kid"+"}", url.PathEscape(parameterToString(r.kid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterValueToString(r.set, "set")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"kid"+"}", url.PathEscape(parameterValueToString(r.kid, "kid")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -560,9 +563,9 @@ func (a *JwkApiService) GetJsonWebKeyExecute(r JwkApiGetJsonWebKeyRequest) (*Jso return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -578,7 +581,8 @@ func (a *JwkApiService) GetJsonWebKeyExecute(r JwkApiGetJsonWebKeyRequest) (*Jso newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -594,13 +598,13 @@ func (a *JwkApiService) GetJsonWebKeyExecute(r JwkApiGetJsonWebKeyRequest) (*Jso return localVarReturnValue, localVarHTTPResponse, nil } -type JwkApiGetJsonWebKeySetRequest struct { +type JwkAPIGetJsonWebKeySetRequest struct { ctx context.Context - ApiService JwkApi + ApiService JwkAPI set string } -func (r JwkApiGetJsonWebKeySetRequest) Execute() (*JsonWebKeySet, *http.Response, error) { +func (r JwkAPIGetJsonWebKeySetRequest) Execute() (*JsonWebKeySet, *http.Response, error) { return r.ApiService.GetJsonWebKeySetExecute(r) } @@ -613,10 +617,10 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set JSON Web Key Set ID - @return JwkApiGetJsonWebKeySetRequest + @return JwkAPIGetJsonWebKeySetRequest */ -func (a *JwkApiService) GetJsonWebKeySet(ctx context.Context, set string) JwkApiGetJsonWebKeySetRequest { - return JwkApiGetJsonWebKeySetRequest{ +func (a *JwkAPIService) GetJsonWebKeySet(ctx context.Context, set string) JwkAPIGetJsonWebKeySetRequest { + return JwkAPIGetJsonWebKeySetRequest{ ApiService: a, ctx: ctx, set: set, @@ -625,7 +629,7 @@ func (a *JwkApiService) GetJsonWebKeySet(ctx context.Context, set string) JwkApi // Execute executes the request // @return JsonWebKeySet -func (a *JwkApiService) GetJsonWebKeySetExecute(r JwkApiGetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) { +func (a *JwkAPIService) GetJsonWebKeySetExecute(r JwkAPIGetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -633,13 +637,13 @@ func (a *JwkApiService) GetJsonWebKeySetExecute(r JwkApiGetJsonWebKeySetRequest) localVarReturnValue *JsonWebKeySet ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkApiService.GetJsonWebKeySet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkAPIService.GetJsonWebKeySet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/keys/{set}" - localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterToString(r.set, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterValueToString(r.set, "set")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -672,9 +676,9 @@ func (a *JwkApiService) GetJsonWebKeySetExecute(r JwkApiGetJsonWebKeySetRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -690,7 +694,8 @@ func (a *JwkApiService) GetJsonWebKeySetExecute(r JwkApiGetJsonWebKeySetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -706,20 +711,20 @@ func (a *JwkApiService) GetJsonWebKeySetExecute(r JwkApiGetJsonWebKeySetRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type JwkApiSetJsonWebKeyRequest struct { +type JwkAPISetJsonWebKeyRequest struct { ctx context.Context - ApiService JwkApi + ApiService JwkAPI set string kid string jsonWebKey *JsonWebKey } -func (r JwkApiSetJsonWebKeyRequest) JsonWebKey(jsonWebKey JsonWebKey) JwkApiSetJsonWebKeyRequest { +func (r JwkAPISetJsonWebKeyRequest) JsonWebKey(jsonWebKey JsonWebKey) JwkAPISetJsonWebKeyRequest { r.jsonWebKey = &jsonWebKey return r } -func (r JwkApiSetJsonWebKeyRequest) Execute() (*JsonWebKey, *http.Response, error) { +func (r JwkAPISetJsonWebKeyRequest) Execute() (*JsonWebKey, *http.Response, error) { return r.ApiService.SetJsonWebKeyExecute(r) } @@ -733,10 +738,10 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set ID @param kid JSON Web Key ID - @return JwkApiSetJsonWebKeyRequest + @return JwkAPISetJsonWebKeyRequest */ -func (a *JwkApiService) SetJsonWebKey(ctx context.Context, set string, kid string) JwkApiSetJsonWebKeyRequest { - return JwkApiSetJsonWebKeyRequest{ +func (a *JwkAPIService) SetJsonWebKey(ctx context.Context, set string, kid string) JwkAPISetJsonWebKeyRequest { + return JwkAPISetJsonWebKeyRequest{ ApiService: a, ctx: ctx, set: set, @@ -746,7 +751,7 @@ func (a *JwkApiService) SetJsonWebKey(ctx context.Context, set string, kid strin // Execute executes the request // @return JsonWebKey -func (a *JwkApiService) SetJsonWebKeyExecute(r JwkApiSetJsonWebKeyRequest) (*JsonWebKey, *http.Response, error) { +func (a *JwkAPIService) SetJsonWebKeyExecute(r JwkAPISetJsonWebKeyRequest) (*JsonWebKey, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -754,14 +759,14 @@ func (a *JwkApiService) SetJsonWebKeyExecute(r JwkApiSetJsonWebKeyRequest) (*Jso localVarReturnValue *JsonWebKey ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkApiService.SetJsonWebKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkAPIService.SetJsonWebKey") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/keys/{set}/{kid}" - localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterToString(r.set, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"kid"+"}", url.PathEscape(parameterToString(r.kid, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterValueToString(r.set, "set")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"kid"+"}", url.PathEscape(parameterValueToString(r.kid, "kid")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -796,9 +801,9 @@ func (a *JwkApiService) SetJsonWebKeyExecute(r JwkApiSetJsonWebKeyRequest) (*Jso return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -814,7 +819,8 @@ func (a *JwkApiService) SetJsonWebKeyExecute(r JwkApiSetJsonWebKeyRequest) (*Jso newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -830,19 +836,19 @@ func (a *JwkApiService) SetJsonWebKeyExecute(r JwkApiSetJsonWebKeyRequest) (*Jso return localVarReturnValue, localVarHTTPResponse, nil } -type JwkApiSetJsonWebKeySetRequest struct { +type JwkAPISetJsonWebKeySetRequest struct { ctx context.Context - ApiService JwkApi + ApiService JwkAPI set string jsonWebKeySet *JsonWebKeySet } -func (r JwkApiSetJsonWebKeySetRequest) JsonWebKeySet(jsonWebKeySet JsonWebKeySet) JwkApiSetJsonWebKeySetRequest { +func (r JwkAPISetJsonWebKeySetRequest) JsonWebKeySet(jsonWebKeySet JsonWebKeySet) JwkAPISetJsonWebKeySetRequest { r.jsonWebKeySet = &jsonWebKeySet return r } -func (r JwkApiSetJsonWebKeySetRequest) Execute() (*JsonWebKeySet, *http.Response, error) { +func (r JwkAPISetJsonWebKeySetRequest) Execute() (*JsonWebKeySet, *http.Response, error) { return r.ApiService.SetJsonWebKeySetExecute(r) } @@ -855,10 +861,10 @@ A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param set The JSON Web Key Set ID - @return JwkApiSetJsonWebKeySetRequest + @return JwkAPISetJsonWebKeySetRequest */ -func (a *JwkApiService) SetJsonWebKeySet(ctx context.Context, set string) JwkApiSetJsonWebKeySetRequest { - return JwkApiSetJsonWebKeySetRequest{ +func (a *JwkAPIService) SetJsonWebKeySet(ctx context.Context, set string) JwkAPISetJsonWebKeySetRequest { + return JwkAPISetJsonWebKeySetRequest{ ApiService: a, ctx: ctx, set: set, @@ -867,7 +873,7 @@ func (a *JwkApiService) SetJsonWebKeySet(ctx context.Context, set string) JwkApi // Execute executes the request // @return JsonWebKeySet -func (a *JwkApiService) SetJsonWebKeySetExecute(r JwkApiSetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) { +func (a *JwkAPIService) SetJsonWebKeySetExecute(r JwkAPISetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -875,13 +881,13 @@ func (a *JwkApiService) SetJsonWebKeySetExecute(r JwkApiSetJsonWebKeySetRequest) localVarReturnValue *JsonWebKeySet ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkApiService.SetJsonWebKeySet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "JwkAPIService.SetJsonWebKeySet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/keys/{set}" - localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterToString(r.set, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"set"+"}", url.PathEscape(parameterValueToString(r.set, "set")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -916,9 +922,9 @@ func (a *JwkApiService) SetJsonWebKeySetExecute(r JwkApiSetJsonWebKeySetRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -934,7 +940,8 @@ func (a *JwkApiService) SetJsonWebKeySetExecute(r JwkApiSetJsonWebKeySetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/api_metadata.go b/api_metadata.go index 8d06abc..c1dee5b 100644 --- a/api_metadata.go +++ b/api_metadata.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -14,13 +14,13 @@ package client import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" ) -type MetadataApi interface { +type MetadataAPI interface { /* GetVersion Return Running Software Version. @@ -34,13 +34,13 @@ Be aware that if you are running multiple nodes of this service, the version wil refer to the cluster state, only to a single instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MetadataApiGetVersionRequest + @return MetadataAPIGetVersionRequest */ - GetVersion(ctx context.Context) MetadataApiGetVersionRequest + GetVersion(ctx context.Context) MetadataAPIGetVersionRequest // GetVersionExecute executes the request // @return GetVersion200Response - GetVersionExecute(r MetadataApiGetVersionRequest) (*GetVersion200Response, *http.Response, error) + GetVersionExecute(r MetadataAPIGetVersionRequest) (*GetVersion200Response, *http.Response, error) /* IsAlive Check HTTP Server Status @@ -55,13 +55,13 @@ Be aware that if you are running multiple nodes of this service, the health stat refer to the cluster state, only to a single instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MetadataApiIsAliveRequest + @return MetadataAPIIsAliveRequest */ - IsAlive(ctx context.Context) MetadataApiIsAliveRequest + IsAlive(ctx context.Context) MetadataAPIIsAliveRequest // IsAliveExecute executes the request // @return HealthStatus - IsAliveExecute(r MetadataApiIsAliveRequest) (*HealthStatus, *http.Response, error) + IsAliveExecute(r MetadataAPIIsAliveRequest) (*HealthStatus, *http.Response, error) /* IsReady Check HTTP Server and Database Status @@ -76,24 +76,24 @@ Be aware that if you are running multiple nodes of Ory Hydra, the health status refer to the cluster state, only to a single instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MetadataApiIsReadyRequest + @return MetadataAPIIsReadyRequest */ - IsReady(ctx context.Context) MetadataApiIsReadyRequest + IsReady(ctx context.Context) MetadataAPIIsReadyRequest // IsReadyExecute executes the request // @return IsReady200Response - IsReadyExecute(r MetadataApiIsReadyRequest) (*IsReady200Response, *http.Response, error) + IsReadyExecute(r MetadataAPIIsReadyRequest) (*IsReady200Response, *http.Response, error) } -// MetadataApiService MetadataApi service -type MetadataApiService service +// MetadataAPIService MetadataAPI service +type MetadataAPIService service -type MetadataApiGetVersionRequest struct { +type MetadataAPIGetVersionRequest struct { ctx context.Context - ApiService MetadataApi + ApiService MetadataAPI } -func (r MetadataApiGetVersionRequest) Execute() (*GetVersion200Response, *http.Response, error) { +func (r MetadataAPIGetVersionRequest) Execute() (*GetVersion200Response, *http.Response, error) { return r.ApiService.GetVersionExecute(r) } @@ -109,10 +109,10 @@ Be aware that if you are running multiple nodes of this service, the version wil refer to the cluster state, only to a single instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MetadataApiGetVersionRequest + @return MetadataAPIGetVersionRequest */ -func (a *MetadataApiService) GetVersion(ctx context.Context) MetadataApiGetVersionRequest { - return MetadataApiGetVersionRequest{ +func (a *MetadataAPIService) GetVersion(ctx context.Context) MetadataAPIGetVersionRequest { + return MetadataAPIGetVersionRequest{ ApiService: a, ctx: ctx, } @@ -120,7 +120,7 @@ func (a *MetadataApiService) GetVersion(ctx context.Context) MetadataApiGetVersi // Execute executes the request // @return GetVersion200Response -func (a *MetadataApiService) GetVersionExecute(r MetadataApiGetVersionRequest) (*GetVersion200Response, *http.Response, error) { +func (a *MetadataAPIService) GetVersionExecute(r MetadataAPIGetVersionRequest) (*GetVersion200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -128,7 +128,7 @@ func (a *MetadataApiService) GetVersionExecute(r MetadataApiGetVersionRequest) ( localVarReturnValue *GetVersion200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.GetVersion") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataAPIService.GetVersion") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -166,9 +166,9 @@ func (a *MetadataApiService) GetVersionExecute(r MetadataApiGetVersionRequest) ( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -193,12 +193,12 @@ func (a *MetadataApiService) GetVersionExecute(r MetadataApiGetVersionRequest) ( return localVarReturnValue, localVarHTTPResponse, nil } -type MetadataApiIsAliveRequest struct { +type MetadataAPIIsAliveRequest struct { ctx context.Context - ApiService MetadataApi + ApiService MetadataAPI } -func (r MetadataApiIsAliveRequest) Execute() (*HealthStatus, *http.Response, error) { +func (r MetadataAPIIsAliveRequest) Execute() (*HealthStatus, *http.Response, error) { return r.ApiService.IsAliveExecute(r) } @@ -215,10 +215,10 @@ Be aware that if you are running multiple nodes of this service, the health stat refer to the cluster state, only to a single instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MetadataApiIsAliveRequest + @return MetadataAPIIsAliveRequest */ -func (a *MetadataApiService) IsAlive(ctx context.Context) MetadataApiIsAliveRequest { - return MetadataApiIsAliveRequest{ +func (a *MetadataAPIService) IsAlive(ctx context.Context) MetadataAPIIsAliveRequest { + return MetadataAPIIsAliveRequest{ ApiService: a, ctx: ctx, } @@ -226,7 +226,7 @@ func (a *MetadataApiService) IsAlive(ctx context.Context) MetadataApiIsAliveRequ // Execute executes the request // @return HealthStatus -func (a *MetadataApiService) IsAliveExecute(r MetadataApiIsAliveRequest) (*HealthStatus, *http.Response, error) { +func (a *MetadataAPIService) IsAliveExecute(r MetadataAPIIsAliveRequest) (*HealthStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -234,7 +234,7 @@ func (a *MetadataApiService) IsAliveExecute(r MetadataApiIsAliveRequest) (*Healt localVarReturnValue *HealthStatus ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.IsAlive") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataAPIService.IsAlive") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -272,9 +272,9 @@ func (a *MetadataApiService) IsAliveExecute(r MetadataApiIsAliveRequest) (*Healt return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -291,7 +291,8 @@ func (a *MetadataApiService) IsAliveExecute(r MetadataApiIsAliveRequest) (*Healt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -308,12 +309,12 @@ func (a *MetadataApiService) IsAliveExecute(r MetadataApiIsAliveRequest) (*Healt return localVarReturnValue, localVarHTTPResponse, nil } -type MetadataApiIsReadyRequest struct { +type MetadataAPIIsReadyRequest struct { ctx context.Context - ApiService MetadataApi + ApiService MetadataAPI } -func (r MetadataApiIsReadyRequest) Execute() (*IsReady200Response, *http.Response, error) { +func (r MetadataAPIIsReadyRequest) Execute() (*IsReady200Response, *http.Response, error) { return r.ApiService.IsReadyExecute(r) } @@ -330,10 +331,10 @@ Be aware that if you are running multiple nodes of Ory Hydra, the health status refer to the cluster state, only to a single instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MetadataApiIsReadyRequest + @return MetadataAPIIsReadyRequest */ -func (a *MetadataApiService) IsReady(ctx context.Context) MetadataApiIsReadyRequest { - return MetadataApiIsReadyRequest{ +func (a *MetadataAPIService) IsReady(ctx context.Context) MetadataAPIIsReadyRequest { + return MetadataAPIIsReadyRequest{ ApiService: a, ctx: ctx, } @@ -341,7 +342,7 @@ func (a *MetadataApiService) IsReady(ctx context.Context) MetadataApiIsReadyRequ // Execute executes the request // @return IsReady200Response -func (a *MetadataApiService) IsReadyExecute(r MetadataApiIsReadyRequest) (*IsReady200Response, *http.Response, error) { +func (a *MetadataAPIService) IsReadyExecute(r MetadataAPIIsReadyRequest) (*IsReady200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -349,7 +350,7 @@ func (a *MetadataApiService) IsReadyExecute(r MetadataApiIsReadyRequest) (*IsRea localVarReturnValue *IsReady200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.IsReady") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataAPIService.IsReady") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -387,9 +388,9 @@ func (a *MetadataApiService) IsReadyExecute(r MetadataApiIsReadyRequest) (*IsRea return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -406,7 +407,8 @@ func (a *MetadataApiService) IsReadyExecute(r MetadataApiIsReadyRequest) (*IsRea newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/api_o_auth2.go b/api_o_auth2.go index 065c9f5..6e6a326 100644 --- a/api_o_auth2.go +++ b/api_o_auth2.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -14,14 +14,14 @@ package client import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" "strings" ) -type OAuth2Api interface { +type OAuth2API interface { /* AcceptOAuth2ConsentRequest Accept OAuth 2.0 Consent Request @@ -44,13 +44,13 @@ The default consent provider is available via the Ory Managed Account Experience head over to the OAuth 2.0 documentation. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiAcceptOAuth2ConsentRequestRequest + @return OAuth2APIAcceptOAuth2ConsentRequestRequest */ - AcceptOAuth2ConsentRequest(ctx context.Context) OAuth2ApiAcceptOAuth2ConsentRequestRequest + AcceptOAuth2ConsentRequest(ctx context.Context) OAuth2APIAcceptOAuth2ConsentRequestRequest // AcceptOAuth2ConsentRequestExecute executes the request // @return OAuth2RedirectTo - AcceptOAuth2ConsentRequestExecute(r OAuth2ApiAcceptOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) + AcceptOAuth2ConsentRequestExecute(r OAuth2APIAcceptOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) /* AcceptOAuth2LoginRequest Accept OAuth 2.0 Login Request @@ -68,13 +68,13 @@ a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiAcceptOAuth2LoginRequestRequest + @return OAuth2APIAcceptOAuth2LoginRequestRequest */ - AcceptOAuth2LoginRequest(ctx context.Context) OAuth2ApiAcceptOAuth2LoginRequestRequest + AcceptOAuth2LoginRequest(ctx context.Context) OAuth2APIAcceptOAuth2LoginRequestRequest // AcceptOAuth2LoginRequestExecute executes the request // @return OAuth2RedirectTo - AcceptOAuth2LoginRequestExecute(r OAuth2ApiAcceptOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) + AcceptOAuth2LoginRequestExecute(r OAuth2APIAcceptOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) /* AcceptOAuth2LogoutRequest Accept OAuth 2.0 Session Logout Request @@ -84,13 +84,13 @@ The response contains a redirect URL which the login provider should redirect th The response contains a redirect URL which the consent provider should redirect the user-agent to. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiAcceptOAuth2LogoutRequestRequest + @return OAuth2APIAcceptOAuth2LogoutRequestRequest */ - AcceptOAuth2LogoutRequest(ctx context.Context) OAuth2ApiAcceptOAuth2LogoutRequestRequest + AcceptOAuth2LogoutRequest(ctx context.Context) OAuth2APIAcceptOAuth2LogoutRequestRequest // AcceptOAuth2LogoutRequestExecute executes the request // @return OAuth2RedirectTo - AcceptOAuth2LogoutRequestExecute(r OAuth2ApiAcceptOAuth2LogoutRequestRequest) (*OAuth2RedirectTo, *http.Response, error) + AcceptOAuth2LogoutRequestExecute(r OAuth2APIAcceptOAuth2LogoutRequestRequest) (*OAuth2RedirectTo, *http.Response, error) /* CreateOAuth2Client Create OAuth 2.0 Client @@ -99,13 +99,13 @@ The response contains a redirect URL which the consent provider should redirect is generated. The secret is echoed in the response. It is not possible to retrieve it later on. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiCreateOAuth2ClientRequest + @return OAuth2APICreateOAuth2ClientRequest */ - CreateOAuth2Client(ctx context.Context) OAuth2ApiCreateOAuth2ClientRequest + CreateOAuth2Client(ctx context.Context) OAuth2APICreateOAuth2ClientRequest // CreateOAuth2ClientExecute executes the request // @return OAuth2Client - CreateOAuth2ClientExecute(r OAuth2ApiCreateOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) + CreateOAuth2ClientExecute(r OAuth2APICreateOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) /* DeleteOAuth2Client Delete OAuth 2.0 Client @@ -119,12 +119,12 @@ Make sure that this endpoint is well protected and only callable by first-party @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OAuth2ApiDeleteOAuth2ClientRequest + @return OAuth2APIDeleteOAuth2ClientRequest */ - DeleteOAuth2Client(ctx context.Context, id string) OAuth2ApiDeleteOAuth2ClientRequest + DeleteOAuth2Client(ctx context.Context, id string) OAuth2APIDeleteOAuth2ClientRequest // DeleteOAuth2ClientExecute executes the request - DeleteOAuth2ClientExecute(r OAuth2ApiDeleteOAuth2ClientRequest) (*http.Response, error) + DeleteOAuth2ClientExecute(r OAuth2APIDeleteOAuth2ClientRequest) (*http.Response, error) /* DeleteOAuth2Token Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client @@ -132,12 +132,12 @@ Make sure that this endpoint is well protected and only callable by first-party This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiDeleteOAuth2TokenRequest + @return OAuth2APIDeleteOAuth2TokenRequest */ - DeleteOAuth2Token(ctx context.Context) OAuth2ApiDeleteOAuth2TokenRequest + DeleteOAuth2Token(ctx context.Context) OAuth2APIDeleteOAuth2TokenRequest // DeleteOAuth2TokenExecute executes the request - DeleteOAuth2TokenExecute(r OAuth2ApiDeleteOAuth2TokenRequest) (*http.Response, error) + DeleteOAuth2TokenExecute(r OAuth2APIDeleteOAuth2TokenRequest) (*http.Response, error) /* DeleteTrustedOAuth2JwtGrantIssuer Delete Trusted OAuth2 JWT Bearer Grant Type Issuer @@ -150,12 +150,12 @@ for OAuth 2.0 Client Authentication and Authorization Grant. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the desired grant - @return OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest + @return OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest */ - DeleteTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest + DeleteTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest // DeleteTrustedOAuth2JwtGrantIssuerExecute executes the request - DeleteTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest) (*http.Response, error) + DeleteTrustedOAuth2JwtGrantIssuerExecute(r OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest) (*http.Response, error) /* GetOAuth2Client Get an OAuth 2.0 Client @@ -167,13 +167,13 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OAuth2ApiGetOAuth2ClientRequest + @return OAuth2APIGetOAuth2ClientRequest */ - GetOAuth2Client(ctx context.Context, id string) OAuth2ApiGetOAuth2ClientRequest + GetOAuth2Client(ctx context.Context, id string) OAuth2APIGetOAuth2ClientRequest // GetOAuth2ClientExecute executes the request // @return OAuth2Client - GetOAuth2ClientExecute(r OAuth2ApiGetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) + GetOAuth2ClientExecute(r OAuth2APIGetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) /* GetOAuth2ConsentRequest Get OAuth 2.0 Consent Request @@ -190,13 +190,13 @@ The default consent provider is available via the Ory Managed Account Experience head over to the OAuth 2.0 documentation. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiGetOAuth2ConsentRequestRequest + @return OAuth2APIGetOAuth2ConsentRequestRequest */ - GetOAuth2ConsentRequest(ctx context.Context) OAuth2ApiGetOAuth2ConsentRequestRequest + GetOAuth2ConsentRequest(ctx context.Context) OAuth2APIGetOAuth2ConsentRequestRequest // GetOAuth2ConsentRequestExecute executes the request // @return OAuth2ConsentRequest - GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2ConsentRequestRequest) (*OAuth2ConsentRequest, *http.Response, error) + GetOAuth2ConsentRequestExecute(r OAuth2APIGetOAuth2ConsentRequestRequest) (*OAuth2ConsentRequest, *http.Response, error) /* GetOAuth2LoginRequest Get OAuth 2.0 Login Request @@ -212,13 +212,13 @@ The authentication challenge is appended to the login provider URL to which the provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiGetOAuth2LoginRequestRequest + @return OAuth2APIGetOAuth2LoginRequestRequest */ - GetOAuth2LoginRequest(ctx context.Context) OAuth2ApiGetOAuth2LoginRequestRequest + GetOAuth2LoginRequest(ctx context.Context) OAuth2APIGetOAuth2LoginRequestRequest // GetOAuth2LoginRequestExecute executes the request // @return OAuth2LoginRequest - GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2LoginRequestRequest) (*OAuth2LoginRequest, *http.Response, error) + GetOAuth2LoginRequestExecute(r OAuth2APIGetOAuth2LoginRequestRequest) (*OAuth2LoginRequest, *http.Response, error) /* GetOAuth2LogoutRequest Get OAuth 2.0 Session Logout Request @@ -226,13 +226,13 @@ provider uses that challenge to fetch information on the OAuth2 request and then Use this endpoint to fetch an Ory OAuth 2.0 logout request. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiGetOAuth2LogoutRequestRequest + @return OAuth2APIGetOAuth2LogoutRequestRequest */ - GetOAuth2LogoutRequest(ctx context.Context) OAuth2ApiGetOAuth2LogoutRequestRequest + GetOAuth2LogoutRequest(ctx context.Context) OAuth2APIGetOAuth2LogoutRequestRequest // GetOAuth2LogoutRequestExecute executes the request // @return OAuth2LogoutRequest - GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2LogoutRequestRequest) (*OAuth2LogoutRequest, *http.Response, error) + GetOAuth2LogoutRequestExecute(r OAuth2APIGetOAuth2LogoutRequestRequest) (*OAuth2LogoutRequest, *http.Response, error) /* GetTrustedOAuth2JwtGrantIssuer Get Trusted OAuth2 JWT Bearer Grant Type Issuer @@ -242,13 +242,13 @@ created the trust relationship. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the desired grant - @return OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest + @return OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest */ - GetTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest + GetTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest // GetTrustedOAuth2JwtGrantIssuerExecute executes the request // @return TrustedOAuth2JwtGrantIssuer - GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) + GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) /* IntrospectOAuth2Token Introspect OAuth2 Access and Refresh Tokens @@ -258,13 +258,13 @@ is neither expired nor revoked. If a token is active, additional information on set additional data for a token by setting `session.access_token` during the consent flow. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiIntrospectOAuth2TokenRequest + @return OAuth2APIIntrospectOAuth2TokenRequest */ - IntrospectOAuth2Token(ctx context.Context) OAuth2ApiIntrospectOAuth2TokenRequest + IntrospectOAuth2Token(ctx context.Context) OAuth2APIIntrospectOAuth2TokenRequest // IntrospectOAuth2TokenExecute executes the request // @return IntrospectedOAuth2Token - IntrospectOAuth2TokenExecute(r OAuth2ApiIntrospectOAuth2TokenRequest) (*IntrospectedOAuth2Token, *http.Response, error) + IntrospectOAuth2TokenExecute(r OAuth2APIIntrospectOAuth2TokenRequest) (*IntrospectedOAuth2Token, *http.Response, error) /* ListOAuth2Clients List OAuth 2.0 Clients @@ -273,13 +273,13 @@ set additional data for a token by setting `session.access_token` during the con As a default it lists the first 100 clients. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiListOAuth2ClientsRequest + @return OAuth2APIListOAuth2ClientsRequest */ - ListOAuth2Clients(ctx context.Context) OAuth2ApiListOAuth2ClientsRequest + ListOAuth2Clients(ctx context.Context) OAuth2APIListOAuth2ClientsRequest // ListOAuth2ClientsExecute executes the request // @return []OAuth2Client - ListOAuth2ClientsExecute(r OAuth2ApiListOAuth2ClientsRequest) ([]OAuth2Client, *http.Response, error) + ListOAuth2ClientsExecute(r OAuth2APIListOAuth2ClientsRequest) ([]OAuth2Client, *http.Response, error) /* ListOAuth2ConsentSessions List OAuth 2.0 Consent Sessions of a Subject @@ -289,13 +289,13 @@ If the subject is unknown or has not granted any consent sessions yet, the endpo empty JSON array with status code 200 OK. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiListOAuth2ConsentSessionsRequest + @return OAuth2APIListOAuth2ConsentSessionsRequest */ - ListOAuth2ConsentSessions(ctx context.Context) OAuth2ApiListOAuth2ConsentSessionsRequest + ListOAuth2ConsentSessions(ctx context.Context) OAuth2APIListOAuth2ConsentSessionsRequest // ListOAuth2ConsentSessionsExecute executes the request // @return []OAuth2ConsentSession - ListOAuth2ConsentSessionsExecute(r OAuth2ApiListOAuth2ConsentSessionsRequest) ([]OAuth2ConsentSession, *http.Response, error) + ListOAuth2ConsentSessionsExecute(r OAuth2APIListOAuth2ConsentSessionsRequest) ([]OAuth2ConsentSession, *http.Response, error) /* ListTrustedOAuth2JwtGrantIssuers List Trusted OAuth2 JWT Bearer Grant Type Issuers @@ -303,13 +303,13 @@ empty JSON array with status code 200 OK. Use this endpoint to list all trusted JWT Bearer Grant Type Issuers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest + @return OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest */ - ListTrustedOAuth2JwtGrantIssuers(ctx context.Context) OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest + ListTrustedOAuth2JwtGrantIssuers(ctx context.Context) OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest // ListTrustedOAuth2JwtGrantIssuersExecute executes the request // @return []TrustedOAuth2JwtGrantIssuer - ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest) ([]TrustedOAuth2JwtGrantIssuer, *http.Response, error) + ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest) ([]TrustedOAuth2JwtGrantIssuer, *http.Response, error) /* OAuth2Authorize OAuth 2.0 Authorize Endpoint @@ -320,13 +320,13 @@ available for any programming language. You can find a list of libraries at http The Ory SDK is not yet able to this endpoint properly. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiOAuth2AuthorizeRequest + @return OAuth2APIOAuth2AuthorizeRequest */ - OAuth2Authorize(ctx context.Context) OAuth2ApiOAuth2AuthorizeRequest + OAuth2Authorize(ctx context.Context) OAuth2APIOAuth2AuthorizeRequest // OAuth2AuthorizeExecute executes the request // @return ErrorOAuth2 - OAuth2AuthorizeExecute(r OAuth2ApiOAuth2AuthorizeRequest) (*ErrorOAuth2, *http.Response, error) + OAuth2AuthorizeExecute(r OAuth2APIOAuth2AuthorizeRequest) (*ErrorOAuth2, *http.Response, error) /* Oauth2TokenExchange The OAuth 2.0 Token Endpoint @@ -337,13 +337,13 @@ available for any programming language. You can find a list of libraries here ht The Ory SDK is not yet able to this endpoint properly. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiOauth2TokenExchangeRequest + @return OAuth2APIOauth2TokenExchangeRequest */ - Oauth2TokenExchange(ctx context.Context) OAuth2ApiOauth2TokenExchangeRequest + Oauth2TokenExchange(ctx context.Context) OAuth2APIOauth2TokenExchangeRequest // Oauth2TokenExchangeExecute executes the request // @return OAuth2TokenExchange - Oauth2TokenExchangeExecute(r OAuth2ApiOauth2TokenExchangeRequest) (*OAuth2TokenExchange, *http.Response, error) + Oauth2TokenExchangeExecute(r OAuth2APIOauth2TokenExchangeRequest) (*OAuth2TokenExchange, *http.Response, error) /* PatchOAuth2Client Patch OAuth 2.0 Client @@ -357,13 +357,13 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OAuth2ApiPatchOAuth2ClientRequest + @return OAuth2APIPatchOAuth2ClientRequest */ - PatchOAuth2Client(ctx context.Context, id string) OAuth2ApiPatchOAuth2ClientRequest + PatchOAuth2Client(ctx context.Context, id string) OAuth2APIPatchOAuth2ClientRequest // PatchOAuth2ClientExecute executes the request // @return OAuth2Client - PatchOAuth2ClientExecute(r OAuth2ApiPatchOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) + PatchOAuth2ClientExecute(r OAuth2APIPatchOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) /* RejectOAuth2ConsentRequest Reject OAuth 2.0 Consent Request @@ -385,13 +385,13 @@ The default consent provider is available via the Ory Managed Account Experience head over to the OAuth 2.0 documentation. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRejectOAuth2ConsentRequestRequest + @return OAuth2APIRejectOAuth2ConsentRequestRequest */ - RejectOAuth2ConsentRequest(ctx context.Context) OAuth2ApiRejectOAuth2ConsentRequestRequest + RejectOAuth2ConsentRequest(ctx context.Context) OAuth2APIRejectOAuth2ConsentRequestRequest // RejectOAuth2ConsentRequestExecute executes the request // @return OAuth2RedirectTo - RejectOAuth2ConsentRequestExecute(r OAuth2ApiRejectOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) + RejectOAuth2ConsentRequestExecute(r OAuth2APIRejectOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) /* RejectOAuth2LoginRequest Reject OAuth 2.0 Login Request @@ -408,13 +408,13 @@ was denied. The response contains a redirect URL which the login provider should redirect the user-agent to. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRejectOAuth2LoginRequestRequest + @return OAuth2APIRejectOAuth2LoginRequestRequest */ - RejectOAuth2LoginRequest(ctx context.Context) OAuth2ApiRejectOAuth2LoginRequestRequest + RejectOAuth2LoginRequest(ctx context.Context) OAuth2APIRejectOAuth2LoginRequestRequest // RejectOAuth2LoginRequestExecute executes the request // @return OAuth2RedirectTo - RejectOAuth2LoginRequestExecute(r OAuth2ApiRejectOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) + RejectOAuth2LoginRequestExecute(r OAuth2APIRejectOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) /* RejectOAuth2LogoutRequest Reject OAuth 2.0 Session Logout Request @@ -425,12 +425,12 @@ No HTTP request body is required. The response is empty as the logout provider has to chose what action to perform next. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRejectOAuth2LogoutRequestRequest + @return OAuth2APIRejectOAuth2LogoutRequestRequest */ - RejectOAuth2LogoutRequest(ctx context.Context) OAuth2ApiRejectOAuth2LogoutRequestRequest + RejectOAuth2LogoutRequest(ctx context.Context) OAuth2APIRejectOAuth2LogoutRequestRequest // RejectOAuth2LogoutRequestExecute executes the request - RejectOAuth2LogoutRequestExecute(r OAuth2ApiRejectOAuth2LogoutRequestRequest) (*http.Response, error) + RejectOAuth2LogoutRequestExecute(r OAuth2APIRejectOAuth2LogoutRequestRequest) (*http.Response, error) /* RevokeOAuth2ConsentSessions Revoke OAuth 2.0 Consent Sessions of a Subject @@ -439,12 +439,12 @@ The response is empty as the logout provider has to chose what action to perform associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0 Client ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRevokeOAuth2ConsentSessionsRequest + @return OAuth2APIRevokeOAuth2ConsentSessionsRequest */ - RevokeOAuth2ConsentSessions(ctx context.Context) OAuth2ApiRevokeOAuth2ConsentSessionsRequest + RevokeOAuth2ConsentSessions(ctx context.Context) OAuth2APIRevokeOAuth2ConsentSessionsRequest // RevokeOAuth2ConsentSessionsExecute executes the request - RevokeOAuth2ConsentSessionsExecute(r OAuth2ApiRevokeOAuth2ConsentSessionsRequest) (*http.Response, error) + RevokeOAuth2ConsentSessionsExecute(r OAuth2APIRevokeOAuth2ConsentSessionsRequest) (*http.Response, error) /* RevokeOAuth2LoginSessions Revokes OAuth 2.0 Login Sessions by either a Subject or a SessionID @@ -453,18 +453,18 @@ associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a spec has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens. If you send the subject in a query param, all authentication sessions that belong to that subject are revoked. -No OpennID Connect Front- or Back-channel logout is performed in this case. +No OpenID Connect Front- or Back-channel logout is performed in this case. Alternatively, you can send a SessionID via `sid` query param, in which case, only the session that is connected to that SessionID is revoked. OpenID Connect Back-channel logout is performed in this case. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRevokeOAuth2LoginSessionsRequest + @return OAuth2APIRevokeOAuth2LoginSessionsRequest */ - RevokeOAuth2LoginSessions(ctx context.Context) OAuth2ApiRevokeOAuth2LoginSessionsRequest + RevokeOAuth2LoginSessions(ctx context.Context) OAuth2APIRevokeOAuth2LoginSessionsRequest // RevokeOAuth2LoginSessionsExecute executes the request - RevokeOAuth2LoginSessionsExecute(r OAuth2ApiRevokeOAuth2LoginSessionsRequest) (*http.Response, error) + RevokeOAuth2LoginSessionsExecute(r OAuth2APIRevokeOAuth2LoginSessionsRequest) (*http.Response, error) /* RevokeOAuth2Token Revoke OAuth 2.0 Access or Refresh Token @@ -475,12 +475,12 @@ Revoking a refresh token also invalidates the access token that was created with the client the token was generated for. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRevokeOAuth2TokenRequest + @return OAuth2APIRevokeOAuth2TokenRequest */ - RevokeOAuth2Token(ctx context.Context) OAuth2ApiRevokeOAuth2TokenRequest + RevokeOAuth2Token(ctx context.Context) OAuth2APIRevokeOAuth2TokenRequest // RevokeOAuth2TokenExecute executes the request - RevokeOAuth2TokenExecute(r OAuth2ApiRevokeOAuth2TokenRequest) (*http.Response, error) + RevokeOAuth2TokenExecute(r OAuth2APIRevokeOAuth2TokenRequest) (*http.Response, error) /* SetOAuth2Client Set OAuth 2.0 Client @@ -495,13 +495,13 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id OAuth 2.0 Client ID - @return OAuth2ApiSetOAuth2ClientRequest + @return OAuth2APISetOAuth2ClientRequest */ - SetOAuth2Client(ctx context.Context, id string) OAuth2ApiSetOAuth2ClientRequest + SetOAuth2Client(ctx context.Context, id string) OAuth2APISetOAuth2ClientRequest // SetOAuth2ClientExecute executes the request // @return OAuth2Client - SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) + SetOAuth2ClientExecute(r OAuth2APISetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) /* SetOAuth2ClientLifespans Set OAuth2 Client Token Lifespans @@ -510,13 +510,13 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id OAuth 2.0 Client ID - @return OAuth2ApiSetOAuth2ClientLifespansRequest + @return OAuth2APISetOAuth2ClientLifespansRequest */ - SetOAuth2ClientLifespans(ctx context.Context, id string) OAuth2ApiSetOAuth2ClientLifespansRequest + SetOAuth2ClientLifespans(ctx context.Context, id string) OAuth2APISetOAuth2ClientLifespansRequest // SetOAuth2ClientLifespansExecute executes the request // @return OAuth2Client - SetOAuth2ClientLifespansExecute(r OAuth2ApiSetOAuth2ClientLifespansRequest) (*OAuth2Client, *http.Response, error) + SetOAuth2ClientLifespansExecute(r OAuth2APISetOAuth2ClientLifespansRequest) (*OAuth2Client, *http.Response, error) /* TrustOAuth2JwtGrantIssuer Trust OAuth2 JWT Bearer Grant Type Issuer @@ -526,37 +526,37 @@ to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiTrustOAuth2JwtGrantIssuerRequest + @return OAuth2APITrustOAuth2JwtGrantIssuerRequest */ - TrustOAuth2JwtGrantIssuer(ctx context.Context) OAuth2ApiTrustOAuth2JwtGrantIssuerRequest + TrustOAuth2JwtGrantIssuer(ctx context.Context) OAuth2APITrustOAuth2JwtGrantIssuerRequest // TrustOAuth2JwtGrantIssuerExecute executes the request // @return TrustedOAuth2JwtGrantIssuer - TrustOAuth2JwtGrantIssuerExecute(r OAuth2ApiTrustOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) + TrustOAuth2JwtGrantIssuerExecute(r OAuth2APITrustOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) } -// OAuth2ApiService OAuth2Api service -type OAuth2ApiService service +// OAuth2APIService OAuth2API service +type OAuth2APIService service -type OAuth2ApiAcceptOAuth2ConsentRequestRequest struct { +type OAuth2APIAcceptOAuth2ConsentRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API consentChallenge *string acceptOAuth2ConsentRequest *AcceptOAuth2ConsentRequest } // OAuth 2.0 Consent Request Challenge -func (r OAuth2ApiAcceptOAuth2ConsentRequestRequest) ConsentChallenge(consentChallenge string) OAuth2ApiAcceptOAuth2ConsentRequestRequest { +func (r OAuth2APIAcceptOAuth2ConsentRequestRequest) ConsentChallenge(consentChallenge string) OAuth2APIAcceptOAuth2ConsentRequestRequest { r.consentChallenge = &consentChallenge return r } -func (r OAuth2ApiAcceptOAuth2ConsentRequestRequest) AcceptOAuth2ConsentRequest(acceptOAuth2ConsentRequest AcceptOAuth2ConsentRequest) OAuth2ApiAcceptOAuth2ConsentRequestRequest { +func (r OAuth2APIAcceptOAuth2ConsentRequestRequest) AcceptOAuth2ConsentRequest(acceptOAuth2ConsentRequest AcceptOAuth2ConsentRequest) OAuth2APIAcceptOAuth2ConsentRequestRequest { r.acceptOAuth2ConsentRequest = &acceptOAuth2ConsentRequest return r } -func (r OAuth2ApiAcceptOAuth2ConsentRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { +func (r OAuth2APIAcceptOAuth2ConsentRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { return r.ApiService.AcceptOAuth2ConsentRequestExecute(r) } @@ -581,10 +581,10 @@ The default consent provider is available via the Ory Managed Account Experience head over to the OAuth 2.0 documentation. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiAcceptOAuth2ConsentRequestRequest + @return OAuth2APIAcceptOAuth2ConsentRequestRequest */ -func (a *OAuth2ApiService) AcceptOAuth2ConsentRequest(ctx context.Context) OAuth2ApiAcceptOAuth2ConsentRequestRequest { - return OAuth2ApiAcceptOAuth2ConsentRequestRequest{ +func (a *OAuth2APIService) AcceptOAuth2ConsentRequest(ctx context.Context) OAuth2APIAcceptOAuth2ConsentRequestRequest { + return OAuth2APIAcceptOAuth2ConsentRequestRequest{ ApiService: a, ctx: ctx, } @@ -592,7 +592,7 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequest(ctx context.Context) OAuth // Execute executes the request // @return OAuth2RedirectTo -func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r OAuth2ApiAcceptOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { +func (a *OAuth2APIService) AcceptOAuth2ConsentRequestExecute(r OAuth2APIAcceptOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -600,7 +600,7 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r OAuth2ApiAcceptOA localVarReturnValue *OAuth2RedirectTo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.AcceptOAuth2ConsentRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.AcceptOAuth2ConsentRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -614,7 +614,7 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r OAuth2ApiAcceptOA return localVarReturnValue, nil, reportError("consentChallenge is required and must be specified") } - localVarQueryParams.Add("consent_challenge", parameterToString(*r.consentChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "consent_challenge", r.consentChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -644,9 +644,9 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r OAuth2ApiAcceptOA return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -662,7 +662,8 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r OAuth2ApiAcceptOA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -678,25 +679,25 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r OAuth2ApiAcceptOA return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiAcceptOAuth2LoginRequestRequest struct { +type OAuth2APIAcceptOAuth2LoginRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API loginChallenge *string acceptOAuth2LoginRequest *AcceptOAuth2LoginRequest } // OAuth 2.0 Login Request Challenge -func (r OAuth2ApiAcceptOAuth2LoginRequestRequest) LoginChallenge(loginChallenge string) OAuth2ApiAcceptOAuth2LoginRequestRequest { +func (r OAuth2APIAcceptOAuth2LoginRequestRequest) LoginChallenge(loginChallenge string) OAuth2APIAcceptOAuth2LoginRequestRequest { r.loginChallenge = &loginChallenge return r } -func (r OAuth2ApiAcceptOAuth2LoginRequestRequest) AcceptOAuth2LoginRequest(acceptOAuth2LoginRequest AcceptOAuth2LoginRequest) OAuth2ApiAcceptOAuth2LoginRequestRequest { +func (r OAuth2APIAcceptOAuth2LoginRequestRequest) AcceptOAuth2LoginRequest(acceptOAuth2LoginRequest AcceptOAuth2LoginRequest) OAuth2APIAcceptOAuth2LoginRequestRequest { r.acceptOAuth2LoginRequest = &acceptOAuth2LoginRequest return r } -func (r OAuth2ApiAcceptOAuth2LoginRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { +func (r OAuth2APIAcceptOAuth2LoginRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { return r.ApiService.AcceptOAuth2LoginRequestExecute(r) } @@ -716,10 +717,10 @@ a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiAcceptOAuth2LoginRequestRequest + @return OAuth2APIAcceptOAuth2LoginRequestRequest */ -func (a *OAuth2ApiService) AcceptOAuth2LoginRequest(ctx context.Context) OAuth2ApiAcceptOAuth2LoginRequestRequest { - return OAuth2ApiAcceptOAuth2LoginRequestRequest{ +func (a *OAuth2APIService) AcceptOAuth2LoginRequest(ctx context.Context) OAuth2APIAcceptOAuth2LoginRequestRequest { + return OAuth2APIAcceptOAuth2LoginRequestRequest{ ApiService: a, ctx: ctx, } @@ -727,7 +728,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequest(ctx context.Context) OAuth2A // Execute executes the request // @return OAuth2RedirectTo -func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r OAuth2ApiAcceptOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { +func (a *OAuth2APIService) AcceptOAuth2LoginRequestExecute(r OAuth2APIAcceptOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -735,7 +736,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r OAuth2ApiAcceptOAut localVarReturnValue *OAuth2RedirectTo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.AcceptOAuth2LoginRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.AcceptOAuth2LoginRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -749,7 +750,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r OAuth2ApiAcceptOAut return localVarReturnValue, nil, reportError("loginChallenge is required and must be specified") } - localVarQueryParams.Add("login_challenge", parameterToString(*r.loginChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "login_challenge", r.loginChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -779,9 +780,9 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r OAuth2ApiAcceptOAut return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -797,7 +798,8 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r OAuth2ApiAcceptOAut newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -813,19 +815,19 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r OAuth2ApiAcceptOAut return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiAcceptOAuth2LogoutRequestRequest struct { +type OAuth2APIAcceptOAuth2LogoutRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API logoutChallenge *string } // OAuth 2.0 Logout Request Challenge -func (r OAuth2ApiAcceptOAuth2LogoutRequestRequest) LogoutChallenge(logoutChallenge string) OAuth2ApiAcceptOAuth2LogoutRequestRequest { +func (r OAuth2APIAcceptOAuth2LogoutRequestRequest) LogoutChallenge(logoutChallenge string) OAuth2APIAcceptOAuth2LogoutRequestRequest { r.logoutChallenge = &logoutChallenge return r } -func (r OAuth2ApiAcceptOAuth2LogoutRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { +func (r OAuth2APIAcceptOAuth2LogoutRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { return r.ApiService.AcceptOAuth2LogoutRequestExecute(r) } @@ -837,10 +839,10 @@ When a user or an application requests Ory OAuth 2.0 to remove the session state The response contains a redirect URL which the consent provider should redirect the user-agent to. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiAcceptOAuth2LogoutRequestRequest + @return OAuth2APIAcceptOAuth2LogoutRequestRequest */ -func (a *OAuth2ApiService) AcceptOAuth2LogoutRequest(ctx context.Context) OAuth2ApiAcceptOAuth2LogoutRequestRequest { - return OAuth2ApiAcceptOAuth2LogoutRequestRequest{ +func (a *OAuth2APIService) AcceptOAuth2LogoutRequest(ctx context.Context) OAuth2APIAcceptOAuth2LogoutRequestRequest { + return OAuth2APIAcceptOAuth2LogoutRequestRequest{ ApiService: a, ctx: ctx, } @@ -848,7 +850,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequest(ctx context.Context) OAuth2 // Execute executes the request // @return OAuth2RedirectTo -func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r OAuth2ApiAcceptOAuth2LogoutRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { +func (a *OAuth2APIService) AcceptOAuth2LogoutRequestExecute(r OAuth2APIAcceptOAuth2LogoutRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -856,7 +858,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r OAuth2ApiAcceptOAu localVarReturnValue *OAuth2RedirectTo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.AcceptOAuth2LogoutRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.AcceptOAuth2LogoutRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -870,7 +872,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r OAuth2ApiAcceptOAu return localVarReturnValue, nil, reportError("logoutChallenge is required and must be specified") } - localVarQueryParams.Add("logout_challenge", parameterToString(*r.logoutChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "logout_challenge", r.logoutChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -898,9 +900,9 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r OAuth2ApiAcceptOAu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -916,7 +918,8 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r OAuth2ApiAcceptOAu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -932,19 +935,19 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r OAuth2ApiAcceptOAu return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiCreateOAuth2ClientRequest struct { +type OAuth2APICreateOAuth2ClientRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API oAuth2Client *OAuth2Client } // OAuth 2.0 Client Request Body -func (r OAuth2ApiCreateOAuth2ClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OAuth2ApiCreateOAuth2ClientRequest { +func (r OAuth2APICreateOAuth2ClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OAuth2APICreateOAuth2ClientRequest { r.oAuth2Client = &oAuth2Client return r } -func (r OAuth2ApiCreateOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OAuth2APICreateOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.CreateOAuth2ClientExecute(r) } @@ -955,10 +958,10 @@ Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, o is generated. The secret is echoed in the response. It is not possible to retrieve it later on. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiCreateOAuth2ClientRequest + @return OAuth2APICreateOAuth2ClientRequest */ -func (a *OAuth2ApiService) CreateOAuth2Client(ctx context.Context) OAuth2ApiCreateOAuth2ClientRequest { - return OAuth2ApiCreateOAuth2ClientRequest{ +func (a *OAuth2APIService) CreateOAuth2Client(ctx context.Context) OAuth2APICreateOAuth2ClientRequest { + return OAuth2APICreateOAuth2ClientRequest{ ApiService: a, ctx: ctx, } @@ -966,7 +969,7 @@ func (a *OAuth2ApiService) CreateOAuth2Client(ctx context.Context) OAuth2ApiCrea // Execute executes the request // @return OAuth2Client -func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r OAuth2ApiCreateOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { +func (a *OAuth2APIService) CreateOAuth2ClientExecute(r OAuth2APICreateOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -974,7 +977,7 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r OAuth2ApiCreateOAuth2Clie localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.CreateOAuth2Client") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.CreateOAuth2Client") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1017,9 +1020,9 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r OAuth2ApiCreateOAuth2Clie return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -1036,7 +1039,8 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r OAuth2ApiCreateOAuth2Clie newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -1045,7 +1049,8 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r OAuth2ApiCreateOAuth2Clie newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1061,13 +1066,13 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r OAuth2ApiCreateOAuth2Clie return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiDeleteOAuth2ClientRequest struct { +type OAuth2APIDeleteOAuth2ClientRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API id string } -func (r OAuth2ApiDeleteOAuth2ClientRequest) Execute() (*http.Response, error) { +func (r OAuth2APIDeleteOAuth2ClientRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOAuth2ClientExecute(r) } @@ -1083,10 +1088,10 @@ Make sure that this endpoint is well protected and only callable by first-party @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OAuth2ApiDeleteOAuth2ClientRequest + @return OAuth2APIDeleteOAuth2ClientRequest */ -func (a *OAuth2ApiService) DeleteOAuth2Client(ctx context.Context, id string) OAuth2ApiDeleteOAuth2ClientRequest { - return OAuth2ApiDeleteOAuth2ClientRequest{ +func (a *OAuth2APIService) DeleteOAuth2Client(ctx context.Context, id string) OAuth2APIDeleteOAuth2ClientRequest { + return OAuth2APIDeleteOAuth2ClientRequest{ ApiService: a, ctx: ctx, id: id, @@ -1094,20 +1099,20 @@ func (a *OAuth2ApiService) DeleteOAuth2Client(ctx context.Context, id string) OA } // Execute executes the request -func (a *OAuth2ApiService) DeleteOAuth2ClientExecute(r OAuth2ApiDeleteOAuth2ClientRequest) (*http.Response, error) { +func (a *OAuth2APIService) DeleteOAuth2ClientExecute(r OAuth2APIDeleteOAuth2ClientRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.DeleteOAuth2Client") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.DeleteOAuth2Client") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/clients/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1140,9 +1145,9 @@ func (a *OAuth2ApiService) DeleteOAuth2ClientExecute(r OAuth2ApiDeleteOAuth2Clie return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1158,26 +1163,27 @@ func (a *OAuth2ApiService) DeleteOAuth2ClientExecute(r OAuth2ApiDeleteOAuth2Clie newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OAuth2ApiDeleteOAuth2TokenRequest struct { +type OAuth2APIDeleteOAuth2TokenRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API clientId *string } // OAuth 2.0 Client ID -func (r OAuth2ApiDeleteOAuth2TokenRequest) ClientId(clientId string) OAuth2ApiDeleteOAuth2TokenRequest { +func (r OAuth2APIDeleteOAuth2TokenRequest) ClientId(clientId string) OAuth2APIDeleteOAuth2TokenRequest { r.clientId = &clientId return r } -func (r OAuth2ApiDeleteOAuth2TokenRequest) Execute() (*http.Response, error) { +func (r OAuth2APIDeleteOAuth2TokenRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOAuth2TokenExecute(r) } @@ -1187,24 +1193,24 @@ DeleteOAuth2Token Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiDeleteOAuth2TokenRequest + @return OAuth2APIDeleteOAuth2TokenRequest */ -func (a *OAuth2ApiService) DeleteOAuth2Token(ctx context.Context) OAuth2ApiDeleteOAuth2TokenRequest { - return OAuth2ApiDeleteOAuth2TokenRequest{ +func (a *OAuth2APIService) DeleteOAuth2Token(ctx context.Context) OAuth2APIDeleteOAuth2TokenRequest { + return OAuth2APIDeleteOAuth2TokenRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -func (a *OAuth2ApiService) DeleteOAuth2TokenExecute(r OAuth2ApiDeleteOAuth2TokenRequest) (*http.Response, error) { +func (a *OAuth2APIService) DeleteOAuth2TokenExecute(r OAuth2APIDeleteOAuth2TokenRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.DeleteOAuth2Token") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.DeleteOAuth2Token") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -1218,7 +1224,7 @@ func (a *OAuth2ApiService) DeleteOAuth2TokenExecute(r OAuth2ApiDeleteOAuth2Token return nil, reportError("clientId is required and must be specified") } - localVarQueryParams.Add("client_id", parameterToString(*r.clientId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "client_id", r.clientId, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1246,9 +1252,9 @@ func (a *OAuth2ApiService) DeleteOAuth2TokenExecute(r OAuth2ApiDeleteOAuth2Token return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1264,20 +1270,21 @@ func (a *OAuth2ApiService) DeleteOAuth2TokenExecute(r OAuth2ApiDeleteOAuth2Token newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest struct { +type OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API id string } -func (r OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest) Execute() (*http.Response, error) { +func (r OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteTrustedOAuth2JwtGrantIssuerExecute(r) } @@ -1292,10 +1299,10 @@ for OAuth 2.0 Client Authentication and Authorization Grant. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the desired grant - @return OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest + @return OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest */ -func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest { - return OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest{ +func (a *OAuth2APIService) DeleteTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest { + return OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest{ ApiService: a, ctx: ctx, id: id, @@ -1303,20 +1310,20 @@ func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuer(ctx context.Context } // Execute executes the request -func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiDeleteTrustedOAuth2JwtGrantIssuerRequest) (*http.Response, error) { +func (a *OAuth2APIService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r OAuth2APIDeleteTrustedOAuth2JwtGrantIssuerRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.DeleteTrustedOAuth2JwtGrantIssuer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.DeleteTrustedOAuth2JwtGrantIssuer") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/trust/grants/jwt-bearer/issuers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1349,9 +1356,9 @@ func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiD return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1367,20 +1374,21 @@ func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiD newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OAuth2ApiGetOAuth2ClientRequest struct { +type OAuth2APIGetOAuth2ClientRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API id string } -func (r OAuth2ApiGetOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OAuth2APIGetOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.GetOAuth2ClientExecute(r) } @@ -1394,10 +1402,10 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OAuth2ApiGetOAuth2ClientRequest + @return OAuth2APIGetOAuth2ClientRequest */ -func (a *OAuth2ApiService) GetOAuth2Client(ctx context.Context, id string) OAuth2ApiGetOAuth2ClientRequest { - return OAuth2ApiGetOAuth2ClientRequest{ +func (a *OAuth2APIService) GetOAuth2Client(ctx context.Context, id string) OAuth2APIGetOAuth2ClientRequest { + return OAuth2APIGetOAuth2ClientRequest{ ApiService: a, ctx: ctx, id: id, @@ -1406,7 +1414,7 @@ func (a *OAuth2ApiService) GetOAuth2Client(ctx context.Context, id string) OAuth // Execute executes the request // @return OAuth2Client -func (a *OAuth2ApiService) GetOAuth2ClientExecute(r OAuth2ApiGetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { +func (a *OAuth2APIService) GetOAuth2ClientExecute(r OAuth2APIGetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1414,13 +1422,13 @@ func (a *OAuth2ApiService) GetOAuth2ClientExecute(r OAuth2ApiGetOAuth2ClientRequ localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.GetOAuth2Client") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.GetOAuth2Client") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/clients/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1453,9 +1461,9 @@ func (a *OAuth2ApiService) GetOAuth2ClientExecute(r OAuth2ApiGetOAuth2ClientRequ return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -1471,7 +1479,8 @@ func (a *OAuth2ApiService) GetOAuth2ClientExecute(r OAuth2ApiGetOAuth2ClientRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1487,19 +1496,19 @@ func (a *OAuth2ApiService) GetOAuth2ClientExecute(r OAuth2ApiGetOAuth2ClientRequ return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiGetOAuth2ConsentRequestRequest struct { +type OAuth2APIGetOAuth2ConsentRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API consentChallenge *string } // OAuth 2.0 Consent Request Challenge -func (r OAuth2ApiGetOAuth2ConsentRequestRequest) ConsentChallenge(consentChallenge string) OAuth2ApiGetOAuth2ConsentRequestRequest { +func (r OAuth2APIGetOAuth2ConsentRequestRequest) ConsentChallenge(consentChallenge string) OAuth2APIGetOAuth2ConsentRequestRequest { r.consentChallenge = &consentChallenge return r } -func (r OAuth2ApiGetOAuth2ConsentRequestRequest) Execute() (*OAuth2ConsentRequest, *http.Response, error) { +func (r OAuth2APIGetOAuth2ConsentRequestRequest) Execute() (*OAuth2ConsentRequest, *http.Response, error) { return r.ApiService.GetOAuth2ConsentRequestExecute(r) } @@ -1518,10 +1527,10 @@ The default consent provider is available via the Ory Managed Account Experience head over to the OAuth 2.0 documentation. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiGetOAuth2ConsentRequestRequest + @return OAuth2APIGetOAuth2ConsentRequestRequest */ -func (a *OAuth2ApiService) GetOAuth2ConsentRequest(ctx context.Context) OAuth2ApiGetOAuth2ConsentRequestRequest { - return OAuth2ApiGetOAuth2ConsentRequestRequest{ +func (a *OAuth2APIService) GetOAuth2ConsentRequest(ctx context.Context) OAuth2APIGetOAuth2ConsentRequestRequest { + return OAuth2APIGetOAuth2ConsentRequestRequest{ ApiService: a, ctx: ctx, } @@ -1529,7 +1538,7 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequest(ctx context.Context) OAuth2Ap // Execute executes the request // @return OAuth2ConsentRequest -func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2ConsentRequestRequest) (*OAuth2ConsentRequest, *http.Response, error) { +func (a *OAuth2APIService) GetOAuth2ConsentRequestExecute(r OAuth2APIGetOAuth2ConsentRequestRequest) (*OAuth2ConsentRequest, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1537,7 +1546,7 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2Co localVarReturnValue *OAuth2ConsentRequest ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.GetOAuth2ConsentRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.GetOAuth2ConsentRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1551,7 +1560,7 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2Co return localVarReturnValue, nil, reportError("consentChallenge is required and must be specified") } - localVarQueryParams.Add("consent_challenge", parameterToString(*r.consentChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "consent_challenge", r.consentChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1579,9 +1588,9 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2Co return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -1598,7 +1607,8 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2Co newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -1607,7 +1617,8 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2Co newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1623,19 +1634,19 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r OAuth2ApiGetOAuth2Co return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiGetOAuth2LoginRequestRequest struct { +type OAuth2APIGetOAuth2LoginRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API loginChallenge *string } // OAuth 2.0 Login Request Challenge -func (r OAuth2ApiGetOAuth2LoginRequestRequest) LoginChallenge(loginChallenge string) OAuth2ApiGetOAuth2LoginRequestRequest { +func (r OAuth2APIGetOAuth2LoginRequestRequest) LoginChallenge(loginChallenge string) OAuth2APIGetOAuth2LoginRequestRequest { r.loginChallenge = &loginChallenge return r } -func (r OAuth2ApiGetOAuth2LoginRequestRequest) Execute() (*OAuth2LoginRequest, *http.Response, error) { +func (r OAuth2APIGetOAuth2LoginRequestRequest) Execute() (*OAuth2LoginRequest, *http.Response, error) { return r.ApiService.GetOAuth2LoginRequestExecute(r) } @@ -1653,10 +1664,10 @@ The authentication challenge is appended to the login provider URL to which the provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiGetOAuth2LoginRequestRequest + @return OAuth2APIGetOAuth2LoginRequestRequest */ -func (a *OAuth2ApiService) GetOAuth2LoginRequest(ctx context.Context) OAuth2ApiGetOAuth2LoginRequestRequest { - return OAuth2ApiGetOAuth2LoginRequestRequest{ +func (a *OAuth2APIService) GetOAuth2LoginRequest(ctx context.Context) OAuth2APIGetOAuth2LoginRequestRequest { + return OAuth2APIGetOAuth2LoginRequestRequest{ ApiService: a, ctx: ctx, } @@ -1664,7 +1675,7 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequest(ctx context.Context) OAuth2ApiG // Execute executes the request // @return OAuth2LoginRequest -func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2LoginRequestRequest) (*OAuth2LoginRequest, *http.Response, error) { +func (a *OAuth2APIService) GetOAuth2LoginRequestExecute(r OAuth2APIGetOAuth2LoginRequestRequest) (*OAuth2LoginRequest, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1672,7 +1683,7 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2Logi localVarReturnValue *OAuth2LoginRequest ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.GetOAuth2LoginRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.GetOAuth2LoginRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1686,7 +1697,7 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2Logi return localVarReturnValue, nil, reportError("loginChallenge is required and must be specified") } - localVarQueryParams.Add("login_challenge", parameterToString(*r.loginChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "login_challenge", r.loginChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1714,9 +1725,9 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2Logi return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -1733,7 +1744,8 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2Logi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -1742,7 +1754,8 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2Logi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1758,18 +1771,18 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r OAuth2ApiGetOAuth2Logi return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiGetOAuth2LogoutRequestRequest struct { +type OAuth2APIGetOAuth2LogoutRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API logoutChallenge *string } -func (r OAuth2ApiGetOAuth2LogoutRequestRequest) LogoutChallenge(logoutChallenge string) OAuth2ApiGetOAuth2LogoutRequestRequest { +func (r OAuth2APIGetOAuth2LogoutRequestRequest) LogoutChallenge(logoutChallenge string) OAuth2APIGetOAuth2LogoutRequestRequest { r.logoutChallenge = &logoutChallenge return r } -func (r OAuth2ApiGetOAuth2LogoutRequestRequest) Execute() (*OAuth2LogoutRequest, *http.Response, error) { +func (r OAuth2APIGetOAuth2LogoutRequestRequest) Execute() (*OAuth2LogoutRequest, *http.Response, error) { return r.ApiService.GetOAuth2LogoutRequestExecute(r) } @@ -1779,10 +1792,10 @@ GetOAuth2LogoutRequest Get OAuth 2.0 Session Logout Request Use this endpoint to fetch an Ory OAuth 2.0 logout request. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiGetOAuth2LogoutRequestRequest + @return OAuth2APIGetOAuth2LogoutRequestRequest */ -func (a *OAuth2ApiService) GetOAuth2LogoutRequest(ctx context.Context) OAuth2ApiGetOAuth2LogoutRequestRequest { - return OAuth2ApiGetOAuth2LogoutRequestRequest{ +func (a *OAuth2APIService) GetOAuth2LogoutRequest(ctx context.Context) OAuth2APIGetOAuth2LogoutRequestRequest { + return OAuth2APIGetOAuth2LogoutRequestRequest{ ApiService: a, ctx: ctx, } @@ -1790,7 +1803,7 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequest(ctx context.Context) OAuth2Api // Execute executes the request // @return OAuth2LogoutRequest -func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2LogoutRequestRequest) (*OAuth2LogoutRequest, *http.Response, error) { +func (a *OAuth2APIService) GetOAuth2LogoutRequestExecute(r OAuth2APIGetOAuth2LogoutRequestRequest) (*OAuth2LogoutRequest, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1798,7 +1811,7 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2Log localVarReturnValue *OAuth2LogoutRequest ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.GetOAuth2LogoutRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.GetOAuth2LogoutRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1812,7 +1825,7 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2Log return localVarReturnValue, nil, reportError("logoutChallenge is required and must be specified") } - localVarQueryParams.Add("logout_challenge", parameterToString(*r.logoutChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "logout_challenge", r.logoutChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1840,9 +1853,9 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2Log return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -1859,7 +1872,8 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2Log newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -1868,7 +1882,8 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2Log newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1884,13 +1899,13 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r OAuth2ApiGetOAuth2Log return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest struct { +type OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API id string } -func (r OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest) Execute() (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { +func (r OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest) Execute() (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { return r.ApiService.GetTrustedOAuth2JwtGrantIssuerExecute(r) } @@ -1902,10 +1917,10 @@ created the trust relationship. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the desired grant - @return OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest + @return OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest */ -func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest { - return OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest{ +func (a *OAuth2APIService) GetTrustedOAuth2JwtGrantIssuer(ctx context.Context, id string) OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest { + return OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest{ ApiService: a, ctx: ctx, id: id, @@ -1914,7 +1929,7 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuer(ctx context.Context, i // Execute executes the request // @return TrustedOAuth2JwtGrantIssuer -func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiGetTrustedOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { +func (a *OAuth2APIService) GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2APIGetTrustedOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1922,13 +1937,13 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiGetT localVarReturnValue *TrustedOAuth2JwtGrantIssuer ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.GetTrustedOAuth2JwtGrantIssuer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.GetTrustedOAuth2JwtGrantIssuer") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/trust/grants/jwt-bearer/issuers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1961,9 +1976,9 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiGetT return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -1979,7 +1994,8 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiGetT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1995,26 +2011,26 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r OAuth2ApiGetT return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiIntrospectOAuth2TokenRequest struct { +type OAuth2APIIntrospectOAuth2TokenRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API token *string scope *string } // The string value of the token. For access tokens, this is the \\\"access_token\\\" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the \\\"refresh_token\\\" value returned. -func (r OAuth2ApiIntrospectOAuth2TokenRequest) Token(token string) OAuth2ApiIntrospectOAuth2TokenRequest { +func (r OAuth2APIIntrospectOAuth2TokenRequest) Token(token string) OAuth2APIIntrospectOAuth2TokenRequest { r.token = &token return r } // An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false. -func (r OAuth2ApiIntrospectOAuth2TokenRequest) Scope(scope string) OAuth2ApiIntrospectOAuth2TokenRequest { +func (r OAuth2APIIntrospectOAuth2TokenRequest) Scope(scope string) OAuth2APIIntrospectOAuth2TokenRequest { r.scope = &scope return r } -func (r OAuth2ApiIntrospectOAuth2TokenRequest) Execute() (*IntrospectedOAuth2Token, *http.Response, error) { +func (r OAuth2APIIntrospectOAuth2TokenRequest) Execute() (*IntrospectedOAuth2Token, *http.Response, error) { return r.ApiService.IntrospectOAuth2TokenExecute(r) } @@ -2026,10 +2042,10 @@ is neither expired nor revoked. If a token is active, additional information on set additional data for a token by setting `session.access_token` during the consent flow. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiIntrospectOAuth2TokenRequest + @return OAuth2APIIntrospectOAuth2TokenRequest */ -func (a *OAuth2ApiService) IntrospectOAuth2Token(ctx context.Context) OAuth2ApiIntrospectOAuth2TokenRequest { - return OAuth2ApiIntrospectOAuth2TokenRequest{ +func (a *OAuth2APIService) IntrospectOAuth2Token(ctx context.Context) OAuth2APIIntrospectOAuth2TokenRequest { + return OAuth2APIIntrospectOAuth2TokenRequest{ ApiService: a, ctx: ctx, } @@ -2037,7 +2053,7 @@ func (a *OAuth2ApiService) IntrospectOAuth2Token(ctx context.Context) OAuth2ApiI // Execute executes the request // @return IntrospectedOAuth2Token -func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r OAuth2ApiIntrospectOAuth2TokenRequest) (*IntrospectedOAuth2Token, *http.Response, error) { +func (a *OAuth2APIService) IntrospectOAuth2TokenExecute(r OAuth2APIIntrospectOAuth2TokenRequest) (*IntrospectedOAuth2Token, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -2045,7 +2061,7 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r OAuth2ApiIntrospectOAu localVarReturnValue *IntrospectedOAuth2Token ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.IntrospectOAuth2Token") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.IntrospectOAuth2Token") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -2077,9 +2093,9 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r OAuth2ApiIntrospectOAu localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.scope != nil { - localVarFormParams.Add("scope", parameterToString(*r.scope, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "scope", r.scope, "") } - localVarFormParams.Add("token", parameterToString(*r.token, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "token", r.token, "") req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2090,9 +2106,9 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r OAuth2ApiIntrospectOAu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -2108,7 +2124,8 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r OAuth2ApiIntrospectOAu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2124,9 +2141,9 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r OAuth2ApiIntrospectOAu return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiListOAuth2ClientsRequest struct { +type OAuth2APIListOAuth2ClientsRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API pageSize *int64 pageToken *string clientName *string @@ -2134,30 +2151,30 @@ type OAuth2ApiListOAuth2ClientsRequest struct { } // Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). -func (r OAuth2ApiListOAuth2ClientsRequest) PageSize(pageSize int64) OAuth2ApiListOAuth2ClientsRequest { +func (r OAuth2APIListOAuth2ClientsRequest) PageSize(pageSize int64) OAuth2APIListOAuth2ClientsRequest { r.pageSize = &pageSize return r } // Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). -func (r OAuth2ApiListOAuth2ClientsRequest) PageToken(pageToken string) OAuth2ApiListOAuth2ClientsRequest { +func (r OAuth2APIListOAuth2ClientsRequest) PageToken(pageToken string) OAuth2APIListOAuth2ClientsRequest { r.pageToken = &pageToken return r } // The name of the clients to filter by. -func (r OAuth2ApiListOAuth2ClientsRequest) ClientName(clientName string) OAuth2ApiListOAuth2ClientsRequest { +func (r OAuth2APIListOAuth2ClientsRequest) ClientName(clientName string) OAuth2APIListOAuth2ClientsRequest { r.clientName = &clientName return r } // The owner of the clients to filter by. -func (r OAuth2ApiListOAuth2ClientsRequest) Owner(owner string) OAuth2ApiListOAuth2ClientsRequest { +func (r OAuth2APIListOAuth2ClientsRequest) Owner(owner string) OAuth2APIListOAuth2ClientsRequest { r.owner = &owner return r } -func (r OAuth2ApiListOAuth2ClientsRequest) Execute() ([]OAuth2Client, *http.Response, error) { +func (r OAuth2APIListOAuth2ClientsRequest) Execute() ([]OAuth2Client, *http.Response, error) { return r.ApiService.ListOAuth2ClientsExecute(r) } @@ -2168,10 +2185,10 @@ This endpoint lists all clients in the database, and never returns client secret As a default it lists the first 100 clients. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiListOAuth2ClientsRequest + @return OAuth2APIListOAuth2ClientsRequest */ -func (a *OAuth2ApiService) ListOAuth2Clients(ctx context.Context) OAuth2ApiListOAuth2ClientsRequest { - return OAuth2ApiListOAuth2ClientsRequest{ +func (a *OAuth2APIService) ListOAuth2Clients(ctx context.Context) OAuth2APIListOAuth2ClientsRequest { + return OAuth2APIListOAuth2ClientsRequest{ ApiService: a, ctx: ctx, } @@ -2179,7 +2196,7 @@ func (a *OAuth2ApiService) ListOAuth2Clients(ctx context.Context) OAuth2ApiListO // Execute executes the request // @return []OAuth2Client -func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r OAuth2ApiListOAuth2ClientsRequest) ([]OAuth2Client, *http.Response, error) { +func (a *OAuth2APIService) ListOAuth2ClientsExecute(r OAuth2APIListOAuth2ClientsRequest) ([]OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -2187,7 +2204,7 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r OAuth2ApiListOAuth2Clients localVarReturnValue []OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.ListOAuth2Clients") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.ListOAuth2Clients") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -2199,16 +2216,22 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r OAuth2ApiListOAuth2Clients localVarFormParams := url.Values{} if r.pageSize != nil { - localVarQueryParams.Add("page_size", parameterToString(*r.pageSize, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "") + } else { + var defaultValue int64 = 250 + r.pageSize = &defaultValue } if r.pageToken != nil { - localVarQueryParams.Add("page_token", parameterToString(*r.pageToken, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "page_token", r.pageToken, "") + } else { + var defaultValue string = "1" + r.pageToken = &defaultValue } if r.clientName != nil { - localVarQueryParams.Add("client_name", parameterToString(*r.clientName, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "client_name", r.clientName, "") } if r.owner != nil { - localVarQueryParams.Add("owner", parameterToString(*r.owner, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "owner", r.owner, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2237,9 +2260,9 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r OAuth2ApiListOAuth2Clients return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -2255,7 +2278,8 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r OAuth2ApiListOAuth2Clients newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2271,9 +2295,9 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r OAuth2ApiListOAuth2Clients return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiListOAuth2ConsentSessionsRequest struct { +type OAuth2APIListOAuth2ConsentSessionsRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API subject *string pageSize *int64 pageToken *string @@ -2281,30 +2305,30 @@ type OAuth2ApiListOAuth2ConsentSessionsRequest struct { } // The subject to list the consent sessions for. -func (r OAuth2ApiListOAuth2ConsentSessionsRequest) Subject(subject string) OAuth2ApiListOAuth2ConsentSessionsRequest { +func (r OAuth2APIListOAuth2ConsentSessionsRequest) Subject(subject string) OAuth2APIListOAuth2ConsentSessionsRequest { r.subject = &subject return r } // Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). -func (r OAuth2ApiListOAuth2ConsentSessionsRequest) PageSize(pageSize int64) OAuth2ApiListOAuth2ConsentSessionsRequest { +func (r OAuth2APIListOAuth2ConsentSessionsRequest) PageSize(pageSize int64) OAuth2APIListOAuth2ConsentSessionsRequest { r.pageSize = &pageSize return r } // Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). -func (r OAuth2ApiListOAuth2ConsentSessionsRequest) PageToken(pageToken string) OAuth2ApiListOAuth2ConsentSessionsRequest { +func (r OAuth2APIListOAuth2ConsentSessionsRequest) PageToken(pageToken string) OAuth2APIListOAuth2ConsentSessionsRequest { r.pageToken = &pageToken return r } // The login session id to list the consent sessions for. -func (r OAuth2ApiListOAuth2ConsentSessionsRequest) LoginSessionId(loginSessionId string) OAuth2ApiListOAuth2ConsentSessionsRequest { +func (r OAuth2APIListOAuth2ConsentSessionsRequest) LoginSessionId(loginSessionId string) OAuth2APIListOAuth2ConsentSessionsRequest { r.loginSessionId = &loginSessionId return r } -func (r OAuth2ApiListOAuth2ConsentSessionsRequest) Execute() ([]OAuth2ConsentSession, *http.Response, error) { +func (r OAuth2APIListOAuth2ConsentSessionsRequest) Execute() ([]OAuth2ConsentSession, *http.Response, error) { return r.ApiService.ListOAuth2ConsentSessionsExecute(r) } @@ -2316,10 +2340,10 @@ If the subject is unknown or has not granted any consent sessions yet, the endpo empty JSON array with status code 200 OK. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiListOAuth2ConsentSessionsRequest + @return OAuth2APIListOAuth2ConsentSessionsRequest */ -func (a *OAuth2ApiService) ListOAuth2ConsentSessions(ctx context.Context) OAuth2ApiListOAuth2ConsentSessionsRequest { - return OAuth2ApiListOAuth2ConsentSessionsRequest{ +func (a *OAuth2APIService) ListOAuth2ConsentSessions(ctx context.Context) OAuth2APIListOAuth2ConsentSessionsRequest { + return OAuth2APIListOAuth2ConsentSessionsRequest{ ApiService: a, ctx: ctx, } @@ -2327,7 +2351,7 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessions(ctx context.Context) OAuth2 // Execute executes the request // @return []OAuth2ConsentSession -func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r OAuth2ApiListOAuth2ConsentSessionsRequest) ([]OAuth2ConsentSession, *http.Response, error) { +func (a *OAuth2APIService) ListOAuth2ConsentSessionsExecute(r OAuth2APIListOAuth2ConsentSessionsRequest) ([]OAuth2ConsentSession, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -2335,7 +2359,7 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r OAuth2ApiListOAuth localVarReturnValue []OAuth2ConsentSession ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.ListOAuth2ConsentSessions") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.ListOAuth2ConsentSessions") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -2350,14 +2374,20 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r OAuth2ApiListOAuth } if r.pageSize != nil { - localVarQueryParams.Add("page_size", parameterToString(*r.pageSize, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "") + } else { + var defaultValue int64 = 250 + r.pageSize = &defaultValue } if r.pageToken != nil { - localVarQueryParams.Add("page_token", parameterToString(*r.pageToken, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "page_token", r.pageToken, "") + } else { + var defaultValue string = "1" + r.pageToken = &defaultValue } - localVarQueryParams.Add("subject", parameterToString(*r.subject, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "subject", r.subject, "") if r.loginSessionId != nil { - localVarQueryParams.Add("login_session_id", parameterToString(*r.loginSessionId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "login_session_id", r.loginSessionId, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2386,9 +2416,9 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r OAuth2ApiListOAuth return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -2404,7 +2434,8 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r OAuth2ApiListOAuth newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2420,31 +2451,31 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r OAuth2ApiListOAuth return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest struct { +type OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API maxItems *int64 defaultItems *int64 issuer *string } -func (r OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest) MaxItems(maxItems int64) OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest { +func (r OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest) MaxItems(maxItems int64) OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest { r.maxItems = &maxItems return r } -func (r OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest) DefaultItems(defaultItems int64) OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest { +func (r OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest) DefaultItems(defaultItems int64) OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest { r.defaultItems = &defaultItems return r } // If optional \"issuer\" is supplied, only jwt-bearer grants with this issuer will be returned. -func (r OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest) Issuer(issuer string) OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest { +func (r OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest) Issuer(issuer string) OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest { r.issuer = &issuer return r } -func (r OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest) Execute() ([]TrustedOAuth2JwtGrantIssuer, *http.Response, error) { +func (r OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest) Execute() ([]TrustedOAuth2JwtGrantIssuer, *http.Response, error) { return r.ApiService.ListTrustedOAuth2JwtGrantIssuersExecute(r) } @@ -2454,10 +2485,10 @@ ListTrustedOAuth2JwtGrantIssuers List Trusted OAuth2 JWT Bearer Grant Type Issue Use this endpoint to list all trusted JWT Bearer Grant Type Issuers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest + @return OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest */ -func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuers(ctx context.Context) OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest { - return OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest{ +func (a *OAuth2APIService) ListTrustedOAuth2JwtGrantIssuers(ctx context.Context) OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest { + return OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest{ ApiService: a, ctx: ctx, } @@ -2465,7 +2496,7 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuers(ctx context.Context) // Execute executes the request // @return []TrustedOAuth2JwtGrantIssuer -func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2ApiListTrustedOAuth2JwtGrantIssuersRequest) ([]TrustedOAuth2JwtGrantIssuer, *http.Response, error) { +func (a *OAuth2APIService) ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2APIListTrustedOAuth2JwtGrantIssuersRequest) ([]TrustedOAuth2JwtGrantIssuer, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -2473,7 +2504,7 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2ApiLi localVarReturnValue []TrustedOAuth2JwtGrantIssuer ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.ListTrustedOAuth2JwtGrantIssuers") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.ListTrustedOAuth2JwtGrantIssuers") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -2485,13 +2516,13 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2ApiLi localVarFormParams := url.Values{} if r.maxItems != nil { - localVarQueryParams.Add("MaxItems", parameterToString(*r.maxItems, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "MaxItems", r.maxItems, "") } if r.defaultItems != nil { - localVarQueryParams.Add("DefaultItems", parameterToString(*r.defaultItems, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "DefaultItems", r.defaultItems, "") } if r.issuer != nil { - localVarQueryParams.Add("issuer", parameterToString(*r.issuer, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "issuer", r.issuer, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2520,9 +2551,9 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2ApiLi return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -2538,7 +2569,8 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2ApiLi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2554,12 +2586,12 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r OAuth2ApiLi return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiOAuth2AuthorizeRequest struct { +type OAuth2APIOAuth2AuthorizeRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API } -func (r OAuth2ApiOAuth2AuthorizeRequest) Execute() (*ErrorOAuth2, *http.Response, error) { +func (r OAuth2APIOAuth2AuthorizeRequest) Execute() (*ErrorOAuth2, *http.Response, error) { return r.ApiService.OAuth2AuthorizeExecute(r) } @@ -2572,10 +2604,10 @@ available for any programming language. You can find a list of libraries at http The Ory SDK is not yet able to this endpoint properly. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiOAuth2AuthorizeRequest + @return OAuth2APIOAuth2AuthorizeRequest */ -func (a *OAuth2ApiService) OAuth2Authorize(ctx context.Context) OAuth2ApiOAuth2AuthorizeRequest { - return OAuth2ApiOAuth2AuthorizeRequest{ +func (a *OAuth2APIService) OAuth2Authorize(ctx context.Context) OAuth2APIOAuth2AuthorizeRequest { + return OAuth2APIOAuth2AuthorizeRequest{ ApiService: a, ctx: ctx, } @@ -2583,7 +2615,7 @@ func (a *OAuth2ApiService) OAuth2Authorize(ctx context.Context) OAuth2ApiOAuth2A // Execute executes the request // @return ErrorOAuth2 -func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r OAuth2ApiOAuth2AuthorizeRequest) (*ErrorOAuth2, *http.Response, error) { +func (a *OAuth2APIService) OAuth2AuthorizeExecute(r OAuth2APIOAuth2AuthorizeRequest) (*ErrorOAuth2, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -2591,7 +2623,7 @@ func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r OAuth2ApiOAuth2AuthorizeRequ localVarReturnValue *ErrorOAuth2 ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.OAuth2Authorize") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.OAuth2Authorize") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -2629,9 +2661,9 @@ func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r OAuth2ApiOAuth2AuthorizeRequ return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -2647,7 +2679,8 @@ func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r OAuth2ApiOAuth2AuthorizeRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2663,9 +2696,9 @@ func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r OAuth2ApiOAuth2AuthorizeRequ return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiOauth2TokenExchangeRequest struct { +type OAuth2APIOauth2TokenExchangeRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API grantType *string clientId *string code *string @@ -2673,32 +2706,32 @@ type OAuth2ApiOauth2TokenExchangeRequest struct { refreshToken *string } -func (r OAuth2ApiOauth2TokenExchangeRequest) GrantType(grantType string) OAuth2ApiOauth2TokenExchangeRequest { +func (r OAuth2APIOauth2TokenExchangeRequest) GrantType(grantType string) OAuth2APIOauth2TokenExchangeRequest { r.grantType = &grantType return r } -func (r OAuth2ApiOauth2TokenExchangeRequest) ClientId(clientId string) OAuth2ApiOauth2TokenExchangeRequest { +func (r OAuth2APIOauth2TokenExchangeRequest) ClientId(clientId string) OAuth2APIOauth2TokenExchangeRequest { r.clientId = &clientId return r } -func (r OAuth2ApiOauth2TokenExchangeRequest) Code(code string) OAuth2ApiOauth2TokenExchangeRequest { +func (r OAuth2APIOauth2TokenExchangeRequest) Code(code string) OAuth2APIOauth2TokenExchangeRequest { r.code = &code return r } -func (r OAuth2ApiOauth2TokenExchangeRequest) RedirectUri(redirectUri string) OAuth2ApiOauth2TokenExchangeRequest { +func (r OAuth2APIOauth2TokenExchangeRequest) RedirectUri(redirectUri string) OAuth2APIOauth2TokenExchangeRequest { r.redirectUri = &redirectUri return r } -func (r OAuth2ApiOauth2TokenExchangeRequest) RefreshToken(refreshToken string) OAuth2ApiOauth2TokenExchangeRequest { +func (r OAuth2APIOauth2TokenExchangeRequest) RefreshToken(refreshToken string) OAuth2APIOauth2TokenExchangeRequest { r.refreshToken = &refreshToken return r } -func (r OAuth2ApiOauth2TokenExchangeRequest) Execute() (*OAuth2TokenExchange, *http.Response, error) { +func (r OAuth2APIOauth2TokenExchangeRequest) Execute() (*OAuth2TokenExchange, *http.Response, error) { return r.ApiService.Oauth2TokenExchangeExecute(r) } @@ -2711,10 +2744,10 @@ available for any programming language. You can find a list of libraries here ht The Ory SDK is not yet able to this endpoint properly. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiOauth2TokenExchangeRequest + @return OAuth2APIOauth2TokenExchangeRequest */ -func (a *OAuth2ApiService) Oauth2TokenExchange(ctx context.Context) OAuth2ApiOauth2TokenExchangeRequest { - return OAuth2ApiOauth2TokenExchangeRequest{ +func (a *OAuth2APIService) Oauth2TokenExchange(ctx context.Context) OAuth2APIOauth2TokenExchangeRequest { + return OAuth2APIOauth2TokenExchangeRequest{ ApiService: a, ctx: ctx, } @@ -2722,7 +2755,7 @@ func (a *OAuth2ApiService) Oauth2TokenExchange(ctx context.Context) OAuth2ApiOau // Execute executes the request // @return OAuth2TokenExchange -func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r OAuth2ApiOauth2TokenExchangeRequest) (*OAuth2TokenExchange, *http.Response, error) { +func (a *OAuth2APIService) Oauth2TokenExchangeExecute(r OAuth2APIOauth2TokenExchangeRequest) (*OAuth2TokenExchange, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -2730,7 +2763,7 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r OAuth2ApiOauth2TokenExch localVarReturnValue *OAuth2TokenExchange ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.Oauth2TokenExchange") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.Oauth2TokenExchange") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -2762,17 +2795,17 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r OAuth2ApiOauth2TokenExch localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.clientId != nil { - localVarFormParams.Add("client_id", parameterToString(*r.clientId, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "client_id", r.clientId, "") } if r.code != nil { - localVarFormParams.Add("code", parameterToString(*r.code, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "code", r.code, "") } - localVarFormParams.Add("grant_type", parameterToString(*r.grantType, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "grant_type", r.grantType, "") if r.redirectUri != nil { - localVarFormParams.Add("redirect_uri", parameterToString(*r.redirectUri, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "redirect_uri", r.redirectUri, "") } if r.refreshToken != nil { - localVarFormParams.Add("refresh_token", parameterToString(*r.refreshToken, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "refresh_token", r.refreshToken, "") } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { @@ -2784,9 +2817,9 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r OAuth2ApiOauth2TokenExch return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -2802,7 +2835,8 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r OAuth2ApiOauth2TokenExch newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2818,20 +2852,20 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r OAuth2ApiOauth2TokenExch return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiPatchOAuth2ClientRequest struct { +type OAuth2APIPatchOAuth2ClientRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API id string jsonPatch *[]JsonPatch } // OAuth 2.0 Client JSON Patch Body -func (r OAuth2ApiPatchOAuth2ClientRequest) JsonPatch(jsonPatch []JsonPatch) OAuth2ApiPatchOAuth2ClientRequest { +func (r OAuth2APIPatchOAuth2ClientRequest) JsonPatch(jsonPatch []JsonPatch) OAuth2APIPatchOAuth2ClientRequest { r.jsonPatch = &jsonPatch return r } -func (r OAuth2ApiPatchOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OAuth2APIPatchOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.PatchOAuth2ClientExecute(r) } @@ -2847,10 +2881,10 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OAuth2ApiPatchOAuth2ClientRequest + @return OAuth2APIPatchOAuth2ClientRequest */ -func (a *OAuth2ApiService) PatchOAuth2Client(ctx context.Context, id string) OAuth2ApiPatchOAuth2ClientRequest { - return OAuth2ApiPatchOAuth2ClientRequest{ +func (a *OAuth2APIService) PatchOAuth2Client(ctx context.Context, id string) OAuth2APIPatchOAuth2ClientRequest { + return OAuth2APIPatchOAuth2ClientRequest{ ApiService: a, ctx: ctx, id: id, @@ -2859,7 +2893,7 @@ func (a *OAuth2ApiService) PatchOAuth2Client(ctx context.Context, id string) OAu // Execute executes the request // @return OAuth2Client -func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r OAuth2ApiPatchOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { +func (a *OAuth2APIService) PatchOAuth2ClientExecute(r OAuth2APIPatchOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} @@ -2867,13 +2901,13 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r OAuth2ApiPatchOAuth2Client localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.PatchOAuth2Client") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.PatchOAuth2Client") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/clients/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2911,9 +2945,9 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r OAuth2ApiPatchOAuth2Client return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -2930,7 +2964,8 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r OAuth2ApiPatchOAuth2Client newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -2939,7 +2974,8 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r OAuth2ApiPatchOAuth2Client newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2955,25 +2991,25 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r OAuth2ApiPatchOAuth2Client return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiRejectOAuth2ConsentRequestRequest struct { +type OAuth2APIRejectOAuth2ConsentRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API consentChallenge *string rejectOAuth2Request *RejectOAuth2Request } // OAuth 2.0 Consent Request Challenge -func (r OAuth2ApiRejectOAuth2ConsentRequestRequest) ConsentChallenge(consentChallenge string) OAuth2ApiRejectOAuth2ConsentRequestRequest { +func (r OAuth2APIRejectOAuth2ConsentRequestRequest) ConsentChallenge(consentChallenge string) OAuth2APIRejectOAuth2ConsentRequestRequest { r.consentChallenge = &consentChallenge return r } -func (r OAuth2ApiRejectOAuth2ConsentRequestRequest) RejectOAuth2Request(rejectOAuth2Request RejectOAuth2Request) OAuth2ApiRejectOAuth2ConsentRequestRequest { +func (r OAuth2APIRejectOAuth2ConsentRequestRequest) RejectOAuth2Request(rejectOAuth2Request RejectOAuth2Request) OAuth2APIRejectOAuth2ConsentRequestRequest { r.rejectOAuth2Request = &rejectOAuth2Request return r } -func (r OAuth2ApiRejectOAuth2ConsentRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { +func (r OAuth2APIRejectOAuth2ConsentRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { return r.ApiService.RejectOAuth2ConsentRequestExecute(r) } @@ -2997,10 +3033,10 @@ The default consent provider is available via the Ory Managed Account Experience head over to the OAuth 2.0 documentation. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRejectOAuth2ConsentRequestRequest + @return OAuth2APIRejectOAuth2ConsentRequestRequest */ -func (a *OAuth2ApiService) RejectOAuth2ConsentRequest(ctx context.Context) OAuth2ApiRejectOAuth2ConsentRequestRequest { - return OAuth2ApiRejectOAuth2ConsentRequestRequest{ +func (a *OAuth2APIService) RejectOAuth2ConsentRequest(ctx context.Context) OAuth2APIRejectOAuth2ConsentRequestRequest { + return OAuth2APIRejectOAuth2ConsentRequestRequest{ ApiService: a, ctx: ctx, } @@ -3008,7 +3044,7 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequest(ctx context.Context) OAuth // Execute executes the request // @return OAuth2RedirectTo -func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r OAuth2ApiRejectOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { +func (a *OAuth2APIService) RejectOAuth2ConsentRequestExecute(r OAuth2APIRejectOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -3016,7 +3052,7 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r OAuth2ApiRejectOA localVarReturnValue *OAuth2RedirectTo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.RejectOAuth2ConsentRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.RejectOAuth2ConsentRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -3030,7 +3066,7 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r OAuth2ApiRejectOA return localVarReturnValue, nil, reportError("consentChallenge is required and must be specified") } - localVarQueryParams.Add("consent_challenge", parameterToString(*r.consentChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "consent_challenge", r.consentChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -3060,9 +3096,9 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r OAuth2ApiRejectOA return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -3078,7 +3114,8 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r OAuth2ApiRejectOA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3094,25 +3131,25 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r OAuth2ApiRejectOA return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiRejectOAuth2LoginRequestRequest struct { +type OAuth2APIRejectOAuth2LoginRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API loginChallenge *string rejectOAuth2Request *RejectOAuth2Request } // OAuth 2.0 Login Request Challenge -func (r OAuth2ApiRejectOAuth2LoginRequestRequest) LoginChallenge(loginChallenge string) OAuth2ApiRejectOAuth2LoginRequestRequest { +func (r OAuth2APIRejectOAuth2LoginRequestRequest) LoginChallenge(loginChallenge string) OAuth2APIRejectOAuth2LoginRequestRequest { r.loginChallenge = &loginChallenge return r } -func (r OAuth2ApiRejectOAuth2LoginRequestRequest) RejectOAuth2Request(rejectOAuth2Request RejectOAuth2Request) OAuth2ApiRejectOAuth2LoginRequestRequest { +func (r OAuth2APIRejectOAuth2LoginRequestRequest) RejectOAuth2Request(rejectOAuth2Request RejectOAuth2Request) OAuth2APIRejectOAuth2LoginRequestRequest { r.rejectOAuth2Request = &rejectOAuth2Request return r } -func (r OAuth2ApiRejectOAuth2LoginRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { +func (r OAuth2APIRejectOAuth2LoginRequestRequest) Execute() (*OAuth2RedirectTo, *http.Response, error) { return r.ApiService.RejectOAuth2LoginRequestExecute(r) } @@ -3131,10 +3168,10 @@ was denied. The response contains a redirect URL which the login provider should redirect the user-agent to. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRejectOAuth2LoginRequestRequest + @return OAuth2APIRejectOAuth2LoginRequestRequest */ -func (a *OAuth2ApiService) RejectOAuth2LoginRequest(ctx context.Context) OAuth2ApiRejectOAuth2LoginRequestRequest { - return OAuth2ApiRejectOAuth2LoginRequestRequest{ +func (a *OAuth2APIService) RejectOAuth2LoginRequest(ctx context.Context) OAuth2APIRejectOAuth2LoginRequestRequest { + return OAuth2APIRejectOAuth2LoginRequestRequest{ ApiService: a, ctx: ctx, } @@ -3142,7 +3179,7 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequest(ctx context.Context) OAuth2A // Execute executes the request // @return OAuth2RedirectTo -func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r OAuth2ApiRejectOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { +func (a *OAuth2APIService) RejectOAuth2LoginRequestExecute(r OAuth2APIRejectOAuth2LoginRequestRequest) (*OAuth2RedirectTo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -3150,7 +3187,7 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r OAuth2ApiRejectOAut localVarReturnValue *OAuth2RedirectTo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.RejectOAuth2LoginRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.RejectOAuth2LoginRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -3164,7 +3201,7 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r OAuth2ApiRejectOAut return localVarReturnValue, nil, reportError("loginChallenge is required and must be specified") } - localVarQueryParams.Add("login_challenge", parameterToString(*r.loginChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "login_challenge", r.loginChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -3194,9 +3231,9 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r OAuth2ApiRejectOAut return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -3212,7 +3249,8 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r OAuth2ApiRejectOAut newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3228,18 +3266,18 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r OAuth2ApiRejectOAut return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiRejectOAuth2LogoutRequestRequest struct { +type OAuth2APIRejectOAuth2LogoutRequestRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API logoutChallenge *string } -func (r OAuth2ApiRejectOAuth2LogoutRequestRequest) LogoutChallenge(logoutChallenge string) OAuth2ApiRejectOAuth2LogoutRequestRequest { +func (r OAuth2APIRejectOAuth2LogoutRequestRequest) LogoutChallenge(logoutChallenge string) OAuth2APIRejectOAuth2LogoutRequestRequest { r.logoutChallenge = &logoutChallenge return r } -func (r OAuth2ApiRejectOAuth2LogoutRequestRequest) Execute() (*http.Response, error) { +func (r OAuth2APIRejectOAuth2LogoutRequestRequest) Execute() (*http.Response, error) { return r.ApiService.RejectOAuth2LogoutRequestExecute(r) } @@ -3252,24 +3290,24 @@ No HTTP request body is required. The response is empty as the logout provider has to chose what action to perform next. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRejectOAuth2LogoutRequestRequest + @return OAuth2APIRejectOAuth2LogoutRequestRequest */ -func (a *OAuth2ApiService) RejectOAuth2LogoutRequest(ctx context.Context) OAuth2ApiRejectOAuth2LogoutRequestRequest { - return OAuth2ApiRejectOAuth2LogoutRequestRequest{ +func (a *OAuth2APIService) RejectOAuth2LogoutRequest(ctx context.Context) OAuth2APIRejectOAuth2LogoutRequestRequest { + return OAuth2APIRejectOAuth2LogoutRequestRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -func (a *OAuth2ApiService) RejectOAuth2LogoutRequestExecute(r OAuth2ApiRejectOAuth2LogoutRequestRequest) (*http.Response, error) { +func (a *OAuth2APIService) RejectOAuth2LogoutRequestExecute(r OAuth2APIRejectOAuth2LogoutRequestRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.RejectOAuth2LogoutRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.RejectOAuth2LogoutRequest") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -3283,7 +3321,7 @@ func (a *OAuth2ApiService) RejectOAuth2LogoutRequestExecute(r OAuth2ApiRejectOAu return nil, reportError("logoutChallenge is required and must be specified") } - localVarQueryParams.Add("logout_challenge", parameterToString(*r.logoutChallenge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "logout_challenge", r.logoutChallenge, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3311,9 +3349,9 @@ func (a *OAuth2ApiService) RejectOAuth2LogoutRequestExecute(r OAuth2ApiRejectOAu return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -3329,40 +3367,41 @@ func (a *OAuth2ApiService) RejectOAuth2LogoutRequestExecute(r OAuth2ApiRejectOAu newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OAuth2ApiRevokeOAuth2ConsentSessionsRequest struct { +type OAuth2APIRevokeOAuth2ConsentSessionsRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API subject *string client *string all *bool } // OAuth 2.0 Consent Subject The subject whose consent sessions should be deleted. -func (r OAuth2ApiRevokeOAuth2ConsentSessionsRequest) Subject(subject string) OAuth2ApiRevokeOAuth2ConsentSessionsRequest { +func (r OAuth2APIRevokeOAuth2ConsentSessionsRequest) Subject(subject string) OAuth2APIRevokeOAuth2ConsentSessionsRequest { r.subject = &subject return r } // OAuth 2.0 Client ID If set, deletes only those consent sessions that have been granted to the specified OAuth 2.0 Client ID. -func (r OAuth2ApiRevokeOAuth2ConsentSessionsRequest) Client(client string) OAuth2ApiRevokeOAuth2ConsentSessionsRequest { +func (r OAuth2APIRevokeOAuth2ConsentSessionsRequest) Client(client string) OAuth2APIRevokeOAuth2ConsentSessionsRequest { r.client = &client return r } // Revoke All Consent Sessions If set to `true` deletes all consent sessions by the Subject that have been granted. -func (r OAuth2ApiRevokeOAuth2ConsentSessionsRequest) All(all bool) OAuth2ApiRevokeOAuth2ConsentSessionsRequest { +func (r OAuth2APIRevokeOAuth2ConsentSessionsRequest) All(all bool) OAuth2APIRevokeOAuth2ConsentSessionsRequest { r.all = &all return r } -func (r OAuth2ApiRevokeOAuth2ConsentSessionsRequest) Execute() (*http.Response, error) { +func (r OAuth2APIRevokeOAuth2ConsentSessionsRequest) Execute() (*http.Response, error) { return r.ApiService.RevokeOAuth2ConsentSessionsExecute(r) } @@ -3373,24 +3412,24 @@ This endpoint revokes a subject's granted consent sessions and invalidates all associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0 Client ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRevokeOAuth2ConsentSessionsRequest + @return OAuth2APIRevokeOAuth2ConsentSessionsRequest */ -func (a *OAuth2ApiService) RevokeOAuth2ConsentSessions(ctx context.Context) OAuth2ApiRevokeOAuth2ConsentSessionsRequest { - return OAuth2ApiRevokeOAuth2ConsentSessionsRequest{ +func (a *OAuth2APIService) RevokeOAuth2ConsentSessions(ctx context.Context) OAuth2APIRevokeOAuth2ConsentSessionsRequest { + return OAuth2APIRevokeOAuth2ConsentSessionsRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r OAuth2ApiRevokeOAuth2ConsentSessionsRequest) (*http.Response, error) { +func (a *OAuth2APIService) RevokeOAuth2ConsentSessionsExecute(r OAuth2APIRevokeOAuth2ConsentSessionsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.RevokeOAuth2ConsentSessions") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.RevokeOAuth2ConsentSessions") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -3404,12 +3443,12 @@ func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r OAuth2ApiRevokeO return nil, reportError("subject is required and must be specified") } - localVarQueryParams.Add("subject", parameterToString(*r.subject, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "subject", r.subject, "") if r.client != nil { - localVarQueryParams.Add("client", parameterToString(*r.client, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "client", r.client, "") } if r.all != nil { - localVarQueryParams.Add("all", parameterToString(*r.all, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3438,9 +3477,9 @@ func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r OAuth2ApiRevokeO return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -3456,33 +3495,34 @@ func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r OAuth2ApiRevokeO newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OAuth2ApiRevokeOAuth2LoginSessionsRequest struct { +type OAuth2APIRevokeOAuth2LoginSessionsRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API subject *string sid *string } // OAuth 2.0 Subject The subject to revoke authentication sessions for. -func (r OAuth2ApiRevokeOAuth2LoginSessionsRequest) Subject(subject string) OAuth2ApiRevokeOAuth2LoginSessionsRequest { +func (r OAuth2APIRevokeOAuth2LoginSessionsRequest) Subject(subject string) OAuth2APIRevokeOAuth2LoginSessionsRequest { r.subject = &subject return r } // OAuth 2.0 Subject The subject to revoke authentication sessions for. -func (r OAuth2ApiRevokeOAuth2LoginSessionsRequest) Sid(sid string) OAuth2ApiRevokeOAuth2LoginSessionsRequest { +func (r OAuth2APIRevokeOAuth2LoginSessionsRequest) Sid(sid string) OAuth2APIRevokeOAuth2LoginSessionsRequest { r.sid = &sid return r } -func (r OAuth2ApiRevokeOAuth2LoginSessionsRequest) Execute() (*http.Response, error) { +func (r OAuth2APIRevokeOAuth2LoginSessionsRequest) Execute() (*http.Response, error) { return r.ApiService.RevokeOAuth2LoginSessionsExecute(r) } @@ -3493,30 +3533,30 @@ This endpoint invalidates authentication sessions. After revoking the authentica has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens. If you send the subject in a query param, all authentication sessions that belong to that subject are revoked. -No OpennID Connect Front- or Back-channel logout is performed in this case. +No OpenID Connect Front- or Back-channel logout is performed in this case. Alternatively, you can send a SessionID via `sid` query param, in which case, only the session that is connected to that SessionID is revoked. OpenID Connect Back-channel logout is performed in this case. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRevokeOAuth2LoginSessionsRequest + @return OAuth2APIRevokeOAuth2LoginSessionsRequest */ -func (a *OAuth2ApiService) RevokeOAuth2LoginSessions(ctx context.Context) OAuth2ApiRevokeOAuth2LoginSessionsRequest { - return OAuth2ApiRevokeOAuth2LoginSessionsRequest{ +func (a *OAuth2APIService) RevokeOAuth2LoginSessions(ctx context.Context) OAuth2APIRevokeOAuth2LoginSessionsRequest { + return OAuth2APIRevokeOAuth2LoginSessionsRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r OAuth2ApiRevokeOAuth2LoginSessionsRequest) (*http.Response, error) { +func (a *OAuth2APIService) RevokeOAuth2LoginSessionsExecute(r OAuth2APIRevokeOAuth2LoginSessionsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.RevokeOAuth2LoginSessions") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.RevokeOAuth2LoginSessions") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -3528,10 +3568,10 @@ func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r OAuth2ApiRevokeOAu localVarFormParams := url.Values{} if r.subject != nil { - localVarQueryParams.Add("subject", parameterToString(*r.subject, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "subject", r.subject, "") } if r.sid != nil { - localVarQueryParams.Add("sid", parameterToString(*r.sid, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "sid", r.sid, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3560,9 +3600,9 @@ func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r OAuth2ApiRevokeOAu return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -3578,37 +3618,38 @@ func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r OAuth2ApiRevokeOAu newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OAuth2ApiRevokeOAuth2TokenRequest struct { +type OAuth2APIRevokeOAuth2TokenRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API token *string clientId *string clientSecret *string } -func (r OAuth2ApiRevokeOAuth2TokenRequest) Token(token string) OAuth2ApiRevokeOAuth2TokenRequest { +func (r OAuth2APIRevokeOAuth2TokenRequest) Token(token string) OAuth2APIRevokeOAuth2TokenRequest { r.token = &token return r } -func (r OAuth2ApiRevokeOAuth2TokenRequest) ClientId(clientId string) OAuth2ApiRevokeOAuth2TokenRequest { +func (r OAuth2APIRevokeOAuth2TokenRequest) ClientId(clientId string) OAuth2APIRevokeOAuth2TokenRequest { r.clientId = &clientId return r } -func (r OAuth2ApiRevokeOAuth2TokenRequest) ClientSecret(clientSecret string) OAuth2ApiRevokeOAuth2TokenRequest { +func (r OAuth2APIRevokeOAuth2TokenRequest) ClientSecret(clientSecret string) OAuth2APIRevokeOAuth2TokenRequest { r.clientSecret = &clientSecret return r } -func (r OAuth2ApiRevokeOAuth2TokenRequest) Execute() (*http.Response, error) { +func (r OAuth2APIRevokeOAuth2TokenRequest) Execute() (*http.Response, error) { return r.ApiService.RevokeOAuth2TokenExecute(r) } @@ -3621,24 +3662,24 @@ Revoking a refresh token also invalidates the access token that was created with the client the token was generated for. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiRevokeOAuth2TokenRequest + @return OAuth2APIRevokeOAuth2TokenRequest */ -func (a *OAuth2ApiService) RevokeOAuth2Token(ctx context.Context) OAuth2ApiRevokeOAuth2TokenRequest { - return OAuth2ApiRevokeOAuth2TokenRequest{ +func (a *OAuth2APIService) RevokeOAuth2Token(ctx context.Context) OAuth2APIRevokeOAuth2TokenRequest { + return OAuth2APIRevokeOAuth2TokenRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -func (a *OAuth2ApiService) RevokeOAuth2TokenExecute(r OAuth2ApiRevokeOAuth2TokenRequest) (*http.Response, error) { +func (a *OAuth2APIService) RevokeOAuth2TokenExecute(r OAuth2APIRevokeOAuth2TokenRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.RevokeOAuth2Token") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.RevokeOAuth2Token") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -3670,12 +3711,12 @@ func (a *OAuth2ApiService) RevokeOAuth2TokenExecute(r OAuth2ApiRevokeOAuth2Token localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.clientId != nil { - localVarFormParams.Add("client_id", parameterToString(*r.clientId, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "client_id", r.clientId, "") } if r.clientSecret != nil { - localVarFormParams.Add("client_secret", parameterToString(*r.clientSecret, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "client_secret", r.clientSecret, "") } - localVarFormParams.Add("token", parameterToString(*r.token, "")) + parameterAddToHeaderOrQuery(localVarFormParams, "token", r.token, "") req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -3686,9 +3727,9 @@ func (a *OAuth2ApiService) RevokeOAuth2TokenExecute(r OAuth2ApiRevokeOAuth2Token return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -3704,27 +3745,28 @@ func (a *OAuth2ApiService) RevokeOAuth2TokenExecute(r OAuth2ApiRevokeOAuth2Token newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OAuth2ApiSetOAuth2ClientRequest struct { +type OAuth2APISetOAuth2ClientRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API id string oAuth2Client *OAuth2Client } // OAuth 2.0 Client Request Body -func (r OAuth2ApiSetOAuth2ClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OAuth2ApiSetOAuth2ClientRequest { +func (r OAuth2APISetOAuth2ClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OAuth2APISetOAuth2ClientRequest { r.oAuth2Client = &oAuth2Client return r } -func (r OAuth2ApiSetOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OAuth2APISetOAuth2ClientRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.SetOAuth2ClientExecute(r) } @@ -3741,10 +3783,10 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id OAuth 2.0 Client ID - @return OAuth2ApiSetOAuth2ClientRequest + @return OAuth2APISetOAuth2ClientRequest */ -func (a *OAuth2ApiService) SetOAuth2Client(ctx context.Context, id string) OAuth2ApiSetOAuth2ClientRequest { - return OAuth2ApiSetOAuth2ClientRequest{ +func (a *OAuth2APIService) SetOAuth2Client(ctx context.Context, id string) OAuth2APISetOAuth2ClientRequest { + return OAuth2APISetOAuth2ClientRequest{ ApiService: a, ctx: ctx, id: id, @@ -3753,7 +3795,7 @@ func (a *OAuth2ApiService) SetOAuth2Client(ctx context.Context, id string) OAuth // Execute executes the request // @return OAuth2Client -func (a *OAuth2ApiService) SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { +func (a *OAuth2APIService) SetOAuth2ClientExecute(r OAuth2APISetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -3761,13 +3803,13 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequ localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.SetOAuth2Client") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.SetOAuth2Client") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/clients/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3805,9 +3847,9 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequ return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -3824,7 +3866,8 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3834,7 +3877,8 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -3843,7 +3887,8 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3859,19 +3904,19 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r OAuth2ApiSetOAuth2ClientRequ return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiSetOAuth2ClientLifespansRequest struct { +type OAuth2APISetOAuth2ClientLifespansRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API id string oAuth2ClientTokenLifespans *OAuth2ClientTokenLifespans } -func (r OAuth2ApiSetOAuth2ClientLifespansRequest) OAuth2ClientTokenLifespans(oAuth2ClientTokenLifespans OAuth2ClientTokenLifespans) OAuth2ApiSetOAuth2ClientLifespansRequest { +func (r OAuth2APISetOAuth2ClientLifespansRequest) OAuth2ClientTokenLifespans(oAuth2ClientTokenLifespans OAuth2ClientTokenLifespans) OAuth2APISetOAuth2ClientLifespansRequest { r.oAuth2ClientTokenLifespans = &oAuth2ClientTokenLifespans return r } -func (r OAuth2ApiSetOAuth2ClientLifespansRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OAuth2APISetOAuth2ClientLifespansRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.SetOAuth2ClientLifespansExecute(r) } @@ -3882,10 +3927,10 @@ Set lifespans of different token types issued for this OAuth 2.0 client. Does no @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id OAuth 2.0 Client ID - @return OAuth2ApiSetOAuth2ClientLifespansRequest + @return OAuth2APISetOAuth2ClientLifespansRequest */ -func (a *OAuth2ApiService) SetOAuth2ClientLifespans(ctx context.Context, id string) OAuth2ApiSetOAuth2ClientLifespansRequest { - return OAuth2ApiSetOAuth2ClientLifespansRequest{ +func (a *OAuth2APIService) SetOAuth2ClientLifespans(ctx context.Context, id string) OAuth2APISetOAuth2ClientLifespansRequest { + return OAuth2APISetOAuth2ClientLifespansRequest{ ApiService: a, ctx: ctx, id: id, @@ -3894,7 +3939,7 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespans(ctx context.Context, id stri // Execute executes the request // @return OAuth2Client -func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r OAuth2ApiSetOAuth2ClientLifespansRequest) (*OAuth2Client, *http.Response, error) { +func (a *OAuth2APIService) SetOAuth2ClientLifespansExecute(r OAuth2APISetOAuth2ClientLifespansRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -3902,13 +3947,13 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r OAuth2ApiSetOAuth2C localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.SetOAuth2ClientLifespans") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.SetOAuth2ClientLifespans") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/admin/clients/{id}/lifespans" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3943,9 +3988,9 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r OAuth2ApiSetOAuth2C return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -3961,7 +4006,8 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r OAuth2ApiSetOAuth2C newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3977,18 +4023,18 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r OAuth2ApiSetOAuth2C return localVarReturnValue, localVarHTTPResponse, nil } -type OAuth2ApiTrustOAuth2JwtGrantIssuerRequest struct { +type OAuth2APITrustOAuth2JwtGrantIssuerRequest struct { ctx context.Context - ApiService OAuth2Api + ApiService OAuth2API trustOAuth2JwtGrantIssuer *TrustOAuth2JwtGrantIssuer } -func (r OAuth2ApiTrustOAuth2JwtGrantIssuerRequest) TrustOAuth2JwtGrantIssuer(trustOAuth2JwtGrantIssuer TrustOAuth2JwtGrantIssuer) OAuth2ApiTrustOAuth2JwtGrantIssuerRequest { +func (r OAuth2APITrustOAuth2JwtGrantIssuerRequest) TrustOAuth2JwtGrantIssuer(trustOAuth2JwtGrantIssuer TrustOAuth2JwtGrantIssuer) OAuth2APITrustOAuth2JwtGrantIssuerRequest { r.trustOAuth2JwtGrantIssuer = &trustOAuth2JwtGrantIssuer return r } -func (r OAuth2ApiTrustOAuth2JwtGrantIssuerRequest) Execute() (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { +func (r OAuth2APITrustOAuth2JwtGrantIssuerRequest) Execute() (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { return r.ApiService.TrustOAuth2JwtGrantIssuerExecute(r) } @@ -4000,10 +4046,10 @@ to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OAuth2ApiTrustOAuth2JwtGrantIssuerRequest + @return OAuth2APITrustOAuth2JwtGrantIssuerRequest */ -func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuer(ctx context.Context) OAuth2ApiTrustOAuth2JwtGrantIssuerRequest { - return OAuth2ApiTrustOAuth2JwtGrantIssuerRequest{ +func (a *OAuth2APIService) TrustOAuth2JwtGrantIssuer(ctx context.Context) OAuth2APITrustOAuth2JwtGrantIssuerRequest { + return OAuth2APITrustOAuth2JwtGrantIssuerRequest{ ApiService: a, ctx: ctx, } @@ -4011,7 +4057,7 @@ func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuer(ctx context.Context) OAuth2 // Execute executes the request // @return TrustedOAuth2JwtGrantIssuer -func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuerExecute(r OAuth2ApiTrustOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { +func (a *OAuth2APIService) TrustOAuth2JwtGrantIssuerExecute(r OAuth2APITrustOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -4019,7 +4065,7 @@ func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuerExecute(r OAuth2ApiTrustOAut localVarReturnValue *TrustedOAuth2JwtGrantIssuer ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2ApiService.TrustOAuth2JwtGrantIssuer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OAuth2APIService.TrustOAuth2JwtGrantIssuer") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -4059,9 +4105,9 @@ func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuerExecute(r OAuth2ApiTrustOAut return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -4077,7 +4123,8 @@ func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuerExecute(r OAuth2ApiTrustOAut newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/api_oidc.go b/api_oidc.go index 40fb0b4..4bcf234 100644 --- a/api_oidc.go +++ b/api_oidc.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -14,14 +14,14 @@ package client import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" "strings" ) -type OidcApi interface { +type OidcAPI interface { /* CreateOidcDynamicClient Register OAuth2 Client using OpenID Dynamic Client Registration @@ -39,13 +39,13 @@ The `client_secret` will be returned in the response and you will not be able to Write the secret down and keep it somewhere safe. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiCreateOidcDynamicClientRequest + @return OidcAPICreateOidcDynamicClientRequest */ - CreateOidcDynamicClient(ctx context.Context) OidcApiCreateOidcDynamicClientRequest + CreateOidcDynamicClient(ctx context.Context) OidcAPICreateOidcDynamicClientRequest // CreateOidcDynamicClientExecute executes the request // @return OAuth2Client - CreateOidcDynamicClientExecute(r OidcApiCreateOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) + CreateOidcDynamicClientExecute(r OidcAPICreateOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) /* CreateVerifiableCredential Issues a Verifiable Credential @@ -58,13 +58,13 @@ More information can be found at https://openid.net/specs/openid-connect-userinfo-vc-1_0.html. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiCreateVerifiableCredentialRequest + @return OidcAPICreateVerifiableCredentialRequest */ - CreateVerifiableCredential(ctx context.Context) OidcApiCreateVerifiableCredentialRequest + CreateVerifiableCredential(ctx context.Context) OidcAPICreateVerifiableCredentialRequest // CreateVerifiableCredentialExecute executes the request // @return VerifiableCredentialResponse - CreateVerifiableCredentialExecute(r OidcApiCreateVerifiableCredentialRequest) (*VerifiableCredentialResponse, *http.Response, error) + CreateVerifiableCredentialExecute(r OidcAPICreateVerifiableCredentialRequest) (*VerifiableCredentialResponse, *http.Response, error) /* DeleteOidcDynamicClient Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol @@ -83,12 +83,12 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OidcApiDeleteOidcDynamicClientRequest + @return OidcAPIDeleteOidcDynamicClientRequest */ - DeleteOidcDynamicClient(ctx context.Context, id string) OidcApiDeleteOidcDynamicClientRequest + DeleteOidcDynamicClient(ctx context.Context, id string) OidcAPIDeleteOidcDynamicClientRequest // DeleteOidcDynamicClientExecute executes the request - DeleteOidcDynamicClientExecute(r OidcApiDeleteOidcDynamicClientRequest) (*http.Response, error) + DeleteOidcDynamicClientExecute(r OidcAPIDeleteOidcDynamicClientRequest) (*http.Response, error) /* DiscoverOidcConfiguration OpenID Connect Discovery @@ -99,13 +99,13 @@ Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript) For a full list of clients go here: https://openid.net/developers/certified/ @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiDiscoverOidcConfigurationRequest + @return OidcAPIDiscoverOidcConfigurationRequest */ - DiscoverOidcConfiguration(ctx context.Context) OidcApiDiscoverOidcConfigurationRequest + DiscoverOidcConfiguration(ctx context.Context) OidcAPIDiscoverOidcConfigurationRequest // DiscoverOidcConfigurationExecute executes the request // @return OidcConfiguration - DiscoverOidcConfigurationExecute(r OidcApiDiscoverOidcConfigurationRequest) (*OidcConfiguration, *http.Response, error) + DiscoverOidcConfigurationExecute(r OidcAPIDiscoverOidcConfigurationRequest) (*OidcConfiguration, *http.Response, error) /* GetOidcDynamicClient Get OAuth2 Client using OpenID Dynamic Client Registration @@ -120,13 +120,13 @@ If it uses `client_secret_basic`, present the Client ID and the Client Secret in @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OidcApiGetOidcDynamicClientRequest + @return OidcAPIGetOidcDynamicClientRequest */ - GetOidcDynamicClient(ctx context.Context, id string) OidcApiGetOidcDynamicClientRequest + GetOidcDynamicClient(ctx context.Context, id string) OidcAPIGetOidcDynamicClientRequest // GetOidcDynamicClientExecute executes the request // @return OAuth2Client - GetOidcDynamicClientExecute(r OidcApiGetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) + GetOidcDynamicClientExecute(r OidcAPIGetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) /* GetOidcUserInfo OpenID Connect Userinfo @@ -139,13 +139,13 @@ with more information about the error. See [the spec](https://datatracker.ietf.o for more details about header format. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiGetOidcUserInfoRequest + @return OidcAPIGetOidcUserInfoRequest */ - GetOidcUserInfo(ctx context.Context) OidcApiGetOidcUserInfoRequest + GetOidcUserInfo(ctx context.Context) OidcAPIGetOidcUserInfoRequest // GetOidcUserInfoExecute executes the request // @return OidcUserInfo - GetOidcUserInfoExecute(r OidcApiGetOidcUserInfoRequest) (*OidcUserInfo, *http.Response, error) + GetOidcUserInfoExecute(r OidcAPIGetOidcUserInfoRequest) (*OidcUserInfo, *http.Response, error) /* RevokeOidcSession OpenID Connect Front- and Back-channel Enabled Logout @@ -158,12 +158,12 @@ https://openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiRevokeOidcSessionRequest + @return OidcAPIRevokeOidcSessionRequest */ - RevokeOidcSession(ctx context.Context) OidcApiRevokeOidcSessionRequest + RevokeOidcSession(ctx context.Context) OidcAPIRevokeOidcSessionRequest // RevokeOidcSessionExecute executes the request - RevokeOidcSessionExecute(r OidcApiRevokeOidcSessionRequest) (*http.Response, error) + RevokeOidcSessionExecute(r OidcAPIRevokeOidcSessionRequest) (*http.Response, error) /* SetOidcDynamicClient Set OAuth2 Client using OpenID Dynamic Client Registration @@ -186,31 +186,31 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id OAuth 2.0 Client ID - @return OidcApiSetOidcDynamicClientRequest + @return OidcAPISetOidcDynamicClientRequest */ - SetOidcDynamicClient(ctx context.Context, id string) OidcApiSetOidcDynamicClientRequest + SetOidcDynamicClient(ctx context.Context, id string) OidcAPISetOidcDynamicClientRequest // SetOidcDynamicClientExecute executes the request // @return OAuth2Client - SetOidcDynamicClientExecute(r OidcApiSetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) + SetOidcDynamicClientExecute(r OidcAPISetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) } -// OidcApiService OidcApi service -type OidcApiService service +// OidcAPIService OidcAPI service +type OidcAPIService service -type OidcApiCreateOidcDynamicClientRequest struct { +type OidcAPICreateOidcDynamicClientRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI oAuth2Client *OAuth2Client } // Dynamic Client Registration Request Body -func (r OidcApiCreateOidcDynamicClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OidcApiCreateOidcDynamicClientRequest { +func (r OidcAPICreateOidcDynamicClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OidcAPICreateOidcDynamicClientRequest { r.oAuth2Client = &oAuth2Client return r } -func (r OidcApiCreateOidcDynamicClientRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OidcAPICreateOidcDynamicClientRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.CreateOidcDynamicClientExecute(r) } @@ -230,10 +230,10 @@ The `client_secret` will be returned in the response and you will not be able to Write the secret down and keep it somewhere safe. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiCreateOidcDynamicClientRequest + @return OidcAPICreateOidcDynamicClientRequest */ -func (a *OidcApiService) CreateOidcDynamicClient(ctx context.Context) OidcApiCreateOidcDynamicClientRequest { - return OidcApiCreateOidcDynamicClientRequest{ +func (a *OidcAPIService) CreateOidcDynamicClient(ctx context.Context) OidcAPICreateOidcDynamicClientRequest { + return OidcAPICreateOidcDynamicClientRequest{ ApiService: a, ctx: ctx, } @@ -241,7 +241,7 @@ func (a *OidcApiService) CreateOidcDynamicClient(ctx context.Context) OidcApiCre // Execute executes the request // @return OAuth2Client -func (a *OidcApiService) CreateOidcDynamicClientExecute(r OidcApiCreateOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) { +func (a *OidcAPIService) CreateOidcDynamicClientExecute(r OidcAPICreateOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -249,7 +249,7 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r OidcApiCreateOidcDynam localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.CreateOidcDynamicClient") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.CreateOidcDynamicClient") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -292,9 +292,9 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r OidcApiCreateOidcDynam return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -311,7 +311,8 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r OidcApiCreateOidcDynam newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -320,7 +321,8 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r OidcApiCreateOidcDynam newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -336,18 +338,18 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r OidcApiCreateOidcDynam return localVarReturnValue, localVarHTTPResponse, nil } -type OidcApiCreateVerifiableCredentialRequest struct { +type OidcAPICreateVerifiableCredentialRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI createVerifiableCredentialRequestBody *CreateVerifiableCredentialRequestBody } -func (r OidcApiCreateVerifiableCredentialRequest) CreateVerifiableCredentialRequestBody(createVerifiableCredentialRequestBody CreateVerifiableCredentialRequestBody) OidcApiCreateVerifiableCredentialRequest { +func (r OidcAPICreateVerifiableCredentialRequest) CreateVerifiableCredentialRequestBody(createVerifiableCredentialRequestBody CreateVerifiableCredentialRequestBody) OidcAPICreateVerifiableCredentialRequest { r.createVerifiableCredentialRequestBody = &createVerifiableCredentialRequestBody return r } -func (r OidcApiCreateVerifiableCredentialRequest) Execute() (*VerifiableCredentialResponse, *http.Response, error) { +func (r OidcAPICreateVerifiableCredentialRequest) Execute() (*VerifiableCredentialResponse, *http.Response, error) { return r.ApiService.CreateVerifiableCredentialExecute(r) } @@ -362,10 +364,10 @@ More information can be found at https://openid.net/specs/openid-connect-userinfo-vc-1_0.html. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiCreateVerifiableCredentialRequest + @return OidcAPICreateVerifiableCredentialRequest */ -func (a *OidcApiService) CreateVerifiableCredential(ctx context.Context) OidcApiCreateVerifiableCredentialRequest { - return OidcApiCreateVerifiableCredentialRequest{ +func (a *OidcAPIService) CreateVerifiableCredential(ctx context.Context) OidcAPICreateVerifiableCredentialRequest { + return OidcAPICreateVerifiableCredentialRequest{ ApiService: a, ctx: ctx, } @@ -373,7 +375,7 @@ func (a *OidcApiService) CreateVerifiableCredential(ctx context.Context) OidcApi // Execute executes the request // @return VerifiableCredentialResponse -func (a *OidcApiService) CreateVerifiableCredentialExecute(r OidcApiCreateVerifiableCredentialRequest) (*VerifiableCredentialResponse, *http.Response, error) { +func (a *OidcAPIService) CreateVerifiableCredentialExecute(r OidcAPICreateVerifiableCredentialRequest) (*VerifiableCredentialResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -381,7 +383,7 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r OidcApiCreateVerifi localVarReturnValue *VerifiableCredentialResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.CreateVerifiableCredential") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.CreateVerifiableCredential") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -421,9 +423,9 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r OidcApiCreateVerifi return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -440,7 +442,8 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r OidcApiCreateVerifi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -449,7 +452,8 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r OidcApiCreateVerifi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -465,13 +469,13 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r OidcApiCreateVerifi return localVarReturnValue, localVarHTTPResponse, nil } -type OidcApiDeleteOidcDynamicClientRequest struct { +type OidcAPIDeleteOidcDynamicClientRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI id string } -func (r OidcApiDeleteOidcDynamicClientRequest) Execute() (*http.Response, error) { +func (r OidcAPIDeleteOidcDynamicClientRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOidcDynamicClientExecute(r) } @@ -492,10 +496,10 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OidcApiDeleteOidcDynamicClientRequest + @return OidcAPIDeleteOidcDynamicClientRequest */ -func (a *OidcApiService) DeleteOidcDynamicClient(ctx context.Context, id string) OidcApiDeleteOidcDynamicClientRequest { - return OidcApiDeleteOidcDynamicClientRequest{ +func (a *OidcAPIService) DeleteOidcDynamicClient(ctx context.Context, id string) OidcAPIDeleteOidcDynamicClientRequest { + return OidcAPIDeleteOidcDynamicClientRequest{ ApiService: a, ctx: ctx, id: id, @@ -503,20 +507,20 @@ func (a *OidcApiService) DeleteOidcDynamicClient(ctx context.Context, id string) } // Execute executes the request -func (a *OidcApiService) DeleteOidcDynamicClientExecute(r OidcApiDeleteOidcDynamicClientRequest) (*http.Response, error) { +func (a *OidcAPIService) DeleteOidcDynamicClientExecute(r OidcAPIDeleteOidcDynamicClientRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.DeleteOidcDynamicClient") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.DeleteOidcDynamicClient") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/oauth2/register/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -549,9 +553,9 @@ func (a *OidcApiService) DeleteOidcDynamicClientExecute(r OidcApiDeleteOidcDynam return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -567,19 +571,20 @@ func (a *OidcApiService) DeleteOidcDynamicClientExecute(r OidcApiDeleteOidcDynam newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type OidcApiDiscoverOidcConfigurationRequest struct { +type OidcAPIDiscoverOidcConfigurationRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI } -func (r OidcApiDiscoverOidcConfigurationRequest) Execute() (*OidcConfiguration, *http.Response, error) { +func (r OidcAPIDiscoverOidcConfigurationRequest) Execute() (*OidcConfiguration, *http.Response, error) { return r.ApiService.DiscoverOidcConfigurationExecute(r) } @@ -592,10 +597,10 @@ Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript) For a full list of clients go here: https://openid.net/developers/certified/ @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiDiscoverOidcConfigurationRequest + @return OidcAPIDiscoverOidcConfigurationRequest */ -func (a *OidcApiService) DiscoverOidcConfiguration(ctx context.Context) OidcApiDiscoverOidcConfigurationRequest { - return OidcApiDiscoverOidcConfigurationRequest{ +func (a *OidcAPIService) DiscoverOidcConfiguration(ctx context.Context) OidcAPIDiscoverOidcConfigurationRequest { + return OidcAPIDiscoverOidcConfigurationRequest{ ApiService: a, ctx: ctx, } @@ -603,7 +608,7 @@ func (a *OidcApiService) DiscoverOidcConfiguration(ctx context.Context) OidcApiD // Execute executes the request // @return OidcConfiguration -func (a *OidcApiService) DiscoverOidcConfigurationExecute(r OidcApiDiscoverOidcConfigurationRequest) (*OidcConfiguration, *http.Response, error) { +func (a *OidcAPIService) DiscoverOidcConfigurationExecute(r OidcAPIDiscoverOidcConfigurationRequest) (*OidcConfiguration, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -611,7 +616,7 @@ func (a *OidcApiService) DiscoverOidcConfigurationExecute(r OidcApiDiscoverOidcC localVarReturnValue *OidcConfiguration ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.DiscoverOidcConfiguration") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.DiscoverOidcConfiguration") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -649,9 +654,9 @@ func (a *OidcApiService) DiscoverOidcConfigurationExecute(r OidcApiDiscoverOidcC return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -667,7 +672,8 @@ func (a *OidcApiService) DiscoverOidcConfigurationExecute(r OidcApiDiscoverOidcC newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -683,13 +689,13 @@ func (a *OidcApiService) DiscoverOidcConfigurationExecute(r OidcApiDiscoverOidcC return localVarReturnValue, localVarHTTPResponse, nil } -type OidcApiGetOidcDynamicClientRequest struct { +type OidcAPIGetOidcDynamicClientRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI id string } -func (r OidcApiGetOidcDynamicClientRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OidcAPIGetOidcDynamicClientRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.GetOidcDynamicClientExecute(r) } @@ -706,10 +712,10 @@ If it uses `client_secret_basic`, present the Client ID and the Client Secret in @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The id of the OAuth 2.0 Client. - @return OidcApiGetOidcDynamicClientRequest + @return OidcAPIGetOidcDynamicClientRequest */ -func (a *OidcApiService) GetOidcDynamicClient(ctx context.Context, id string) OidcApiGetOidcDynamicClientRequest { - return OidcApiGetOidcDynamicClientRequest{ +func (a *OidcAPIService) GetOidcDynamicClient(ctx context.Context, id string) OidcAPIGetOidcDynamicClientRequest { + return OidcAPIGetOidcDynamicClientRequest{ ApiService: a, ctx: ctx, id: id, @@ -718,7 +724,7 @@ func (a *OidcApiService) GetOidcDynamicClient(ctx context.Context, id string) Oi // Execute executes the request // @return OAuth2Client -func (a *OidcApiService) GetOidcDynamicClientExecute(r OidcApiGetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) { +func (a *OidcAPIService) GetOidcDynamicClientExecute(r OidcAPIGetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -726,13 +732,13 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r OidcApiGetOidcDynamicClie localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.GetOidcDynamicClient") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.GetOidcDynamicClient") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/oauth2/register/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -765,9 +771,9 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r OidcApiGetOidcDynamicClie return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -783,7 +789,8 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r OidcApiGetOidcDynamicClie newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -799,12 +806,12 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r OidcApiGetOidcDynamicClie return localVarReturnValue, localVarHTTPResponse, nil } -type OidcApiGetOidcUserInfoRequest struct { +type OidcAPIGetOidcUserInfoRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI } -func (r OidcApiGetOidcUserInfoRequest) Execute() (*OidcUserInfo, *http.Response, error) { +func (r OidcAPIGetOidcUserInfoRequest) Execute() (*OidcUserInfo, *http.Response, error) { return r.ApiService.GetOidcUserInfoExecute(r) } @@ -819,10 +826,10 @@ with more information about the error. See [the spec](https://datatracker.ietf.o for more details about header format. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiGetOidcUserInfoRequest + @return OidcAPIGetOidcUserInfoRequest */ -func (a *OidcApiService) GetOidcUserInfo(ctx context.Context) OidcApiGetOidcUserInfoRequest { - return OidcApiGetOidcUserInfoRequest{ +func (a *OidcAPIService) GetOidcUserInfo(ctx context.Context) OidcAPIGetOidcUserInfoRequest { + return OidcAPIGetOidcUserInfoRequest{ ApiService: a, ctx: ctx, } @@ -830,7 +837,7 @@ func (a *OidcApiService) GetOidcUserInfo(ctx context.Context) OidcApiGetOidcUser // Execute executes the request // @return OidcUserInfo -func (a *OidcApiService) GetOidcUserInfoExecute(r OidcApiGetOidcUserInfoRequest) (*OidcUserInfo, *http.Response, error) { +func (a *OidcAPIService) GetOidcUserInfoExecute(r OidcAPIGetOidcUserInfoRequest) (*OidcUserInfo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -838,7 +845,7 @@ func (a *OidcApiService) GetOidcUserInfoExecute(r OidcApiGetOidcUserInfoRequest) localVarReturnValue *OidcUserInfo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.GetOidcUserInfo") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.GetOidcUserInfo") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -876,9 +883,9 @@ func (a *OidcApiService) GetOidcUserInfoExecute(r OidcApiGetOidcUserInfoRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -894,7 +901,8 @@ func (a *OidcApiService) GetOidcUserInfoExecute(r OidcApiGetOidcUserInfoRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -910,12 +918,12 @@ func (a *OidcApiService) GetOidcUserInfoExecute(r OidcApiGetOidcUserInfoRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type OidcApiRevokeOidcSessionRequest struct { +type OidcAPIRevokeOidcSessionRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI } -func (r OidcApiRevokeOidcSessionRequest) Execute() (*http.Response, error) { +func (r OidcAPIRevokeOidcSessionRequest) Execute() (*http.Response, error) { return r.ApiService.RevokeOidcSessionExecute(r) } @@ -930,24 +938,24 @@ https://openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return OidcApiRevokeOidcSessionRequest + @return OidcAPIRevokeOidcSessionRequest */ -func (a *OidcApiService) RevokeOidcSession(ctx context.Context) OidcApiRevokeOidcSessionRequest { - return OidcApiRevokeOidcSessionRequest{ +func (a *OidcAPIService) RevokeOidcSession(ctx context.Context) OidcAPIRevokeOidcSessionRequest { + return OidcAPIRevokeOidcSessionRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -func (a *OidcApiService) RevokeOidcSessionExecute(r OidcApiRevokeOidcSessionRequest) (*http.Response, error) { +func (a *OidcAPIService) RevokeOidcSessionExecute(r OidcAPIRevokeOidcSessionRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.RevokeOidcSession") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.RevokeOidcSession") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -985,9 +993,9 @@ func (a *OidcApiService) RevokeOidcSessionExecute(r OidcApiRevokeOidcSessionRequ return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1003,20 +1011,20 @@ func (a *OidcApiService) RevokeOidcSessionExecute(r OidcApiRevokeOidcSessionRequ return localVarHTTPResponse, nil } -type OidcApiSetOidcDynamicClientRequest struct { +type OidcAPISetOidcDynamicClientRequest struct { ctx context.Context - ApiService OidcApi + ApiService OidcAPI id string oAuth2Client *OAuth2Client } // OAuth 2.0 Client Request Body -func (r OidcApiSetOidcDynamicClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OidcApiSetOidcDynamicClientRequest { +func (r OidcAPISetOidcDynamicClientRequest) OAuth2Client(oAuth2Client OAuth2Client) OidcAPISetOidcDynamicClientRequest { r.oAuth2Client = &oAuth2Client return r } -func (r OidcApiSetOidcDynamicClientRequest) Execute() (*OAuth2Client, *http.Response, error) { +func (r OidcAPISetOidcDynamicClientRequest) Execute() (*OAuth2Client, *http.Response, error) { return r.ApiService.SetOidcDynamicClientExecute(r) } @@ -1041,10 +1049,10 @@ generated for applications which want to consume your OAuth 2.0 or OpenID Connec @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id OAuth 2.0 Client ID - @return OidcApiSetOidcDynamicClientRequest + @return OidcAPISetOidcDynamicClientRequest */ -func (a *OidcApiService) SetOidcDynamicClient(ctx context.Context, id string) OidcApiSetOidcDynamicClientRequest { - return OidcApiSetOidcDynamicClientRequest{ +func (a *OidcAPIService) SetOidcDynamicClient(ctx context.Context, id string) OidcAPISetOidcDynamicClientRequest { + return OidcAPISetOidcDynamicClientRequest{ ApiService: a, ctx: ctx, id: id, @@ -1053,7 +1061,7 @@ func (a *OidcApiService) SetOidcDynamicClient(ctx context.Context, id string) Oi // Execute executes the request // @return OAuth2Client -func (a *OidcApiService) SetOidcDynamicClientExecute(r OidcApiSetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) { +func (a *OidcAPIService) SetOidcDynamicClientExecute(r OidcAPISetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -1061,13 +1069,13 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r OidcApiSetOidcDynamicClie localVarReturnValue *OAuth2Client ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcApiService.SetOidcDynamicClient") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OidcAPIService.SetOidcDynamicClient") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/oauth2/register/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1105,9 +1113,9 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r OidcApiSetOidcDynamicClie return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -1124,7 +1132,8 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r OidcApiSetOidcDynamicClie newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v ErrorOAuth2 @@ -1133,7 +1142,8 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r OidcApiSetOidcDynamicClie newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/api_wellknown.go b/api_wellknown.go index 005a19b..c307aaa 100644 --- a/api_wellknown.go +++ b/api_wellknown.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -14,13 +14,13 @@ package client import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" ) -type WellknownApi interface { +type WellknownAPI interface { /* DiscoverJsonWebKeys Discover Well-Known JSON Web Keys @@ -30,24 +30,24 @@ if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client l [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return WellknownApiDiscoverJsonWebKeysRequest + @return WellknownAPIDiscoverJsonWebKeysRequest */ - DiscoverJsonWebKeys(ctx context.Context) WellknownApiDiscoverJsonWebKeysRequest + DiscoverJsonWebKeys(ctx context.Context) WellknownAPIDiscoverJsonWebKeysRequest // DiscoverJsonWebKeysExecute executes the request // @return JsonWebKeySet - DiscoverJsonWebKeysExecute(r WellknownApiDiscoverJsonWebKeysRequest) (*JsonWebKeySet, *http.Response, error) + DiscoverJsonWebKeysExecute(r WellknownAPIDiscoverJsonWebKeysRequest) (*JsonWebKeySet, *http.Response, error) } -// WellknownApiService WellknownApi service -type WellknownApiService service +// WellknownAPIService WellknownAPI service +type WellknownAPIService service -type WellknownApiDiscoverJsonWebKeysRequest struct { +type WellknownAPIDiscoverJsonWebKeysRequest struct { ctx context.Context - ApiService WellknownApi + ApiService WellknownAPI } -func (r WellknownApiDiscoverJsonWebKeysRequest) Execute() (*JsonWebKeySet, *http.Response, error) { +func (r WellknownAPIDiscoverJsonWebKeysRequest) Execute() (*JsonWebKeySet, *http.Response, error) { return r.ApiService.DiscoverJsonWebKeysExecute(r) } @@ -59,10 +59,10 @@ if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client l [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return WellknownApiDiscoverJsonWebKeysRequest + @return WellknownAPIDiscoverJsonWebKeysRequest */ -func (a *WellknownApiService) DiscoverJsonWebKeys(ctx context.Context) WellknownApiDiscoverJsonWebKeysRequest { - return WellknownApiDiscoverJsonWebKeysRequest{ +func (a *WellknownAPIService) DiscoverJsonWebKeys(ctx context.Context) WellknownAPIDiscoverJsonWebKeysRequest { + return WellknownAPIDiscoverJsonWebKeysRequest{ ApiService: a, ctx: ctx, } @@ -70,7 +70,7 @@ func (a *WellknownApiService) DiscoverJsonWebKeys(ctx context.Context) Wellknown // Execute executes the request // @return JsonWebKeySet -func (a *WellknownApiService) DiscoverJsonWebKeysExecute(r WellknownApiDiscoverJsonWebKeysRequest) (*JsonWebKeySet, *http.Response, error) { +func (a *WellknownAPIService) DiscoverJsonWebKeysExecute(r WellknownAPIDiscoverJsonWebKeysRequest) (*JsonWebKeySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -78,7 +78,7 @@ func (a *WellknownApiService) DiscoverJsonWebKeysExecute(r WellknownApiDiscoverJ localVarReturnValue *JsonWebKeySet ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WellknownApiService.DiscoverJsonWebKeys") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WellknownAPIService.DiscoverJsonWebKeys") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -116,9 +116,9 @@ func (a *WellknownApiService) DiscoverJsonWebKeysExecute(r WellknownApiDiscoverJ return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -134,7 +134,8 @@ func (a *WellknownApiService) DiscoverJsonWebKeysExecute(r WellknownApiDiscoverJ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/client.go b/client.go index 9c33844..b617861 100644 --- a/client.go +++ b/client.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -19,7 +19,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "mime/multipart" "net/http" @@ -38,11 +37,13 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) -// APIClient manages communication with the Ory Hydra API API vv2.2.0-rc.3 +// APIClient manages communication with the Ory Hydra API API vv2.2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -50,15 +51,15 @@ type APIClient struct { // API Services - JwkApi JwkApi + JwkAPI JwkAPI - MetadataApi MetadataApi + MetadataAPI MetadataAPI - OAuth2Api OAuth2Api + OAuth2API OAuth2API - OidcApi OidcApi + OidcAPI OidcAPI - WellknownApi WellknownApi + WellknownAPI WellknownAPI } type service struct { @@ -77,11 +78,11 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services - c.JwkApi = (*JwkApiService)(&c.common) - c.MetadataApi = (*MetadataApiService)(&c.common) - c.OAuth2Api = (*OAuth2ApiService)(&c.common) - c.OidcApi = (*OidcApiService)(&c.common) - c.WellknownApi = (*WellknownApiService)(&c.common) + c.JwkAPI = (*JwkAPIService)(&c.common) + c.MetadataAPI = (*MetadataAPIService)(&c.common) + c.OAuth2API = (*OAuth2APIService)(&c.common) + c.OidcAPI = (*OidcAPIService)(&c.common) + c.WellknownAPI = (*WellknownAPIService)(&c.common) return c } @@ -133,33 +134,111 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i Requested Authentication AuthorizationContext Class Reference values. Space-separated string that specifies the acr values that the Authorization Server is being requested to use for processing this Authentication Request, with the values appearing in order of preference. The Authentication AuthorizationContext Class satisfied by the authentication performed is returned as the acr Claim Value, as specified in Section 2. The acr Claim is requested as a Voluntary Claim by this parameter. @@ -51,7 +54,7 @@ func NewOAuth2ConsentRequestOpenIDConnectContextWithDefaults() *OAuth2ConsentReq // GetAcrValues returns the AcrValues field value if set, zero value otherwise. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValues() []string { - if o == nil || o.AcrValues == nil { + if o == nil || IsNil(o.AcrValues) { var ret []string return ret } @@ -61,7 +64,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValues() []string { // GetAcrValuesOk returns a tuple with the AcrValues field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValuesOk() ([]string, bool) { - if o == nil || o.AcrValues == nil { + if o == nil || IsNil(o.AcrValues) { return nil, false } return o.AcrValues, true @@ -69,7 +72,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValuesOk() ([]string, b // HasAcrValues returns a boolean if a field has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) HasAcrValues() bool { - if o != nil && o.AcrValues != nil { + if o != nil && !IsNil(o.AcrValues) { return true } @@ -83,7 +86,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetAcrValues(v []string) { // GetDisplay returns the Display field value if set, zero value otherwise. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplay() string { - if o == nil || o.Display == nil { + if o == nil || IsNil(o.Display) { var ret string return ret } @@ -93,7 +96,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplay() string { // GetDisplayOk returns a tuple with the Display field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplayOk() (*string, bool) { - if o == nil || o.Display == nil { + if o == nil || IsNil(o.Display) { return nil, false } return o.Display, true @@ -101,7 +104,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplayOk() (*string, bool // HasDisplay returns a boolean if a field has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) HasDisplay() bool { - if o != nil && o.Display != nil { + if o != nil && !IsNil(o.Display) { return true } @@ -115,7 +118,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetDisplay(v string) { // GetIdTokenHintClaims returns the IdTokenHintClaims field value if set, zero value otherwise. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetIdTokenHintClaims() map[string]interface{} { - if o == nil || o.IdTokenHintClaims == nil { + if o == nil || IsNil(o.IdTokenHintClaims) { var ret map[string]interface{} return ret } @@ -125,15 +128,15 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetIdTokenHintClaims() map[st // GetIdTokenHintClaimsOk returns a tuple with the IdTokenHintClaims field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetIdTokenHintClaimsOk() (map[string]interface{}, bool) { - if o == nil || o.IdTokenHintClaims == nil { - return nil, false + if o == nil || IsNil(o.IdTokenHintClaims) { + return map[string]interface{}{}, false } return o.IdTokenHintClaims, true } // HasIdTokenHintClaims returns a boolean if a field has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) HasIdTokenHintClaims() bool { - if o != nil && o.IdTokenHintClaims != nil { + if o != nil && !IsNil(o.IdTokenHintClaims) { return true } @@ -147,7 +150,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetIdTokenHintClaims(v map[st // GetLoginHint returns the LoginHint field value if set, zero value otherwise. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHint() string { - if o == nil || o.LoginHint == nil { + if o == nil || IsNil(o.LoginHint) { var ret string return ret } @@ -157,7 +160,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHint() string { // GetLoginHintOk returns a tuple with the LoginHint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHintOk() (*string, bool) { - if o == nil || o.LoginHint == nil { + if o == nil || IsNil(o.LoginHint) { return nil, false } return o.LoginHint, true @@ -165,7 +168,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHintOk() (*string, bo // HasLoginHint returns a boolean if a field has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) HasLoginHint() bool { - if o != nil && o.LoginHint != nil { + if o != nil && !IsNil(o.LoginHint) { return true } @@ -179,7 +182,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetLoginHint(v string) { // GetUiLocales returns the UiLocales field value if set, zero value otherwise. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocales() []string { - if o == nil || o.UiLocales == nil { + if o == nil || IsNil(o.UiLocales) { var ret []string return ret } @@ -189,7 +192,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocales() []string { // GetUiLocalesOk returns a tuple with the UiLocales field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocalesOk() ([]string, bool) { - if o == nil || o.UiLocales == nil { + if o == nil || IsNil(o.UiLocales) { return nil, false } return o.UiLocales, true @@ -197,7 +200,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocalesOk() ([]string, b // HasUiLocales returns a boolean if a field has been set. func (o *OAuth2ConsentRequestOpenIDConnectContext) HasUiLocales() bool { - if o != nil && o.UiLocales != nil { + if o != nil && !IsNil(o.UiLocales) { return true } @@ -210,20 +213,28 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetUiLocales(v []string) { } func (o OAuth2ConsentRequestOpenIDConnectContext) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ConsentRequestOpenIDConnectContext) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AcrValues != nil { + if !IsNil(o.AcrValues) { toSerialize["acr_values"] = o.AcrValues } - if o.Display != nil { + if !IsNil(o.Display) { toSerialize["display"] = o.Display } - if o.IdTokenHintClaims != nil { + if !IsNil(o.IdTokenHintClaims) { toSerialize["id_token_hint_claims"] = o.IdTokenHintClaims } - if o.LoginHint != nil { + if !IsNil(o.LoginHint) { toSerialize["login_hint"] = o.LoginHint } - if o.UiLocales != nil { + if !IsNil(o.UiLocales) { toSerialize["ui_locales"] = o.UiLocales } @@ -231,16 +242,20 @@ func (o OAuth2ConsentRequestOpenIDConnectContext) MarshalJSON() ([]byte, error) toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OAuth2ConsentRequestOpenIDConnectContext) UnmarshalJSON(bytes []byte) (err error) { varOAuth2ConsentRequestOpenIDConnectContext := _OAuth2ConsentRequestOpenIDConnectContext{} - if err = json.Unmarshal(bytes, &varOAuth2ConsentRequestOpenIDConnectContext); err == nil { - *o = OAuth2ConsentRequestOpenIDConnectContext(varOAuth2ConsentRequestOpenIDConnectContext) + err = json.Unmarshal(bytes, &varOAuth2ConsentRequestOpenIDConnectContext) + + if err != nil { + return err } + *o = OAuth2ConsentRequestOpenIDConnectContext(varOAuth2ConsentRequestOpenIDConnectContext) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_o_auth2_consent_session.go b/model_o_auth2_consent_session.go index 8ca02cb..685d6c4 100644 --- a/model_o_auth2_consent_session.go +++ b/model_o_auth2_consent_session.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -16,9 +16,13 @@ import ( "time" ) +// checks if the OAuth2ConsentSession type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ConsentSession{} + // OAuth2ConsentSession A completed OAuth 2.0 Consent Session. type OAuth2ConsentSession struct { ConsentRequest *OAuth2ConsentRequest `json:"consent_request,omitempty"` + Context interface{} `json:"context,omitempty"` ExpiresAt *OAuth2ConsentSessionExpiresAt `json:"expires_at,omitempty"` GrantAccessTokenAudience []string `json:"grant_access_token_audience,omitempty"` GrantScope []string `json:"grant_scope,omitempty"` @@ -52,7 +56,7 @@ func NewOAuth2ConsentSessionWithDefaults() *OAuth2ConsentSession { // GetConsentRequest returns the ConsentRequest field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetConsentRequest() OAuth2ConsentRequest { - if o == nil || o.ConsentRequest == nil { + if o == nil || IsNil(o.ConsentRequest) { var ret OAuth2ConsentRequest return ret } @@ -62,7 +66,7 @@ func (o *OAuth2ConsentSession) GetConsentRequest() OAuth2ConsentRequest { // GetConsentRequestOk returns a tuple with the ConsentRequest field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetConsentRequestOk() (*OAuth2ConsentRequest, bool) { - if o == nil || o.ConsentRequest == nil { + if o == nil || IsNil(o.ConsentRequest) { return nil, false } return o.ConsentRequest, true @@ -70,7 +74,7 @@ func (o *OAuth2ConsentSession) GetConsentRequestOk() (*OAuth2ConsentRequest, boo // HasConsentRequest returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasConsentRequest() bool { - if o != nil && o.ConsentRequest != nil { + if o != nil && !IsNil(o.ConsentRequest) { return true } @@ -82,9 +86,42 @@ func (o *OAuth2ConsentSession) SetConsentRequest(v OAuth2ConsentRequest) { o.ConsentRequest = &v } +// GetContext returns the Context field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuth2ConsentSession) GetContext() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2ConsentSession) GetContextOk() (*interface{}, bool) { + if o == nil || IsNil(o.Context) { + return nil, false + } + return &o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *OAuth2ConsentSession) HasContext() bool { + if o != nil && IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given interface{} and assigns it to the Context field. +func (o *OAuth2ConsentSession) SetContext(v interface{}) { + o.Context = v +} + // GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetExpiresAt() OAuth2ConsentSessionExpiresAt { - if o == nil || o.ExpiresAt == nil { + if o == nil || IsNil(o.ExpiresAt) { var ret OAuth2ConsentSessionExpiresAt return ret } @@ -94,7 +131,7 @@ func (o *OAuth2ConsentSession) GetExpiresAt() OAuth2ConsentSessionExpiresAt { // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetExpiresAtOk() (*OAuth2ConsentSessionExpiresAt, bool) { - if o == nil || o.ExpiresAt == nil { + if o == nil || IsNil(o.ExpiresAt) { return nil, false } return o.ExpiresAt, true @@ -102,7 +139,7 @@ func (o *OAuth2ConsentSession) GetExpiresAtOk() (*OAuth2ConsentSessionExpiresAt, // HasExpiresAt returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasExpiresAt() bool { - if o != nil && o.ExpiresAt != nil { + if o != nil && !IsNil(o.ExpiresAt) { return true } @@ -116,7 +153,7 @@ func (o *OAuth2ConsentSession) SetExpiresAt(v OAuth2ConsentSessionExpiresAt) { // GetGrantAccessTokenAudience returns the GrantAccessTokenAudience field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetGrantAccessTokenAudience() []string { - if o == nil || o.GrantAccessTokenAudience == nil { + if o == nil || IsNil(o.GrantAccessTokenAudience) { var ret []string return ret } @@ -126,7 +163,7 @@ func (o *OAuth2ConsentSession) GetGrantAccessTokenAudience() []string { // GetGrantAccessTokenAudienceOk returns a tuple with the GrantAccessTokenAudience field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetGrantAccessTokenAudienceOk() ([]string, bool) { - if o == nil || o.GrantAccessTokenAudience == nil { + if o == nil || IsNil(o.GrantAccessTokenAudience) { return nil, false } return o.GrantAccessTokenAudience, true @@ -134,7 +171,7 @@ func (o *OAuth2ConsentSession) GetGrantAccessTokenAudienceOk() ([]string, bool) // HasGrantAccessTokenAudience returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasGrantAccessTokenAudience() bool { - if o != nil && o.GrantAccessTokenAudience != nil { + if o != nil && !IsNil(o.GrantAccessTokenAudience) { return true } @@ -148,7 +185,7 @@ func (o *OAuth2ConsentSession) SetGrantAccessTokenAudience(v []string) { // GetGrantScope returns the GrantScope field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetGrantScope() []string { - if o == nil || o.GrantScope == nil { + if o == nil || IsNil(o.GrantScope) { var ret []string return ret } @@ -158,7 +195,7 @@ func (o *OAuth2ConsentSession) GetGrantScope() []string { // GetGrantScopeOk returns a tuple with the GrantScope field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetGrantScopeOk() ([]string, bool) { - if o == nil || o.GrantScope == nil { + if o == nil || IsNil(o.GrantScope) { return nil, false } return o.GrantScope, true @@ -166,7 +203,7 @@ func (o *OAuth2ConsentSession) GetGrantScopeOk() ([]string, bool) { // HasGrantScope returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasGrantScope() bool { - if o != nil && o.GrantScope != nil { + if o != nil && !IsNil(o.GrantScope) { return true } @@ -180,7 +217,7 @@ func (o *OAuth2ConsentSession) SetGrantScope(v []string) { // GetHandledAt returns the HandledAt field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetHandledAt() time.Time { - if o == nil || o.HandledAt == nil { + if o == nil || IsNil(o.HandledAt) { var ret time.Time return ret } @@ -190,7 +227,7 @@ func (o *OAuth2ConsentSession) GetHandledAt() time.Time { // GetHandledAtOk returns a tuple with the HandledAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetHandledAtOk() (*time.Time, bool) { - if o == nil || o.HandledAt == nil { + if o == nil || IsNil(o.HandledAt) { return nil, false } return o.HandledAt, true @@ -198,7 +235,7 @@ func (o *OAuth2ConsentSession) GetHandledAtOk() (*time.Time, bool) { // HasHandledAt returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasHandledAt() bool { - if o != nil && o.HandledAt != nil { + if o != nil && !IsNil(o.HandledAt) { return true } @@ -212,7 +249,7 @@ func (o *OAuth2ConsentSession) SetHandledAt(v time.Time) { // GetRemember returns the Remember field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetRemember() bool { - if o == nil || o.Remember == nil { + if o == nil || IsNil(o.Remember) { var ret bool return ret } @@ -222,7 +259,7 @@ func (o *OAuth2ConsentSession) GetRemember() bool { // GetRememberOk returns a tuple with the Remember field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetRememberOk() (*bool, bool) { - if o == nil || o.Remember == nil { + if o == nil || IsNil(o.Remember) { return nil, false } return o.Remember, true @@ -230,7 +267,7 @@ func (o *OAuth2ConsentSession) GetRememberOk() (*bool, bool) { // HasRemember returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasRemember() bool { - if o != nil && o.Remember != nil { + if o != nil && !IsNil(o.Remember) { return true } @@ -244,7 +281,7 @@ func (o *OAuth2ConsentSession) SetRemember(v bool) { // GetRememberFor returns the RememberFor field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetRememberFor() int64 { - if o == nil || o.RememberFor == nil { + if o == nil || IsNil(o.RememberFor) { var ret int64 return ret } @@ -254,7 +291,7 @@ func (o *OAuth2ConsentSession) GetRememberFor() int64 { // GetRememberForOk returns a tuple with the RememberFor field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetRememberForOk() (*int64, bool) { - if o == nil || o.RememberFor == nil { + if o == nil || IsNil(o.RememberFor) { return nil, false } return o.RememberFor, true @@ -262,7 +299,7 @@ func (o *OAuth2ConsentSession) GetRememberForOk() (*int64, bool) { // HasRememberFor returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasRememberFor() bool { - if o != nil && o.RememberFor != nil { + if o != nil && !IsNil(o.RememberFor) { return true } @@ -276,7 +313,7 @@ func (o *OAuth2ConsentSession) SetRememberFor(v int64) { // GetSession returns the Session field value if set, zero value otherwise. func (o *OAuth2ConsentSession) GetSession() AcceptOAuth2ConsentRequestSession { - if o == nil || o.Session == nil { + if o == nil || IsNil(o.Session) { var ret AcceptOAuth2ConsentRequestSession return ret } @@ -286,7 +323,7 @@ func (o *OAuth2ConsentSession) GetSession() AcceptOAuth2ConsentRequestSession { // GetSessionOk returns a tuple with the Session field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSession) GetSessionOk() (*AcceptOAuth2ConsentRequestSession, bool) { - if o == nil || o.Session == nil { + if o == nil || IsNil(o.Session) { return nil, false } return o.Session, true @@ -294,7 +331,7 @@ func (o *OAuth2ConsentSession) GetSessionOk() (*AcceptOAuth2ConsentRequestSessio // HasSession returns a boolean if a field has been set. func (o *OAuth2ConsentSession) HasSession() bool { - if o != nil && o.Session != nil { + if o != nil && !IsNil(o.Session) { return true } @@ -307,29 +344,40 @@ func (o *OAuth2ConsentSession) SetSession(v AcceptOAuth2ConsentRequestSession) { } func (o OAuth2ConsentSession) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ConsentSession) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ConsentRequest != nil { + if !IsNil(o.ConsentRequest) { toSerialize["consent_request"] = o.ConsentRequest } - if o.ExpiresAt != nil { + if o.Context != nil { + toSerialize["context"] = o.Context + } + if !IsNil(o.ExpiresAt) { toSerialize["expires_at"] = o.ExpiresAt } - if o.GrantAccessTokenAudience != nil { + if !IsNil(o.GrantAccessTokenAudience) { toSerialize["grant_access_token_audience"] = o.GrantAccessTokenAudience } - if o.GrantScope != nil { + if !IsNil(o.GrantScope) { toSerialize["grant_scope"] = o.GrantScope } - if o.HandledAt != nil { + if !IsNil(o.HandledAt) { toSerialize["handled_at"] = o.HandledAt } - if o.Remember != nil { + if !IsNil(o.Remember) { toSerialize["remember"] = o.Remember } - if o.RememberFor != nil { + if !IsNil(o.RememberFor) { toSerialize["remember_for"] = o.RememberFor } - if o.Session != nil { + if !IsNil(o.Session) { toSerialize["session"] = o.Session } @@ -337,20 +385,25 @@ func (o OAuth2ConsentSession) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OAuth2ConsentSession) UnmarshalJSON(bytes []byte) (err error) { varOAuth2ConsentSession := _OAuth2ConsentSession{} - if err = json.Unmarshal(bytes, &varOAuth2ConsentSession); err == nil { - *o = OAuth2ConsentSession(varOAuth2ConsentSession) + err = json.Unmarshal(bytes, &varOAuth2ConsentSession) + + if err != nil { + return err } + *o = OAuth2ConsentSession(varOAuth2ConsentSession) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { delete(additionalProperties, "consent_request") + delete(additionalProperties, "context") delete(additionalProperties, "expires_at") delete(additionalProperties, "grant_access_token_audience") delete(additionalProperties, "grant_scope") diff --git a/model_o_auth2_consent_session_expires_at.go b/model_o_auth2_consent_session_expires_at.go index 39e5210..d9969a6 100644 --- a/model_o_auth2_consent_session_expires_at.go +++ b/model_o_auth2_consent_session_expires_at.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -16,6 +16,9 @@ import ( "time" ) +// checks if the OAuth2ConsentSessionExpiresAt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ConsentSessionExpiresAt{} + // OAuth2ConsentSessionExpiresAt struct for OAuth2ConsentSessionExpiresAt type OAuth2ConsentSessionExpiresAt struct { AccessToken *time.Time `json:"access_token,omitempty"` @@ -47,7 +50,7 @@ func NewOAuth2ConsentSessionExpiresAtWithDefaults() *OAuth2ConsentSessionExpires // GetAccessToken returns the AccessToken field value if set, zero value otherwise. func (o *OAuth2ConsentSessionExpiresAt) GetAccessToken() time.Time { - if o == nil || o.AccessToken == nil { + if o == nil || IsNil(o.AccessToken) { var ret time.Time return ret } @@ -57,7 +60,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetAccessToken() time.Time { // GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSessionExpiresAt) GetAccessTokenOk() (*time.Time, bool) { - if o == nil || o.AccessToken == nil { + if o == nil || IsNil(o.AccessToken) { return nil, false } return o.AccessToken, true @@ -65,7 +68,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetAccessTokenOk() (*time.Time, bool) { // HasAccessToken returns a boolean if a field has been set. func (o *OAuth2ConsentSessionExpiresAt) HasAccessToken() bool { - if o != nil && o.AccessToken != nil { + if o != nil && !IsNil(o.AccessToken) { return true } @@ -79,7 +82,7 @@ func (o *OAuth2ConsentSessionExpiresAt) SetAccessToken(v time.Time) { // GetAuthorizeCode returns the AuthorizeCode field value if set, zero value otherwise. func (o *OAuth2ConsentSessionExpiresAt) GetAuthorizeCode() time.Time { - if o == nil || o.AuthorizeCode == nil { + if o == nil || IsNil(o.AuthorizeCode) { var ret time.Time return ret } @@ -89,7 +92,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetAuthorizeCode() time.Time { // GetAuthorizeCodeOk returns a tuple with the AuthorizeCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSessionExpiresAt) GetAuthorizeCodeOk() (*time.Time, bool) { - if o == nil || o.AuthorizeCode == nil { + if o == nil || IsNil(o.AuthorizeCode) { return nil, false } return o.AuthorizeCode, true @@ -97,7 +100,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetAuthorizeCodeOk() (*time.Time, bool) // HasAuthorizeCode returns a boolean if a field has been set. func (o *OAuth2ConsentSessionExpiresAt) HasAuthorizeCode() bool { - if o != nil && o.AuthorizeCode != nil { + if o != nil && !IsNil(o.AuthorizeCode) { return true } @@ -111,7 +114,7 @@ func (o *OAuth2ConsentSessionExpiresAt) SetAuthorizeCode(v time.Time) { // GetIdToken returns the IdToken field value if set, zero value otherwise. func (o *OAuth2ConsentSessionExpiresAt) GetIdToken() time.Time { - if o == nil || o.IdToken == nil { + if o == nil || IsNil(o.IdToken) { var ret time.Time return ret } @@ -121,7 +124,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetIdToken() time.Time { // GetIdTokenOk returns a tuple with the IdToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSessionExpiresAt) GetIdTokenOk() (*time.Time, bool) { - if o == nil || o.IdToken == nil { + if o == nil || IsNil(o.IdToken) { return nil, false } return o.IdToken, true @@ -129,7 +132,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetIdTokenOk() (*time.Time, bool) { // HasIdToken returns a boolean if a field has been set. func (o *OAuth2ConsentSessionExpiresAt) HasIdToken() bool { - if o != nil && o.IdToken != nil { + if o != nil && !IsNil(o.IdToken) { return true } @@ -143,7 +146,7 @@ func (o *OAuth2ConsentSessionExpiresAt) SetIdToken(v time.Time) { // GetParContext returns the ParContext field value if set, zero value otherwise. func (o *OAuth2ConsentSessionExpiresAt) GetParContext() time.Time { - if o == nil || o.ParContext == nil { + if o == nil || IsNil(o.ParContext) { var ret time.Time return ret } @@ -153,7 +156,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetParContext() time.Time { // GetParContextOk returns a tuple with the ParContext field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSessionExpiresAt) GetParContextOk() (*time.Time, bool) { - if o == nil || o.ParContext == nil { + if o == nil || IsNil(o.ParContext) { return nil, false } return o.ParContext, true @@ -161,7 +164,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetParContextOk() (*time.Time, bool) { // HasParContext returns a boolean if a field has been set. func (o *OAuth2ConsentSessionExpiresAt) HasParContext() bool { - if o != nil && o.ParContext != nil { + if o != nil && !IsNil(o.ParContext) { return true } @@ -175,7 +178,7 @@ func (o *OAuth2ConsentSessionExpiresAt) SetParContext(v time.Time) { // GetRefreshToken returns the RefreshToken field value if set, zero value otherwise. func (o *OAuth2ConsentSessionExpiresAt) GetRefreshToken() time.Time { - if o == nil || o.RefreshToken == nil { + if o == nil || IsNil(o.RefreshToken) { var ret time.Time return ret } @@ -185,7 +188,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetRefreshToken() time.Time { // GetRefreshTokenOk returns a tuple with the RefreshToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentSessionExpiresAt) GetRefreshTokenOk() (*time.Time, bool) { - if o == nil || o.RefreshToken == nil { + if o == nil || IsNil(o.RefreshToken) { return nil, false } return o.RefreshToken, true @@ -193,7 +196,7 @@ func (o *OAuth2ConsentSessionExpiresAt) GetRefreshTokenOk() (*time.Time, bool) { // HasRefreshToken returns a boolean if a field has been set. func (o *OAuth2ConsentSessionExpiresAt) HasRefreshToken() bool { - if o != nil && o.RefreshToken != nil { + if o != nil && !IsNil(o.RefreshToken) { return true } @@ -206,20 +209,28 @@ func (o *OAuth2ConsentSessionExpiresAt) SetRefreshToken(v time.Time) { } func (o OAuth2ConsentSessionExpiresAt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ConsentSessionExpiresAt) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AccessToken != nil { + if !IsNil(o.AccessToken) { toSerialize["access_token"] = o.AccessToken } - if o.AuthorizeCode != nil { + if !IsNil(o.AuthorizeCode) { toSerialize["authorize_code"] = o.AuthorizeCode } - if o.IdToken != nil { + if !IsNil(o.IdToken) { toSerialize["id_token"] = o.IdToken } - if o.ParContext != nil { + if !IsNil(o.ParContext) { toSerialize["par_context"] = o.ParContext } - if o.RefreshToken != nil { + if !IsNil(o.RefreshToken) { toSerialize["refresh_token"] = o.RefreshToken } @@ -227,16 +238,20 @@ func (o OAuth2ConsentSessionExpiresAt) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OAuth2ConsentSessionExpiresAt) UnmarshalJSON(bytes []byte) (err error) { varOAuth2ConsentSessionExpiresAt := _OAuth2ConsentSessionExpiresAt{} - if err = json.Unmarshal(bytes, &varOAuth2ConsentSessionExpiresAt); err == nil { - *o = OAuth2ConsentSessionExpiresAt(varOAuth2ConsentSessionExpiresAt) + err = json.Unmarshal(bytes, &varOAuth2ConsentSessionExpiresAt) + + if err != nil { + return err } + *o = OAuth2ConsentSessionExpiresAt(varOAuth2ConsentSessionExpiresAt) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_o_auth2_login_request.go b/model_o_auth2_login_request.go index 0b0675b..2842ec6 100644 --- a/model_o_auth2_login_request.go +++ b/model_o_auth2_login_request.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -13,8 +13,12 @@ package client import ( "encoding/json" + "fmt" ) +// checks if the OAuth2LoginRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2LoginRequest{} + // OAuth2LoginRequest struct for OAuth2LoginRequest type OAuth2LoginRequest struct { // ID is the identifier (\"login challenge\") of the login request. It is used to identify the session. @@ -23,8 +27,8 @@ type OAuth2LoginRequest struct { OidcContext *OAuth2ConsentRequestOpenIDConnectContext `json:"oidc_context,omitempty"` // RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It is the URL which initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but might come in handy if you want to deal with additional request parameters. RequestUrl string `json:"request_url"` - RequestedAccessTokenAudience []string `json:"requested_access_token_audience"` - RequestedScope []string `json:"requested_scope"` + RequestedAccessTokenAudience []string `json:"requested_access_token_audience,omitempty"` + RequestedScope []string `json:"requested_scope,omitempty"` // SessionID is the login session ID. If the user-agent reuses a login session (via cookie / remember flag) this ID will remain the same. If the user-agent did not have an existing authentication session (e.g. remember is false) this will be a new random value. This value is used as the \"sid\" parameter in the ID Token and in OIDC Front-/Back- channel logout. It's value can generally be used to associate consecutive login requests by a certain user. SessionId *string `json:"session_id,omitempty"` // Skip, if true, implies that the client has requested the same scopes from the same user previously. If true, you can skip asking the user to grant the requested scopes, and simply forward the user to the redirect URL. This feature allows you to update / set session information. @@ -40,13 +44,11 @@ type _OAuth2LoginRequest OAuth2LoginRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOAuth2LoginRequest(challenge string, client OAuth2Client, requestUrl string, requestedAccessTokenAudience []string, requestedScope []string, skip bool, subject string) *OAuth2LoginRequest { +func NewOAuth2LoginRequest(challenge string, client OAuth2Client, requestUrl string, skip bool, subject string) *OAuth2LoginRequest { this := OAuth2LoginRequest{} this.Challenge = challenge this.Client = client this.RequestUrl = requestUrl - this.RequestedAccessTokenAudience = requestedAccessTokenAudience - this.RequestedScope = requestedScope this.Skip = skip this.Subject = subject return &this @@ -110,7 +112,7 @@ func (o *OAuth2LoginRequest) SetClient(v OAuth2Client) { // GetOidcContext returns the OidcContext field value if set, zero value otherwise. func (o *OAuth2LoginRequest) GetOidcContext() OAuth2ConsentRequestOpenIDConnectContext { - if o == nil || o.OidcContext == nil { + if o == nil || IsNil(o.OidcContext) { var ret OAuth2ConsentRequestOpenIDConnectContext return ret } @@ -120,7 +122,7 @@ func (o *OAuth2LoginRequest) GetOidcContext() OAuth2ConsentRequestOpenIDConnectC // GetOidcContextOk returns a tuple with the OidcContext field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LoginRequest) GetOidcContextOk() (*OAuth2ConsentRequestOpenIDConnectContext, bool) { - if o == nil || o.OidcContext == nil { + if o == nil || IsNil(o.OidcContext) { return nil, false } return o.OidcContext, true @@ -128,7 +130,7 @@ func (o *OAuth2LoginRequest) GetOidcContextOk() (*OAuth2ConsentRequestOpenIDConn // HasOidcContext returns a boolean if a field has been set. func (o *OAuth2LoginRequest) HasOidcContext() bool { - if o != nil && o.OidcContext != nil { + if o != nil && !IsNil(o.OidcContext) { return true } @@ -164,57 +166,73 @@ func (o *OAuth2LoginRequest) SetRequestUrl(v string) { o.RequestUrl = v } -// GetRequestedAccessTokenAudience returns the RequestedAccessTokenAudience field value +// GetRequestedAccessTokenAudience returns the RequestedAccessTokenAudience field value if set, zero value otherwise. func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudience() []string { - if o == nil { + if o == nil || IsNil(o.RequestedAccessTokenAudience) { var ret []string return ret } - return o.RequestedAccessTokenAudience } -// GetRequestedAccessTokenAudienceOk returns a tuple with the RequestedAccessTokenAudience field value +// GetRequestedAccessTokenAudienceOk returns a tuple with the RequestedAccessTokenAudience field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudienceOk() ([]string, bool) { - if o == nil { + if o == nil || IsNil(o.RequestedAccessTokenAudience) { return nil, false } return o.RequestedAccessTokenAudience, true } -// SetRequestedAccessTokenAudience sets field value +// HasRequestedAccessTokenAudience returns a boolean if a field has been set. +func (o *OAuth2LoginRequest) HasRequestedAccessTokenAudience() bool { + if o != nil && !IsNil(o.RequestedAccessTokenAudience) { + return true + } + + return false +} + +// SetRequestedAccessTokenAudience gets a reference to the given []string and assigns it to the RequestedAccessTokenAudience field. func (o *OAuth2LoginRequest) SetRequestedAccessTokenAudience(v []string) { o.RequestedAccessTokenAudience = v } -// GetRequestedScope returns the RequestedScope field value +// GetRequestedScope returns the RequestedScope field value if set, zero value otherwise. func (o *OAuth2LoginRequest) GetRequestedScope() []string { - if o == nil { + if o == nil || IsNil(o.RequestedScope) { var ret []string return ret } - return o.RequestedScope } -// GetRequestedScopeOk returns a tuple with the RequestedScope field value +// GetRequestedScopeOk returns a tuple with the RequestedScope field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LoginRequest) GetRequestedScopeOk() ([]string, bool) { - if o == nil { + if o == nil || IsNil(o.RequestedScope) { return nil, false } return o.RequestedScope, true } -// SetRequestedScope sets field value +// HasRequestedScope returns a boolean if a field has been set. +func (o *OAuth2LoginRequest) HasRequestedScope() bool { + if o != nil && !IsNil(o.RequestedScope) { + return true + } + + return false +} + +// SetRequestedScope gets a reference to the given []string and assigns it to the RequestedScope field. func (o *OAuth2LoginRequest) SetRequestedScope(v []string) { o.RequestedScope = v } // GetSessionId returns the SessionId field value if set, zero value otherwise. func (o *OAuth2LoginRequest) GetSessionId() string { - if o == nil || o.SessionId == nil { + if o == nil || IsNil(o.SessionId) { var ret string return ret } @@ -224,7 +242,7 @@ func (o *OAuth2LoginRequest) GetSessionId() string { // GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LoginRequest) GetSessionIdOk() (*string, bool) { - if o == nil || o.SessionId == nil { + if o == nil || IsNil(o.SessionId) { return nil, false } return o.SessionId, true @@ -232,7 +250,7 @@ func (o *OAuth2LoginRequest) GetSessionIdOk() (*string, bool) { // HasSessionId returns a boolean if a field has been set. func (o *OAuth2LoginRequest) HasSessionId() bool { - if o != nil && o.SessionId != nil { + if o != nil && !IsNil(o.SessionId) { return true } @@ -293,49 +311,76 @@ func (o *OAuth2LoginRequest) SetSubject(v string) { } func (o OAuth2LoginRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["challenge"] = o.Challenge + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if true { - toSerialize["client"] = o.Client - } - if o.OidcContext != nil { + return json.Marshal(toSerialize) +} + +func (o OAuth2LoginRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["challenge"] = o.Challenge + toSerialize["client"] = o.Client + if !IsNil(o.OidcContext) { toSerialize["oidc_context"] = o.OidcContext } - if true { - toSerialize["request_url"] = o.RequestUrl - } - if true { + toSerialize["request_url"] = o.RequestUrl + if !IsNil(o.RequestedAccessTokenAudience) { toSerialize["requested_access_token_audience"] = o.RequestedAccessTokenAudience } - if true { + if !IsNil(o.RequestedScope) { toSerialize["requested_scope"] = o.RequestedScope } - if o.SessionId != nil { + if !IsNil(o.SessionId) { toSerialize["session_id"] = o.SessionId } - if true { - toSerialize["skip"] = o.Skip - } - if true { - toSerialize["subject"] = o.Subject - } + toSerialize["skip"] = o.Skip + toSerialize["subject"] = o.Subject for key, value := range o.AdditionalProperties { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OAuth2LoginRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "challenge", + "client", + "request_url", + "skip", + "subject", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varOAuth2LoginRequest := _OAuth2LoginRequest{} - if err = json.Unmarshal(bytes, &varOAuth2LoginRequest); err == nil { - *o = OAuth2LoginRequest(varOAuth2LoginRequest) + err = json.Unmarshal(bytes, &varOAuth2LoginRequest) + + if err != nil { + return err } + *o = OAuth2LoginRequest(varOAuth2LoginRequest) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_o_auth2_logout_request.go b/model_o_auth2_logout_request.go index 3879e3f..468de71 100644 --- a/model_o_auth2_logout_request.go +++ b/model_o_auth2_logout_request.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the OAuth2LogoutRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2LogoutRequest{} + // OAuth2LogoutRequest struct for OAuth2LogoutRequest type OAuth2LogoutRequest struct { // Challenge is the identifier (\"logout challenge\") of the logout authentication request. It is used to identify the session. @@ -52,7 +55,7 @@ func NewOAuth2LogoutRequestWithDefaults() *OAuth2LogoutRequest { // GetChallenge returns the Challenge field value if set, zero value otherwise. func (o *OAuth2LogoutRequest) GetChallenge() string { - if o == nil || o.Challenge == nil { + if o == nil || IsNil(o.Challenge) { var ret string return ret } @@ -62,7 +65,7 @@ func (o *OAuth2LogoutRequest) GetChallenge() string { // GetChallengeOk returns a tuple with the Challenge field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LogoutRequest) GetChallengeOk() (*string, bool) { - if o == nil || o.Challenge == nil { + if o == nil || IsNil(o.Challenge) { return nil, false } return o.Challenge, true @@ -70,7 +73,7 @@ func (o *OAuth2LogoutRequest) GetChallengeOk() (*string, bool) { // HasChallenge returns a boolean if a field has been set. func (o *OAuth2LogoutRequest) HasChallenge() bool { - if o != nil && o.Challenge != nil { + if o != nil && !IsNil(o.Challenge) { return true } @@ -84,7 +87,7 @@ func (o *OAuth2LogoutRequest) SetChallenge(v string) { // GetClient returns the Client field value if set, zero value otherwise. func (o *OAuth2LogoutRequest) GetClient() OAuth2Client { - if o == nil || o.Client == nil { + if o == nil || IsNil(o.Client) { var ret OAuth2Client return ret } @@ -94,7 +97,7 @@ func (o *OAuth2LogoutRequest) GetClient() OAuth2Client { // GetClientOk returns a tuple with the Client field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LogoutRequest) GetClientOk() (*OAuth2Client, bool) { - if o == nil || o.Client == nil { + if o == nil || IsNil(o.Client) { return nil, false } return o.Client, true @@ -102,7 +105,7 @@ func (o *OAuth2LogoutRequest) GetClientOk() (*OAuth2Client, bool) { // HasClient returns a boolean if a field has been set. func (o *OAuth2LogoutRequest) HasClient() bool { - if o != nil && o.Client != nil { + if o != nil && !IsNil(o.Client) { return true } @@ -116,7 +119,7 @@ func (o *OAuth2LogoutRequest) SetClient(v OAuth2Client) { // GetRequestUrl returns the RequestUrl field value if set, zero value otherwise. func (o *OAuth2LogoutRequest) GetRequestUrl() string { - if o == nil || o.RequestUrl == nil { + if o == nil || IsNil(o.RequestUrl) { var ret string return ret } @@ -126,7 +129,7 @@ func (o *OAuth2LogoutRequest) GetRequestUrl() string { // GetRequestUrlOk returns a tuple with the RequestUrl field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LogoutRequest) GetRequestUrlOk() (*string, bool) { - if o == nil || o.RequestUrl == nil { + if o == nil || IsNil(o.RequestUrl) { return nil, false } return o.RequestUrl, true @@ -134,7 +137,7 @@ func (o *OAuth2LogoutRequest) GetRequestUrlOk() (*string, bool) { // HasRequestUrl returns a boolean if a field has been set. func (o *OAuth2LogoutRequest) HasRequestUrl() bool { - if o != nil && o.RequestUrl != nil { + if o != nil && !IsNil(o.RequestUrl) { return true } @@ -148,7 +151,7 @@ func (o *OAuth2LogoutRequest) SetRequestUrl(v string) { // GetRpInitiated returns the RpInitiated field value if set, zero value otherwise. func (o *OAuth2LogoutRequest) GetRpInitiated() bool { - if o == nil || o.RpInitiated == nil { + if o == nil || IsNil(o.RpInitiated) { var ret bool return ret } @@ -158,7 +161,7 @@ func (o *OAuth2LogoutRequest) GetRpInitiated() bool { // GetRpInitiatedOk returns a tuple with the RpInitiated field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LogoutRequest) GetRpInitiatedOk() (*bool, bool) { - if o == nil || o.RpInitiated == nil { + if o == nil || IsNil(o.RpInitiated) { return nil, false } return o.RpInitiated, true @@ -166,7 +169,7 @@ func (o *OAuth2LogoutRequest) GetRpInitiatedOk() (*bool, bool) { // HasRpInitiated returns a boolean if a field has been set. func (o *OAuth2LogoutRequest) HasRpInitiated() bool { - if o != nil && o.RpInitiated != nil { + if o != nil && !IsNil(o.RpInitiated) { return true } @@ -180,7 +183,7 @@ func (o *OAuth2LogoutRequest) SetRpInitiated(v bool) { // GetSid returns the Sid field value if set, zero value otherwise. func (o *OAuth2LogoutRequest) GetSid() string { - if o == nil || o.Sid == nil { + if o == nil || IsNil(o.Sid) { var ret string return ret } @@ -190,7 +193,7 @@ func (o *OAuth2LogoutRequest) GetSid() string { // GetSidOk returns a tuple with the Sid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LogoutRequest) GetSidOk() (*string, bool) { - if o == nil || o.Sid == nil { + if o == nil || IsNil(o.Sid) { return nil, false } return o.Sid, true @@ -198,7 +201,7 @@ func (o *OAuth2LogoutRequest) GetSidOk() (*string, bool) { // HasSid returns a boolean if a field has been set. func (o *OAuth2LogoutRequest) HasSid() bool { - if o != nil && o.Sid != nil { + if o != nil && !IsNil(o.Sid) { return true } @@ -212,7 +215,7 @@ func (o *OAuth2LogoutRequest) SetSid(v string) { // GetSubject returns the Subject field value if set, zero value otherwise. func (o *OAuth2LogoutRequest) GetSubject() string { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { var ret string return ret } @@ -222,7 +225,7 @@ func (o *OAuth2LogoutRequest) GetSubject() string { // GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2LogoutRequest) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { return nil, false } return o.Subject, true @@ -230,7 +233,7 @@ func (o *OAuth2LogoutRequest) GetSubjectOk() (*string, bool) { // HasSubject returns a boolean if a field has been set. func (o *OAuth2LogoutRequest) HasSubject() bool { - if o != nil && o.Subject != nil { + if o != nil && !IsNil(o.Subject) { return true } @@ -243,23 +246,31 @@ func (o *OAuth2LogoutRequest) SetSubject(v string) { } func (o OAuth2LogoutRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2LogoutRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Challenge != nil { + if !IsNil(o.Challenge) { toSerialize["challenge"] = o.Challenge } - if o.Client != nil { + if !IsNil(o.Client) { toSerialize["client"] = o.Client } - if o.RequestUrl != nil { + if !IsNil(o.RequestUrl) { toSerialize["request_url"] = o.RequestUrl } - if o.RpInitiated != nil { + if !IsNil(o.RpInitiated) { toSerialize["rp_initiated"] = o.RpInitiated } - if o.Sid != nil { + if !IsNil(o.Sid) { toSerialize["sid"] = o.Sid } - if o.Subject != nil { + if !IsNil(o.Subject) { toSerialize["subject"] = o.Subject } @@ -267,16 +278,20 @@ func (o OAuth2LogoutRequest) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OAuth2LogoutRequest) UnmarshalJSON(bytes []byte) (err error) { varOAuth2LogoutRequest := _OAuth2LogoutRequest{} - if err = json.Unmarshal(bytes, &varOAuth2LogoutRequest); err == nil { - *o = OAuth2LogoutRequest(varOAuth2LogoutRequest) + err = json.Unmarshal(bytes, &varOAuth2LogoutRequest) + + if err != nil { + return err } + *o = OAuth2LogoutRequest(varOAuth2LogoutRequest) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_o_auth2_redirect_to.go b/model_o_auth2_redirect_to.go index 160bebb..c41d34b 100644 --- a/model_o_auth2_redirect_to.go +++ b/model_o_auth2_redirect_to.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -13,8 +13,12 @@ package client import ( "encoding/json" + "fmt" ) +// checks if the OAuth2RedirectTo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2RedirectTo{} + // OAuth2RedirectTo Contains a redirect URL used to complete a login, consent, or logout request. type OAuth2RedirectTo struct { // RedirectURL is the URL which you should redirect the user's browser to once the authentication process is completed. @@ -67,25 +71,56 @@ func (o *OAuth2RedirectTo) SetRedirectTo(v string) { } func (o OAuth2RedirectTo) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["redirect_to"] = o.RedirectTo + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o OAuth2RedirectTo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["redirect_to"] = o.RedirectTo for key, value := range o.AdditionalProperties { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OAuth2RedirectTo) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "redirect_to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varOAuth2RedirectTo := _OAuth2RedirectTo{} - if err = json.Unmarshal(bytes, &varOAuth2RedirectTo); err == nil { - *o = OAuth2RedirectTo(varOAuth2RedirectTo) + err = json.Unmarshal(bytes, &varOAuth2RedirectTo) + + if err != nil { + return err } + *o = OAuth2RedirectTo(varOAuth2RedirectTo) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_o_auth2_token_exchange.go b/model_o_auth2_token_exchange.go index 662a335..ecc4130 100644 --- a/model_o_auth2_token_exchange.go +++ b/model_o_auth2_token_exchange.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the OAuth2TokenExchange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2TokenExchange{} + // OAuth2TokenExchange OAuth2 Token Exchange Result type OAuth2TokenExchange struct { // The access token issued by the authorization server. @@ -22,7 +25,7 @@ type OAuth2TokenExchange struct { // The lifetime in seconds of the access token. For example, the value \"3600\" denotes that the access token will expire in one hour from the time the response was generated. ExpiresIn *int64 `json:"expires_in,omitempty"` // To retrieve a refresh token request the id_token scope. - IdToken *int64 `json:"id_token,omitempty"` + IdToken *string `json:"id_token,omitempty"` // The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request. RefreshToken *string `json:"refresh_token,omitempty"` // The scope of the access token @@ -53,7 +56,7 @@ func NewOAuth2TokenExchangeWithDefaults() *OAuth2TokenExchange { // GetAccessToken returns the AccessToken field value if set, zero value otherwise. func (o *OAuth2TokenExchange) GetAccessToken() string { - if o == nil || o.AccessToken == nil { + if o == nil || IsNil(o.AccessToken) { var ret string return ret } @@ -63,7 +66,7 @@ func (o *OAuth2TokenExchange) GetAccessToken() string { // GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2TokenExchange) GetAccessTokenOk() (*string, bool) { - if o == nil || o.AccessToken == nil { + if o == nil || IsNil(o.AccessToken) { return nil, false } return o.AccessToken, true @@ -71,7 +74,7 @@ func (o *OAuth2TokenExchange) GetAccessTokenOk() (*string, bool) { // HasAccessToken returns a boolean if a field has been set. func (o *OAuth2TokenExchange) HasAccessToken() bool { - if o != nil && o.AccessToken != nil { + if o != nil && !IsNil(o.AccessToken) { return true } @@ -85,7 +88,7 @@ func (o *OAuth2TokenExchange) SetAccessToken(v string) { // GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise. func (o *OAuth2TokenExchange) GetExpiresIn() int64 { - if o == nil || o.ExpiresIn == nil { + if o == nil || IsNil(o.ExpiresIn) { var ret int64 return ret } @@ -95,7 +98,7 @@ func (o *OAuth2TokenExchange) GetExpiresIn() int64 { // GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2TokenExchange) GetExpiresInOk() (*int64, bool) { - if o == nil || o.ExpiresIn == nil { + if o == nil || IsNil(o.ExpiresIn) { return nil, false } return o.ExpiresIn, true @@ -103,7 +106,7 @@ func (o *OAuth2TokenExchange) GetExpiresInOk() (*int64, bool) { // HasExpiresIn returns a boolean if a field has been set. func (o *OAuth2TokenExchange) HasExpiresIn() bool { - if o != nil && o.ExpiresIn != nil { + if o != nil && !IsNil(o.ExpiresIn) { return true } @@ -116,9 +119,9 @@ func (o *OAuth2TokenExchange) SetExpiresIn(v int64) { } // GetIdToken returns the IdToken field value if set, zero value otherwise. -func (o *OAuth2TokenExchange) GetIdToken() int64 { - if o == nil || o.IdToken == nil { - var ret int64 +func (o *OAuth2TokenExchange) GetIdToken() string { + if o == nil || IsNil(o.IdToken) { + var ret string return ret } return *o.IdToken @@ -126,8 +129,8 @@ func (o *OAuth2TokenExchange) GetIdToken() int64 { // GetIdTokenOk returns a tuple with the IdToken field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OAuth2TokenExchange) GetIdTokenOk() (*int64, bool) { - if o == nil || o.IdToken == nil { +func (o *OAuth2TokenExchange) GetIdTokenOk() (*string, bool) { + if o == nil || IsNil(o.IdToken) { return nil, false } return o.IdToken, true @@ -135,21 +138,21 @@ func (o *OAuth2TokenExchange) GetIdTokenOk() (*int64, bool) { // HasIdToken returns a boolean if a field has been set. func (o *OAuth2TokenExchange) HasIdToken() bool { - if o != nil && o.IdToken != nil { + if o != nil && !IsNil(o.IdToken) { return true } return false } -// SetIdToken gets a reference to the given int64 and assigns it to the IdToken field. -func (o *OAuth2TokenExchange) SetIdToken(v int64) { +// SetIdToken gets a reference to the given string and assigns it to the IdToken field. +func (o *OAuth2TokenExchange) SetIdToken(v string) { o.IdToken = &v } // GetRefreshToken returns the RefreshToken field value if set, zero value otherwise. func (o *OAuth2TokenExchange) GetRefreshToken() string { - if o == nil || o.RefreshToken == nil { + if o == nil || IsNil(o.RefreshToken) { var ret string return ret } @@ -159,7 +162,7 @@ func (o *OAuth2TokenExchange) GetRefreshToken() string { // GetRefreshTokenOk returns a tuple with the RefreshToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2TokenExchange) GetRefreshTokenOk() (*string, bool) { - if o == nil || o.RefreshToken == nil { + if o == nil || IsNil(o.RefreshToken) { return nil, false } return o.RefreshToken, true @@ -167,7 +170,7 @@ func (o *OAuth2TokenExchange) GetRefreshTokenOk() (*string, bool) { // HasRefreshToken returns a boolean if a field has been set. func (o *OAuth2TokenExchange) HasRefreshToken() bool { - if o != nil && o.RefreshToken != nil { + if o != nil && !IsNil(o.RefreshToken) { return true } @@ -181,7 +184,7 @@ func (o *OAuth2TokenExchange) SetRefreshToken(v string) { // GetScope returns the Scope field value if set, zero value otherwise. func (o *OAuth2TokenExchange) GetScope() string { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { var ret string return ret } @@ -191,7 +194,7 @@ func (o *OAuth2TokenExchange) GetScope() string { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2TokenExchange) GetScopeOk() (*string, bool) { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { return nil, false } return o.Scope, true @@ -199,7 +202,7 @@ func (o *OAuth2TokenExchange) GetScopeOk() (*string, bool) { // HasScope returns a boolean if a field has been set. func (o *OAuth2TokenExchange) HasScope() bool { - if o != nil && o.Scope != nil { + if o != nil && !IsNil(o.Scope) { return true } @@ -213,7 +216,7 @@ func (o *OAuth2TokenExchange) SetScope(v string) { // GetTokenType returns the TokenType field value if set, zero value otherwise. func (o *OAuth2TokenExchange) GetTokenType() string { - if o == nil || o.TokenType == nil { + if o == nil || IsNil(o.TokenType) { var ret string return ret } @@ -223,7 +226,7 @@ func (o *OAuth2TokenExchange) GetTokenType() string { // GetTokenTypeOk returns a tuple with the TokenType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2TokenExchange) GetTokenTypeOk() (*string, bool) { - if o == nil || o.TokenType == nil { + if o == nil || IsNil(o.TokenType) { return nil, false } return o.TokenType, true @@ -231,7 +234,7 @@ func (o *OAuth2TokenExchange) GetTokenTypeOk() (*string, bool) { // HasTokenType returns a boolean if a field has been set. func (o *OAuth2TokenExchange) HasTokenType() bool { - if o != nil && o.TokenType != nil { + if o != nil && !IsNil(o.TokenType) { return true } @@ -244,23 +247,31 @@ func (o *OAuth2TokenExchange) SetTokenType(v string) { } func (o OAuth2TokenExchange) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2TokenExchange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AccessToken != nil { + if !IsNil(o.AccessToken) { toSerialize["access_token"] = o.AccessToken } - if o.ExpiresIn != nil { + if !IsNil(o.ExpiresIn) { toSerialize["expires_in"] = o.ExpiresIn } - if o.IdToken != nil { + if !IsNil(o.IdToken) { toSerialize["id_token"] = o.IdToken } - if o.RefreshToken != nil { + if !IsNil(o.RefreshToken) { toSerialize["refresh_token"] = o.RefreshToken } - if o.Scope != nil { + if !IsNil(o.Scope) { toSerialize["scope"] = o.Scope } - if o.TokenType != nil { + if !IsNil(o.TokenType) { toSerialize["token_type"] = o.TokenType } @@ -268,16 +279,20 @@ func (o OAuth2TokenExchange) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OAuth2TokenExchange) UnmarshalJSON(bytes []byte) (err error) { varOAuth2TokenExchange := _OAuth2TokenExchange{} - if err = json.Unmarshal(bytes, &varOAuth2TokenExchange); err == nil { - *o = OAuth2TokenExchange(varOAuth2TokenExchange) + err = json.Unmarshal(bytes, &varOAuth2TokenExchange) + + if err != nil { + return err } + *o = OAuth2TokenExchange(varOAuth2TokenExchange) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_oidc_configuration.go b/model_oidc_configuration.go index d6e0e01..8fbe534 100644 --- a/model_oidc_configuration.go +++ b/model_oidc_configuration.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -13,8 +13,12 @@ package client import ( "encoding/json" + "fmt" ) +// checks if the OidcConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OidcConfiguration{} + // OidcConfiguration Includes links to several endpoints (for example `/oauth2/token`) and exposes information on supported signature algorithms among others. type OidcConfiguration struct { // OAuth 2.0 Authorization Endpoint URL @@ -136,7 +140,7 @@ func (o *OidcConfiguration) SetAuthorizationEndpoint(v string) { // GetBackchannelLogoutSessionSupported returns the BackchannelLogoutSessionSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetBackchannelLogoutSessionSupported() bool { - if o == nil || o.BackchannelLogoutSessionSupported == nil { + if o == nil || IsNil(o.BackchannelLogoutSessionSupported) { var ret bool return ret } @@ -146,7 +150,7 @@ func (o *OidcConfiguration) GetBackchannelLogoutSessionSupported() bool { // GetBackchannelLogoutSessionSupportedOk returns a tuple with the BackchannelLogoutSessionSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetBackchannelLogoutSessionSupportedOk() (*bool, bool) { - if o == nil || o.BackchannelLogoutSessionSupported == nil { + if o == nil || IsNil(o.BackchannelLogoutSessionSupported) { return nil, false } return o.BackchannelLogoutSessionSupported, true @@ -154,7 +158,7 @@ func (o *OidcConfiguration) GetBackchannelLogoutSessionSupportedOk() (*bool, boo // HasBackchannelLogoutSessionSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasBackchannelLogoutSessionSupported() bool { - if o != nil && o.BackchannelLogoutSessionSupported != nil { + if o != nil && !IsNil(o.BackchannelLogoutSessionSupported) { return true } @@ -168,7 +172,7 @@ func (o *OidcConfiguration) SetBackchannelLogoutSessionSupported(v bool) { // GetBackchannelLogoutSupported returns the BackchannelLogoutSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetBackchannelLogoutSupported() bool { - if o == nil || o.BackchannelLogoutSupported == nil { + if o == nil || IsNil(o.BackchannelLogoutSupported) { var ret bool return ret } @@ -178,7 +182,7 @@ func (o *OidcConfiguration) GetBackchannelLogoutSupported() bool { // GetBackchannelLogoutSupportedOk returns a tuple with the BackchannelLogoutSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetBackchannelLogoutSupportedOk() (*bool, bool) { - if o == nil || o.BackchannelLogoutSupported == nil { + if o == nil || IsNil(o.BackchannelLogoutSupported) { return nil, false } return o.BackchannelLogoutSupported, true @@ -186,7 +190,7 @@ func (o *OidcConfiguration) GetBackchannelLogoutSupportedOk() (*bool, bool) { // HasBackchannelLogoutSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasBackchannelLogoutSupported() bool { - if o != nil && o.BackchannelLogoutSupported != nil { + if o != nil && !IsNil(o.BackchannelLogoutSupported) { return true } @@ -200,7 +204,7 @@ func (o *OidcConfiguration) SetBackchannelLogoutSupported(v bool) { // GetClaimsParameterSupported returns the ClaimsParameterSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetClaimsParameterSupported() bool { - if o == nil || o.ClaimsParameterSupported == nil { + if o == nil || IsNil(o.ClaimsParameterSupported) { var ret bool return ret } @@ -210,7 +214,7 @@ func (o *OidcConfiguration) GetClaimsParameterSupported() bool { // GetClaimsParameterSupportedOk returns a tuple with the ClaimsParameterSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetClaimsParameterSupportedOk() (*bool, bool) { - if o == nil || o.ClaimsParameterSupported == nil { + if o == nil || IsNil(o.ClaimsParameterSupported) { return nil, false } return o.ClaimsParameterSupported, true @@ -218,7 +222,7 @@ func (o *OidcConfiguration) GetClaimsParameterSupportedOk() (*bool, bool) { // HasClaimsParameterSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasClaimsParameterSupported() bool { - if o != nil && o.ClaimsParameterSupported != nil { + if o != nil && !IsNil(o.ClaimsParameterSupported) { return true } @@ -232,7 +236,7 @@ func (o *OidcConfiguration) SetClaimsParameterSupported(v bool) { // GetClaimsSupported returns the ClaimsSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetClaimsSupported() []string { - if o == nil || o.ClaimsSupported == nil { + if o == nil || IsNil(o.ClaimsSupported) { var ret []string return ret } @@ -242,7 +246,7 @@ func (o *OidcConfiguration) GetClaimsSupported() []string { // GetClaimsSupportedOk returns a tuple with the ClaimsSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetClaimsSupportedOk() ([]string, bool) { - if o == nil || o.ClaimsSupported == nil { + if o == nil || IsNil(o.ClaimsSupported) { return nil, false } return o.ClaimsSupported, true @@ -250,7 +254,7 @@ func (o *OidcConfiguration) GetClaimsSupportedOk() ([]string, bool) { // HasClaimsSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasClaimsSupported() bool { - if o != nil && o.ClaimsSupported != nil { + if o != nil && !IsNil(o.ClaimsSupported) { return true } @@ -264,7 +268,7 @@ func (o *OidcConfiguration) SetClaimsSupported(v []string) { // GetCodeChallengeMethodsSupported returns the CodeChallengeMethodsSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetCodeChallengeMethodsSupported() []string { - if o == nil || o.CodeChallengeMethodsSupported == nil { + if o == nil || IsNil(o.CodeChallengeMethodsSupported) { var ret []string return ret } @@ -274,7 +278,7 @@ func (o *OidcConfiguration) GetCodeChallengeMethodsSupported() []string { // GetCodeChallengeMethodsSupportedOk returns a tuple with the CodeChallengeMethodsSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetCodeChallengeMethodsSupportedOk() ([]string, bool) { - if o == nil || o.CodeChallengeMethodsSupported == nil { + if o == nil || IsNil(o.CodeChallengeMethodsSupported) { return nil, false } return o.CodeChallengeMethodsSupported, true @@ -282,7 +286,7 @@ func (o *OidcConfiguration) GetCodeChallengeMethodsSupportedOk() ([]string, bool // HasCodeChallengeMethodsSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasCodeChallengeMethodsSupported() bool { - if o != nil && o.CodeChallengeMethodsSupported != nil { + if o != nil && !IsNil(o.CodeChallengeMethodsSupported) { return true } @@ -296,7 +300,7 @@ func (o *OidcConfiguration) SetCodeChallengeMethodsSupported(v []string) { // GetCredentialsEndpointDraft00 returns the CredentialsEndpointDraft00 field value if set, zero value otherwise. func (o *OidcConfiguration) GetCredentialsEndpointDraft00() string { - if o == nil || o.CredentialsEndpointDraft00 == nil { + if o == nil || IsNil(o.CredentialsEndpointDraft00) { var ret string return ret } @@ -306,7 +310,7 @@ func (o *OidcConfiguration) GetCredentialsEndpointDraft00() string { // GetCredentialsEndpointDraft00Ok returns a tuple with the CredentialsEndpointDraft00 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetCredentialsEndpointDraft00Ok() (*string, bool) { - if o == nil || o.CredentialsEndpointDraft00 == nil { + if o == nil || IsNil(o.CredentialsEndpointDraft00) { return nil, false } return o.CredentialsEndpointDraft00, true @@ -314,7 +318,7 @@ func (o *OidcConfiguration) GetCredentialsEndpointDraft00Ok() (*string, bool) { // HasCredentialsEndpointDraft00 returns a boolean if a field has been set. func (o *OidcConfiguration) HasCredentialsEndpointDraft00() bool { - if o != nil && o.CredentialsEndpointDraft00 != nil { + if o != nil && !IsNil(o.CredentialsEndpointDraft00) { return true } @@ -328,7 +332,7 @@ func (o *OidcConfiguration) SetCredentialsEndpointDraft00(v string) { // GetCredentialsSupportedDraft00 returns the CredentialsSupportedDraft00 field value if set, zero value otherwise. func (o *OidcConfiguration) GetCredentialsSupportedDraft00() []CredentialSupportedDraft00 { - if o == nil || o.CredentialsSupportedDraft00 == nil { + if o == nil || IsNil(o.CredentialsSupportedDraft00) { var ret []CredentialSupportedDraft00 return ret } @@ -338,7 +342,7 @@ func (o *OidcConfiguration) GetCredentialsSupportedDraft00() []CredentialSupport // GetCredentialsSupportedDraft00Ok returns a tuple with the CredentialsSupportedDraft00 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetCredentialsSupportedDraft00Ok() ([]CredentialSupportedDraft00, bool) { - if o == nil || o.CredentialsSupportedDraft00 == nil { + if o == nil || IsNil(o.CredentialsSupportedDraft00) { return nil, false } return o.CredentialsSupportedDraft00, true @@ -346,7 +350,7 @@ func (o *OidcConfiguration) GetCredentialsSupportedDraft00Ok() ([]CredentialSupp // HasCredentialsSupportedDraft00 returns a boolean if a field has been set. func (o *OidcConfiguration) HasCredentialsSupportedDraft00() bool { - if o != nil && o.CredentialsSupportedDraft00 != nil { + if o != nil && !IsNil(o.CredentialsSupportedDraft00) { return true } @@ -360,7 +364,7 @@ func (o *OidcConfiguration) SetCredentialsSupportedDraft00(v []CredentialSupport // GetEndSessionEndpoint returns the EndSessionEndpoint field value if set, zero value otherwise. func (o *OidcConfiguration) GetEndSessionEndpoint() string { - if o == nil || o.EndSessionEndpoint == nil { + if o == nil || IsNil(o.EndSessionEndpoint) { var ret string return ret } @@ -370,7 +374,7 @@ func (o *OidcConfiguration) GetEndSessionEndpoint() string { // GetEndSessionEndpointOk returns a tuple with the EndSessionEndpoint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetEndSessionEndpointOk() (*string, bool) { - if o == nil || o.EndSessionEndpoint == nil { + if o == nil || IsNil(o.EndSessionEndpoint) { return nil, false } return o.EndSessionEndpoint, true @@ -378,7 +382,7 @@ func (o *OidcConfiguration) GetEndSessionEndpointOk() (*string, bool) { // HasEndSessionEndpoint returns a boolean if a field has been set. func (o *OidcConfiguration) HasEndSessionEndpoint() bool { - if o != nil && o.EndSessionEndpoint != nil { + if o != nil && !IsNil(o.EndSessionEndpoint) { return true } @@ -392,7 +396,7 @@ func (o *OidcConfiguration) SetEndSessionEndpoint(v string) { // GetFrontchannelLogoutSessionSupported returns the FrontchannelLogoutSessionSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetFrontchannelLogoutSessionSupported() bool { - if o == nil || o.FrontchannelLogoutSessionSupported == nil { + if o == nil || IsNil(o.FrontchannelLogoutSessionSupported) { var ret bool return ret } @@ -402,7 +406,7 @@ func (o *OidcConfiguration) GetFrontchannelLogoutSessionSupported() bool { // GetFrontchannelLogoutSessionSupportedOk returns a tuple with the FrontchannelLogoutSessionSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetFrontchannelLogoutSessionSupportedOk() (*bool, bool) { - if o == nil || o.FrontchannelLogoutSessionSupported == nil { + if o == nil || IsNil(o.FrontchannelLogoutSessionSupported) { return nil, false } return o.FrontchannelLogoutSessionSupported, true @@ -410,7 +414,7 @@ func (o *OidcConfiguration) GetFrontchannelLogoutSessionSupportedOk() (*bool, bo // HasFrontchannelLogoutSessionSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasFrontchannelLogoutSessionSupported() bool { - if o != nil && o.FrontchannelLogoutSessionSupported != nil { + if o != nil && !IsNil(o.FrontchannelLogoutSessionSupported) { return true } @@ -424,7 +428,7 @@ func (o *OidcConfiguration) SetFrontchannelLogoutSessionSupported(v bool) { // GetFrontchannelLogoutSupported returns the FrontchannelLogoutSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetFrontchannelLogoutSupported() bool { - if o == nil || o.FrontchannelLogoutSupported == nil { + if o == nil || IsNil(o.FrontchannelLogoutSupported) { var ret bool return ret } @@ -434,7 +438,7 @@ func (o *OidcConfiguration) GetFrontchannelLogoutSupported() bool { // GetFrontchannelLogoutSupportedOk returns a tuple with the FrontchannelLogoutSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetFrontchannelLogoutSupportedOk() (*bool, bool) { - if o == nil || o.FrontchannelLogoutSupported == nil { + if o == nil || IsNil(o.FrontchannelLogoutSupported) { return nil, false } return o.FrontchannelLogoutSupported, true @@ -442,7 +446,7 @@ func (o *OidcConfiguration) GetFrontchannelLogoutSupportedOk() (*bool, bool) { // HasFrontchannelLogoutSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasFrontchannelLogoutSupported() bool { - if o != nil && o.FrontchannelLogoutSupported != nil { + if o != nil && !IsNil(o.FrontchannelLogoutSupported) { return true } @@ -456,7 +460,7 @@ func (o *OidcConfiguration) SetFrontchannelLogoutSupported(v bool) { // GetGrantTypesSupported returns the GrantTypesSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetGrantTypesSupported() []string { - if o == nil || o.GrantTypesSupported == nil { + if o == nil || IsNil(o.GrantTypesSupported) { var ret []string return ret } @@ -466,7 +470,7 @@ func (o *OidcConfiguration) GetGrantTypesSupported() []string { // GetGrantTypesSupportedOk returns a tuple with the GrantTypesSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetGrantTypesSupportedOk() ([]string, bool) { - if o == nil || o.GrantTypesSupported == nil { + if o == nil || IsNil(o.GrantTypesSupported) { return nil, false } return o.GrantTypesSupported, true @@ -474,7 +478,7 @@ func (o *OidcConfiguration) GetGrantTypesSupportedOk() ([]string, bool) { // HasGrantTypesSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasGrantTypesSupported() bool { - if o != nil && o.GrantTypesSupported != nil { + if o != nil && !IsNil(o.GrantTypesSupported) { return true } @@ -584,7 +588,7 @@ func (o *OidcConfiguration) SetJwksUri(v string) { // GetRegistrationEndpoint returns the RegistrationEndpoint field value if set, zero value otherwise. func (o *OidcConfiguration) GetRegistrationEndpoint() string { - if o == nil || o.RegistrationEndpoint == nil { + if o == nil || IsNil(o.RegistrationEndpoint) { var ret string return ret } @@ -594,7 +598,7 @@ func (o *OidcConfiguration) GetRegistrationEndpoint() string { // GetRegistrationEndpointOk returns a tuple with the RegistrationEndpoint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetRegistrationEndpointOk() (*string, bool) { - if o == nil || o.RegistrationEndpoint == nil { + if o == nil || IsNil(o.RegistrationEndpoint) { return nil, false } return o.RegistrationEndpoint, true @@ -602,7 +606,7 @@ func (o *OidcConfiguration) GetRegistrationEndpointOk() (*string, bool) { // HasRegistrationEndpoint returns a boolean if a field has been set. func (o *OidcConfiguration) HasRegistrationEndpoint() bool { - if o != nil && o.RegistrationEndpoint != nil { + if o != nil && !IsNil(o.RegistrationEndpoint) { return true } @@ -616,7 +620,7 @@ func (o *OidcConfiguration) SetRegistrationEndpoint(v string) { // GetRequestObjectSigningAlgValuesSupported returns the RequestObjectSigningAlgValuesSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetRequestObjectSigningAlgValuesSupported() []string { - if o == nil || o.RequestObjectSigningAlgValuesSupported == nil { + if o == nil || IsNil(o.RequestObjectSigningAlgValuesSupported) { var ret []string return ret } @@ -626,7 +630,7 @@ func (o *OidcConfiguration) GetRequestObjectSigningAlgValuesSupported() []string // GetRequestObjectSigningAlgValuesSupportedOk returns a tuple with the RequestObjectSigningAlgValuesSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetRequestObjectSigningAlgValuesSupportedOk() ([]string, bool) { - if o == nil || o.RequestObjectSigningAlgValuesSupported == nil { + if o == nil || IsNil(o.RequestObjectSigningAlgValuesSupported) { return nil, false } return o.RequestObjectSigningAlgValuesSupported, true @@ -634,7 +638,7 @@ func (o *OidcConfiguration) GetRequestObjectSigningAlgValuesSupportedOk() ([]str // HasRequestObjectSigningAlgValuesSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasRequestObjectSigningAlgValuesSupported() bool { - if o != nil && o.RequestObjectSigningAlgValuesSupported != nil { + if o != nil && !IsNil(o.RequestObjectSigningAlgValuesSupported) { return true } @@ -648,7 +652,7 @@ func (o *OidcConfiguration) SetRequestObjectSigningAlgValuesSupported(v []string // GetRequestParameterSupported returns the RequestParameterSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetRequestParameterSupported() bool { - if o == nil || o.RequestParameterSupported == nil { + if o == nil || IsNil(o.RequestParameterSupported) { var ret bool return ret } @@ -658,7 +662,7 @@ func (o *OidcConfiguration) GetRequestParameterSupported() bool { // GetRequestParameterSupportedOk returns a tuple with the RequestParameterSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetRequestParameterSupportedOk() (*bool, bool) { - if o == nil || o.RequestParameterSupported == nil { + if o == nil || IsNil(o.RequestParameterSupported) { return nil, false } return o.RequestParameterSupported, true @@ -666,7 +670,7 @@ func (o *OidcConfiguration) GetRequestParameterSupportedOk() (*bool, bool) { // HasRequestParameterSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasRequestParameterSupported() bool { - if o != nil && o.RequestParameterSupported != nil { + if o != nil && !IsNil(o.RequestParameterSupported) { return true } @@ -680,7 +684,7 @@ func (o *OidcConfiguration) SetRequestParameterSupported(v bool) { // GetRequestUriParameterSupported returns the RequestUriParameterSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetRequestUriParameterSupported() bool { - if o == nil || o.RequestUriParameterSupported == nil { + if o == nil || IsNil(o.RequestUriParameterSupported) { var ret bool return ret } @@ -690,7 +694,7 @@ func (o *OidcConfiguration) GetRequestUriParameterSupported() bool { // GetRequestUriParameterSupportedOk returns a tuple with the RequestUriParameterSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetRequestUriParameterSupportedOk() (*bool, bool) { - if o == nil || o.RequestUriParameterSupported == nil { + if o == nil || IsNil(o.RequestUriParameterSupported) { return nil, false } return o.RequestUriParameterSupported, true @@ -698,7 +702,7 @@ func (o *OidcConfiguration) GetRequestUriParameterSupportedOk() (*bool, bool) { // HasRequestUriParameterSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasRequestUriParameterSupported() bool { - if o != nil && o.RequestUriParameterSupported != nil { + if o != nil && !IsNil(o.RequestUriParameterSupported) { return true } @@ -712,7 +716,7 @@ func (o *OidcConfiguration) SetRequestUriParameterSupported(v bool) { // GetRequireRequestUriRegistration returns the RequireRequestUriRegistration field value if set, zero value otherwise. func (o *OidcConfiguration) GetRequireRequestUriRegistration() bool { - if o == nil || o.RequireRequestUriRegistration == nil { + if o == nil || IsNil(o.RequireRequestUriRegistration) { var ret bool return ret } @@ -722,7 +726,7 @@ func (o *OidcConfiguration) GetRequireRequestUriRegistration() bool { // GetRequireRequestUriRegistrationOk returns a tuple with the RequireRequestUriRegistration field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetRequireRequestUriRegistrationOk() (*bool, bool) { - if o == nil || o.RequireRequestUriRegistration == nil { + if o == nil || IsNil(o.RequireRequestUriRegistration) { return nil, false } return o.RequireRequestUriRegistration, true @@ -730,7 +734,7 @@ func (o *OidcConfiguration) GetRequireRequestUriRegistrationOk() (*bool, bool) { // HasRequireRequestUriRegistration returns a boolean if a field has been set. func (o *OidcConfiguration) HasRequireRequestUriRegistration() bool { - if o != nil && o.RequireRequestUriRegistration != nil { + if o != nil && !IsNil(o.RequireRequestUriRegistration) { return true } @@ -744,7 +748,7 @@ func (o *OidcConfiguration) SetRequireRequestUriRegistration(v bool) { // GetResponseModesSupported returns the ResponseModesSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetResponseModesSupported() []string { - if o == nil || o.ResponseModesSupported == nil { + if o == nil || IsNil(o.ResponseModesSupported) { var ret []string return ret } @@ -754,7 +758,7 @@ func (o *OidcConfiguration) GetResponseModesSupported() []string { // GetResponseModesSupportedOk returns a tuple with the ResponseModesSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetResponseModesSupportedOk() ([]string, bool) { - if o == nil || o.ResponseModesSupported == nil { + if o == nil || IsNil(o.ResponseModesSupported) { return nil, false } return o.ResponseModesSupported, true @@ -762,7 +766,7 @@ func (o *OidcConfiguration) GetResponseModesSupportedOk() ([]string, bool) { // HasResponseModesSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasResponseModesSupported() bool { - if o != nil && o.ResponseModesSupported != nil { + if o != nil && !IsNil(o.ResponseModesSupported) { return true } @@ -800,7 +804,7 @@ func (o *OidcConfiguration) SetResponseTypesSupported(v []string) { // GetRevocationEndpoint returns the RevocationEndpoint field value if set, zero value otherwise. func (o *OidcConfiguration) GetRevocationEndpoint() string { - if o == nil || o.RevocationEndpoint == nil { + if o == nil || IsNil(o.RevocationEndpoint) { var ret string return ret } @@ -810,7 +814,7 @@ func (o *OidcConfiguration) GetRevocationEndpoint() string { // GetRevocationEndpointOk returns a tuple with the RevocationEndpoint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetRevocationEndpointOk() (*string, bool) { - if o == nil || o.RevocationEndpoint == nil { + if o == nil || IsNil(o.RevocationEndpoint) { return nil, false } return o.RevocationEndpoint, true @@ -818,7 +822,7 @@ func (o *OidcConfiguration) GetRevocationEndpointOk() (*string, bool) { // HasRevocationEndpoint returns a boolean if a field has been set. func (o *OidcConfiguration) HasRevocationEndpoint() bool { - if o != nil && o.RevocationEndpoint != nil { + if o != nil && !IsNil(o.RevocationEndpoint) { return true } @@ -832,7 +836,7 @@ func (o *OidcConfiguration) SetRevocationEndpoint(v string) { // GetScopesSupported returns the ScopesSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetScopesSupported() []string { - if o == nil || o.ScopesSupported == nil { + if o == nil || IsNil(o.ScopesSupported) { var ret []string return ret } @@ -842,7 +846,7 @@ func (o *OidcConfiguration) GetScopesSupported() []string { // GetScopesSupportedOk returns a tuple with the ScopesSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetScopesSupportedOk() ([]string, bool) { - if o == nil || o.ScopesSupported == nil { + if o == nil || IsNil(o.ScopesSupported) { return nil, false } return o.ScopesSupported, true @@ -850,7 +854,7 @@ func (o *OidcConfiguration) GetScopesSupportedOk() ([]string, bool) { // HasScopesSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasScopesSupported() bool { - if o != nil && o.ScopesSupported != nil { + if o != nil && !IsNil(o.ScopesSupported) { return true } @@ -912,7 +916,7 @@ func (o *OidcConfiguration) SetTokenEndpoint(v string) { // GetTokenEndpointAuthMethodsSupported returns the TokenEndpointAuthMethodsSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetTokenEndpointAuthMethodsSupported() []string { - if o == nil || o.TokenEndpointAuthMethodsSupported == nil { + if o == nil || IsNil(o.TokenEndpointAuthMethodsSupported) { var ret []string return ret } @@ -922,7 +926,7 @@ func (o *OidcConfiguration) GetTokenEndpointAuthMethodsSupported() []string { // GetTokenEndpointAuthMethodsSupportedOk returns a tuple with the TokenEndpointAuthMethodsSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetTokenEndpointAuthMethodsSupportedOk() ([]string, bool) { - if o == nil || o.TokenEndpointAuthMethodsSupported == nil { + if o == nil || IsNil(o.TokenEndpointAuthMethodsSupported) { return nil, false } return o.TokenEndpointAuthMethodsSupported, true @@ -930,7 +934,7 @@ func (o *OidcConfiguration) GetTokenEndpointAuthMethodsSupportedOk() ([]string, // HasTokenEndpointAuthMethodsSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasTokenEndpointAuthMethodsSupported() bool { - if o != nil && o.TokenEndpointAuthMethodsSupported != nil { + if o != nil && !IsNil(o.TokenEndpointAuthMethodsSupported) { return true } @@ -944,7 +948,7 @@ func (o *OidcConfiguration) SetTokenEndpointAuthMethodsSupported(v []string) { // GetUserinfoEndpoint returns the UserinfoEndpoint field value if set, zero value otherwise. func (o *OidcConfiguration) GetUserinfoEndpoint() string { - if o == nil || o.UserinfoEndpoint == nil { + if o == nil || IsNil(o.UserinfoEndpoint) { var ret string return ret } @@ -954,7 +958,7 @@ func (o *OidcConfiguration) GetUserinfoEndpoint() string { // GetUserinfoEndpointOk returns a tuple with the UserinfoEndpoint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetUserinfoEndpointOk() (*string, bool) { - if o == nil || o.UserinfoEndpoint == nil { + if o == nil || IsNil(o.UserinfoEndpoint) { return nil, false } return o.UserinfoEndpoint, true @@ -962,7 +966,7 @@ func (o *OidcConfiguration) GetUserinfoEndpointOk() (*string, bool) { // HasUserinfoEndpoint returns a boolean if a field has been set. func (o *OidcConfiguration) HasUserinfoEndpoint() bool { - if o != nil && o.UserinfoEndpoint != nil { + if o != nil && !IsNil(o.UserinfoEndpoint) { return true } @@ -1000,7 +1004,7 @@ func (o *OidcConfiguration) SetUserinfoSignedResponseAlg(v []string) { // GetUserinfoSigningAlgValuesSupported returns the UserinfoSigningAlgValuesSupported field value if set, zero value otherwise. func (o *OidcConfiguration) GetUserinfoSigningAlgValuesSupported() []string { - if o == nil || o.UserinfoSigningAlgValuesSupported == nil { + if o == nil || IsNil(o.UserinfoSigningAlgValuesSupported) { var ret []string return ret } @@ -1010,7 +1014,7 @@ func (o *OidcConfiguration) GetUserinfoSigningAlgValuesSupported() []string { // GetUserinfoSigningAlgValuesSupportedOk returns a tuple with the UserinfoSigningAlgValuesSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcConfiguration) GetUserinfoSigningAlgValuesSupportedOk() ([]string, bool) { - if o == nil || o.UserinfoSigningAlgValuesSupported == nil { + if o == nil || IsNil(o.UserinfoSigningAlgValuesSupported) { return nil, false } return o.UserinfoSigningAlgValuesSupported, true @@ -1018,7 +1022,7 @@ func (o *OidcConfiguration) GetUserinfoSigningAlgValuesSupportedOk() ([]string, // HasUserinfoSigningAlgValuesSupported returns a boolean if a field has been set. func (o *OidcConfiguration) HasUserinfoSigningAlgValuesSupported() bool { - if o != nil && o.UserinfoSigningAlgValuesSupported != nil { + if o != nil && !IsNil(o.UserinfoSigningAlgValuesSupported) { return true } @@ -1031,98 +1035,88 @@ func (o *OidcConfiguration) SetUserinfoSigningAlgValuesSupported(v []string) { } func (o OidcConfiguration) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["authorization_endpoint"] = o.AuthorizationEndpoint + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.BackchannelLogoutSessionSupported != nil { + return json.Marshal(toSerialize) +} + +func (o OidcConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["authorization_endpoint"] = o.AuthorizationEndpoint + if !IsNil(o.BackchannelLogoutSessionSupported) { toSerialize["backchannel_logout_session_supported"] = o.BackchannelLogoutSessionSupported } - if o.BackchannelLogoutSupported != nil { + if !IsNil(o.BackchannelLogoutSupported) { toSerialize["backchannel_logout_supported"] = o.BackchannelLogoutSupported } - if o.ClaimsParameterSupported != nil { + if !IsNil(o.ClaimsParameterSupported) { toSerialize["claims_parameter_supported"] = o.ClaimsParameterSupported } - if o.ClaimsSupported != nil { + if !IsNil(o.ClaimsSupported) { toSerialize["claims_supported"] = o.ClaimsSupported } - if o.CodeChallengeMethodsSupported != nil { + if !IsNil(o.CodeChallengeMethodsSupported) { toSerialize["code_challenge_methods_supported"] = o.CodeChallengeMethodsSupported } - if o.CredentialsEndpointDraft00 != nil { + if !IsNil(o.CredentialsEndpointDraft00) { toSerialize["credentials_endpoint_draft_00"] = o.CredentialsEndpointDraft00 } - if o.CredentialsSupportedDraft00 != nil { + if !IsNil(o.CredentialsSupportedDraft00) { toSerialize["credentials_supported_draft_00"] = o.CredentialsSupportedDraft00 } - if o.EndSessionEndpoint != nil { + if !IsNil(o.EndSessionEndpoint) { toSerialize["end_session_endpoint"] = o.EndSessionEndpoint } - if o.FrontchannelLogoutSessionSupported != nil { + if !IsNil(o.FrontchannelLogoutSessionSupported) { toSerialize["frontchannel_logout_session_supported"] = o.FrontchannelLogoutSessionSupported } - if o.FrontchannelLogoutSupported != nil { + if !IsNil(o.FrontchannelLogoutSupported) { toSerialize["frontchannel_logout_supported"] = o.FrontchannelLogoutSupported } - if o.GrantTypesSupported != nil { + if !IsNil(o.GrantTypesSupported) { toSerialize["grant_types_supported"] = o.GrantTypesSupported } - if true { - toSerialize["id_token_signed_response_alg"] = o.IdTokenSignedResponseAlg - } - if true { - toSerialize["id_token_signing_alg_values_supported"] = o.IdTokenSigningAlgValuesSupported - } - if true { - toSerialize["issuer"] = o.Issuer - } - if true { - toSerialize["jwks_uri"] = o.JwksUri - } - if o.RegistrationEndpoint != nil { + toSerialize["id_token_signed_response_alg"] = o.IdTokenSignedResponseAlg + toSerialize["id_token_signing_alg_values_supported"] = o.IdTokenSigningAlgValuesSupported + toSerialize["issuer"] = o.Issuer + toSerialize["jwks_uri"] = o.JwksUri + if !IsNil(o.RegistrationEndpoint) { toSerialize["registration_endpoint"] = o.RegistrationEndpoint } - if o.RequestObjectSigningAlgValuesSupported != nil { + if !IsNil(o.RequestObjectSigningAlgValuesSupported) { toSerialize["request_object_signing_alg_values_supported"] = o.RequestObjectSigningAlgValuesSupported } - if o.RequestParameterSupported != nil { + if !IsNil(o.RequestParameterSupported) { toSerialize["request_parameter_supported"] = o.RequestParameterSupported } - if o.RequestUriParameterSupported != nil { + if !IsNil(o.RequestUriParameterSupported) { toSerialize["request_uri_parameter_supported"] = o.RequestUriParameterSupported } - if o.RequireRequestUriRegistration != nil { + if !IsNil(o.RequireRequestUriRegistration) { toSerialize["require_request_uri_registration"] = o.RequireRequestUriRegistration } - if o.ResponseModesSupported != nil { + if !IsNil(o.ResponseModesSupported) { toSerialize["response_modes_supported"] = o.ResponseModesSupported } - if true { - toSerialize["response_types_supported"] = o.ResponseTypesSupported - } - if o.RevocationEndpoint != nil { + toSerialize["response_types_supported"] = o.ResponseTypesSupported + if !IsNil(o.RevocationEndpoint) { toSerialize["revocation_endpoint"] = o.RevocationEndpoint } - if o.ScopesSupported != nil { + if !IsNil(o.ScopesSupported) { toSerialize["scopes_supported"] = o.ScopesSupported } - if true { - toSerialize["subject_types_supported"] = o.SubjectTypesSupported - } - if true { - toSerialize["token_endpoint"] = o.TokenEndpoint - } - if o.TokenEndpointAuthMethodsSupported != nil { + toSerialize["subject_types_supported"] = o.SubjectTypesSupported + toSerialize["token_endpoint"] = o.TokenEndpoint + if !IsNil(o.TokenEndpointAuthMethodsSupported) { toSerialize["token_endpoint_auth_methods_supported"] = o.TokenEndpointAuthMethodsSupported } - if o.UserinfoEndpoint != nil { + if !IsNil(o.UserinfoEndpoint) { toSerialize["userinfo_endpoint"] = o.UserinfoEndpoint } - if true { - toSerialize["userinfo_signed_response_alg"] = o.UserinfoSignedResponseAlg - } - if o.UserinfoSigningAlgValuesSupported != nil { + toSerialize["userinfo_signed_response_alg"] = o.UserinfoSignedResponseAlg + if !IsNil(o.UserinfoSigningAlgValuesSupported) { toSerialize["userinfo_signing_alg_values_supported"] = o.UserinfoSigningAlgValuesSupported } @@ -1130,16 +1124,49 @@ func (o OidcConfiguration) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OidcConfiguration) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "authorization_endpoint", + "id_token_signed_response_alg", + "id_token_signing_alg_values_supported", + "issuer", + "jwks_uri", + "response_types_supported", + "subject_types_supported", + "token_endpoint", + "userinfo_signed_response_alg", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varOidcConfiguration := _OidcConfiguration{} - if err = json.Unmarshal(bytes, &varOidcConfiguration); err == nil { - *o = OidcConfiguration(varOidcConfiguration) + err = json.Unmarshal(bytes, &varOidcConfiguration) + + if err != nil { + return err } + *o = OidcConfiguration(varOidcConfiguration) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_oidc_user_info.go b/model_oidc_user_info.go index 876fd80..7718488 100644 --- a/model_oidc_user_info.go +++ b/model_oidc_user_info.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the OidcUserInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OidcUserInfo{} + // OidcUserInfo OpenID Connect Userinfo type OidcUserInfo struct { // End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format. The year MAY be 0000, indicating that it is omitted. To represent only the year, YYYY format is allowed. Note that depending on the underlying platform's date related function, providing just year can result in varying month and day, so the implementers need to take this factor into account to correctly process the dates. @@ -79,7 +82,7 @@ func NewOidcUserInfoWithDefaults() *OidcUserInfo { // GetBirthdate returns the Birthdate field value if set, zero value otherwise. func (o *OidcUserInfo) GetBirthdate() string { - if o == nil || o.Birthdate == nil { + if o == nil || IsNil(o.Birthdate) { var ret string return ret } @@ -89,7 +92,7 @@ func (o *OidcUserInfo) GetBirthdate() string { // GetBirthdateOk returns a tuple with the Birthdate field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetBirthdateOk() (*string, bool) { - if o == nil || o.Birthdate == nil { + if o == nil || IsNil(o.Birthdate) { return nil, false } return o.Birthdate, true @@ -97,7 +100,7 @@ func (o *OidcUserInfo) GetBirthdateOk() (*string, bool) { // HasBirthdate returns a boolean if a field has been set. func (o *OidcUserInfo) HasBirthdate() bool { - if o != nil && o.Birthdate != nil { + if o != nil && !IsNil(o.Birthdate) { return true } @@ -111,7 +114,7 @@ func (o *OidcUserInfo) SetBirthdate(v string) { // GetEmail returns the Email field value if set, zero value otherwise. func (o *OidcUserInfo) GetEmail() string { - if o == nil || o.Email == nil { + if o == nil || IsNil(o.Email) { var ret string return ret } @@ -121,7 +124,7 @@ func (o *OidcUserInfo) GetEmail() string { // GetEmailOk returns a tuple with the Email field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { + if o == nil || IsNil(o.Email) { return nil, false } return o.Email, true @@ -129,7 +132,7 @@ func (o *OidcUserInfo) GetEmailOk() (*string, bool) { // HasEmail returns a boolean if a field has been set. func (o *OidcUserInfo) HasEmail() bool { - if o != nil && o.Email != nil { + if o != nil && !IsNil(o.Email) { return true } @@ -143,7 +146,7 @@ func (o *OidcUserInfo) SetEmail(v string) { // GetEmailVerified returns the EmailVerified field value if set, zero value otherwise. func (o *OidcUserInfo) GetEmailVerified() bool { - if o == nil || o.EmailVerified == nil { + if o == nil || IsNil(o.EmailVerified) { var ret bool return ret } @@ -153,7 +156,7 @@ func (o *OidcUserInfo) GetEmailVerified() bool { // GetEmailVerifiedOk returns a tuple with the EmailVerified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetEmailVerifiedOk() (*bool, bool) { - if o == nil || o.EmailVerified == nil { + if o == nil || IsNil(o.EmailVerified) { return nil, false } return o.EmailVerified, true @@ -161,7 +164,7 @@ func (o *OidcUserInfo) GetEmailVerifiedOk() (*bool, bool) { // HasEmailVerified returns a boolean if a field has been set. func (o *OidcUserInfo) HasEmailVerified() bool { - if o != nil && o.EmailVerified != nil { + if o != nil && !IsNil(o.EmailVerified) { return true } @@ -175,7 +178,7 @@ func (o *OidcUserInfo) SetEmailVerified(v bool) { // GetFamilyName returns the FamilyName field value if set, zero value otherwise. func (o *OidcUserInfo) GetFamilyName() string { - if o == nil || o.FamilyName == nil { + if o == nil || IsNil(o.FamilyName) { var ret string return ret } @@ -185,7 +188,7 @@ func (o *OidcUserInfo) GetFamilyName() string { // GetFamilyNameOk returns a tuple with the FamilyName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetFamilyNameOk() (*string, bool) { - if o == nil || o.FamilyName == nil { + if o == nil || IsNil(o.FamilyName) { return nil, false } return o.FamilyName, true @@ -193,7 +196,7 @@ func (o *OidcUserInfo) GetFamilyNameOk() (*string, bool) { // HasFamilyName returns a boolean if a field has been set. func (o *OidcUserInfo) HasFamilyName() bool { - if o != nil && o.FamilyName != nil { + if o != nil && !IsNil(o.FamilyName) { return true } @@ -207,7 +210,7 @@ func (o *OidcUserInfo) SetFamilyName(v string) { // GetGender returns the Gender field value if set, zero value otherwise. func (o *OidcUserInfo) GetGender() string { - if o == nil || o.Gender == nil { + if o == nil || IsNil(o.Gender) { var ret string return ret } @@ -217,7 +220,7 @@ func (o *OidcUserInfo) GetGender() string { // GetGenderOk returns a tuple with the Gender field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetGenderOk() (*string, bool) { - if o == nil || o.Gender == nil { + if o == nil || IsNil(o.Gender) { return nil, false } return o.Gender, true @@ -225,7 +228,7 @@ func (o *OidcUserInfo) GetGenderOk() (*string, bool) { // HasGender returns a boolean if a field has been set. func (o *OidcUserInfo) HasGender() bool { - if o != nil && o.Gender != nil { + if o != nil && !IsNil(o.Gender) { return true } @@ -239,7 +242,7 @@ func (o *OidcUserInfo) SetGender(v string) { // GetGivenName returns the GivenName field value if set, zero value otherwise. func (o *OidcUserInfo) GetGivenName() string { - if o == nil || o.GivenName == nil { + if o == nil || IsNil(o.GivenName) { var ret string return ret } @@ -249,7 +252,7 @@ func (o *OidcUserInfo) GetGivenName() string { // GetGivenNameOk returns a tuple with the GivenName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetGivenNameOk() (*string, bool) { - if o == nil || o.GivenName == nil { + if o == nil || IsNil(o.GivenName) { return nil, false } return o.GivenName, true @@ -257,7 +260,7 @@ func (o *OidcUserInfo) GetGivenNameOk() (*string, bool) { // HasGivenName returns a boolean if a field has been set. func (o *OidcUserInfo) HasGivenName() bool { - if o != nil && o.GivenName != nil { + if o != nil && !IsNil(o.GivenName) { return true } @@ -271,7 +274,7 @@ func (o *OidcUserInfo) SetGivenName(v string) { // GetLocale returns the Locale field value if set, zero value otherwise. func (o *OidcUserInfo) GetLocale() string { - if o == nil || o.Locale == nil { + if o == nil || IsNil(o.Locale) { var ret string return ret } @@ -281,7 +284,7 @@ func (o *OidcUserInfo) GetLocale() string { // GetLocaleOk returns a tuple with the Locale field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetLocaleOk() (*string, bool) { - if o == nil || o.Locale == nil { + if o == nil || IsNil(o.Locale) { return nil, false } return o.Locale, true @@ -289,7 +292,7 @@ func (o *OidcUserInfo) GetLocaleOk() (*string, bool) { // HasLocale returns a boolean if a field has been set. func (o *OidcUserInfo) HasLocale() bool { - if o != nil && o.Locale != nil { + if o != nil && !IsNil(o.Locale) { return true } @@ -303,7 +306,7 @@ func (o *OidcUserInfo) SetLocale(v string) { // GetMiddleName returns the MiddleName field value if set, zero value otherwise. func (o *OidcUserInfo) GetMiddleName() string { - if o == nil || o.MiddleName == nil { + if o == nil || IsNil(o.MiddleName) { var ret string return ret } @@ -313,7 +316,7 @@ func (o *OidcUserInfo) GetMiddleName() string { // GetMiddleNameOk returns a tuple with the MiddleName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetMiddleNameOk() (*string, bool) { - if o == nil || o.MiddleName == nil { + if o == nil || IsNil(o.MiddleName) { return nil, false } return o.MiddleName, true @@ -321,7 +324,7 @@ func (o *OidcUserInfo) GetMiddleNameOk() (*string, bool) { // HasMiddleName returns a boolean if a field has been set. func (o *OidcUserInfo) HasMiddleName() bool { - if o != nil && o.MiddleName != nil { + if o != nil && !IsNil(o.MiddleName) { return true } @@ -335,7 +338,7 @@ func (o *OidcUserInfo) SetMiddleName(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *OidcUserInfo) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -345,7 +348,7 @@ func (o *OidcUserInfo) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -353,7 +356,7 @@ func (o *OidcUserInfo) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *OidcUserInfo) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -367,7 +370,7 @@ func (o *OidcUserInfo) SetName(v string) { // GetNickname returns the Nickname field value if set, zero value otherwise. func (o *OidcUserInfo) GetNickname() string { - if o == nil || o.Nickname == nil { + if o == nil || IsNil(o.Nickname) { var ret string return ret } @@ -377,7 +380,7 @@ func (o *OidcUserInfo) GetNickname() string { // GetNicknameOk returns a tuple with the Nickname field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetNicknameOk() (*string, bool) { - if o == nil || o.Nickname == nil { + if o == nil || IsNil(o.Nickname) { return nil, false } return o.Nickname, true @@ -385,7 +388,7 @@ func (o *OidcUserInfo) GetNicknameOk() (*string, bool) { // HasNickname returns a boolean if a field has been set. func (o *OidcUserInfo) HasNickname() bool { - if o != nil && o.Nickname != nil { + if o != nil && !IsNil(o.Nickname) { return true } @@ -399,7 +402,7 @@ func (o *OidcUserInfo) SetNickname(v string) { // GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. func (o *OidcUserInfo) GetPhoneNumber() string { - if o == nil || o.PhoneNumber == nil { + if o == nil || IsNil(o.PhoneNumber) { var ret string return ret } @@ -409,7 +412,7 @@ func (o *OidcUserInfo) GetPhoneNumber() string { // GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetPhoneNumberOk() (*string, bool) { - if o == nil || o.PhoneNumber == nil { + if o == nil || IsNil(o.PhoneNumber) { return nil, false } return o.PhoneNumber, true @@ -417,7 +420,7 @@ func (o *OidcUserInfo) GetPhoneNumberOk() (*string, bool) { // HasPhoneNumber returns a boolean if a field has been set. func (o *OidcUserInfo) HasPhoneNumber() bool { - if o != nil && o.PhoneNumber != nil { + if o != nil && !IsNil(o.PhoneNumber) { return true } @@ -431,7 +434,7 @@ func (o *OidcUserInfo) SetPhoneNumber(v string) { // GetPhoneNumberVerified returns the PhoneNumberVerified field value if set, zero value otherwise. func (o *OidcUserInfo) GetPhoneNumberVerified() bool { - if o == nil || o.PhoneNumberVerified == nil { + if o == nil || IsNil(o.PhoneNumberVerified) { var ret bool return ret } @@ -441,7 +444,7 @@ func (o *OidcUserInfo) GetPhoneNumberVerified() bool { // GetPhoneNumberVerifiedOk returns a tuple with the PhoneNumberVerified field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetPhoneNumberVerifiedOk() (*bool, bool) { - if o == nil || o.PhoneNumberVerified == nil { + if o == nil || IsNil(o.PhoneNumberVerified) { return nil, false } return o.PhoneNumberVerified, true @@ -449,7 +452,7 @@ func (o *OidcUserInfo) GetPhoneNumberVerifiedOk() (*bool, bool) { // HasPhoneNumberVerified returns a boolean if a field has been set. func (o *OidcUserInfo) HasPhoneNumberVerified() bool { - if o != nil && o.PhoneNumberVerified != nil { + if o != nil && !IsNil(o.PhoneNumberVerified) { return true } @@ -463,7 +466,7 @@ func (o *OidcUserInfo) SetPhoneNumberVerified(v bool) { // GetPicture returns the Picture field value if set, zero value otherwise. func (o *OidcUserInfo) GetPicture() string { - if o == nil || o.Picture == nil { + if o == nil || IsNil(o.Picture) { var ret string return ret } @@ -473,7 +476,7 @@ func (o *OidcUserInfo) GetPicture() string { // GetPictureOk returns a tuple with the Picture field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetPictureOk() (*string, bool) { - if o == nil || o.Picture == nil { + if o == nil || IsNil(o.Picture) { return nil, false } return o.Picture, true @@ -481,7 +484,7 @@ func (o *OidcUserInfo) GetPictureOk() (*string, bool) { // HasPicture returns a boolean if a field has been set. func (o *OidcUserInfo) HasPicture() bool { - if o != nil && o.Picture != nil { + if o != nil && !IsNil(o.Picture) { return true } @@ -495,7 +498,7 @@ func (o *OidcUserInfo) SetPicture(v string) { // GetPreferredUsername returns the PreferredUsername field value if set, zero value otherwise. func (o *OidcUserInfo) GetPreferredUsername() string { - if o == nil || o.PreferredUsername == nil { + if o == nil || IsNil(o.PreferredUsername) { var ret string return ret } @@ -505,7 +508,7 @@ func (o *OidcUserInfo) GetPreferredUsername() string { // GetPreferredUsernameOk returns a tuple with the PreferredUsername field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetPreferredUsernameOk() (*string, bool) { - if o == nil || o.PreferredUsername == nil { + if o == nil || IsNil(o.PreferredUsername) { return nil, false } return o.PreferredUsername, true @@ -513,7 +516,7 @@ func (o *OidcUserInfo) GetPreferredUsernameOk() (*string, bool) { // HasPreferredUsername returns a boolean if a field has been set. func (o *OidcUserInfo) HasPreferredUsername() bool { - if o != nil && o.PreferredUsername != nil { + if o != nil && !IsNil(o.PreferredUsername) { return true } @@ -527,7 +530,7 @@ func (o *OidcUserInfo) SetPreferredUsername(v string) { // GetProfile returns the Profile field value if set, zero value otherwise. func (o *OidcUserInfo) GetProfile() string { - if o == nil || o.Profile == nil { + if o == nil || IsNil(o.Profile) { var ret string return ret } @@ -537,7 +540,7 @@ func (o *OidcUserInfo) GetProfile() string { // GetProfileOk returns a tuple with the Profile field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetProfileOk() (*string, bool) { - if o == nil || o.Profile == nil { + if o == nil || IsNil(o.Profile) { return nil, false } return o.Profile, true @@ -545,7 +548,7 @@ func (o *OidcUserInfo) GetProfileOk() (*string, bool) { // HasProfile returns a boolean if a field has been set. func (o *OidcUserInfo) HasProfile() bool { - if o != nil && o.Profile != nil { + if o != nil && !IsNil(o.Profile) { return true } @@ -559,7 +562,7 @@ func (o *OidcUserInfo) SetProfile(v string) { // GetSub returns the Sub field value if set, zero value otherwise. func (o *OidcUserInfo) GetSub() string { - if o == nil || o.Sub == nil { + if o == nil || IsNil(o.Sub) { var ret string return ret } @@ -569,7 +572,7 @@ func (o *OidcUserInfo) GetSub() string { // GetSubOk returns a tuple with the Sub field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetSubOk() (*string, bool) { - if o == nil || o.Sub == nil { + if o == nil || IsNil(o.Sub) { return nil, false } return o.Sub, true @@ -577,7 +580,7 @@ func (o *OidcUserInfo) GetSubOk() (*string, bool) { // HasSub returns a boolean if a field has been set. func (o *OidcUserInfo) HasSub() bool { - if o != nil && o.Sub != nil { + if o != nil && !IsNil(o.Sub) { return true } @@ -591,7 +594,7 @@ func (o *OidcUserInfo) SetSub(v string) { // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *OidcUserInfo) GetUpdatedAt() int64 { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { var ret int64 return ret } @@ -601,7 +604,7 @@ func (o *OidcUserInfo) GetUpdatedAt() int64 { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetUpdatedAtOk() (*int64, bool) { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { return nil, false } return o.UpdatedAt, true @@ -609,7 +612,7 @@ func (o *OidcUserInfo) GetUpdatedAtOk() (*int64, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *OidcUserInfo) HasUpdatedAt() bool { - if o != nil && o.UpdatedAt != nil { + if o != nil && !IsNil(o.UpdatedAt) { return true } @@ -623,7 +626,7 @@ func (o *OidcUserInfo) SetUpdatedAt(v int64) { // GetWebsite returns the Website field value if set, zero value otherwise. func (o *OidcUserInfo) GetWebsite() string { - if o == nil || o.Website == nil { + if o == nil || IsNil(o.Website) { var ret string return ret } @@ -633,7 +636,7 @@ func (o *OidcUserInfo) GetWebsite() string { // GetWebsiteOk returns a tuple with the Website field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetWebsiteOk() (*string, bool) { - if o == nil || o.Website == nil { + if o == nil || IsNil(o.Website) { return nil, false } return o.Website, true @@ -641,7 +644,7 @@ func (o *OidcUserInfo) GetWebsiteOk() (*string, bool) { // HasWebsite returns a boolean if a field has been set. func (o *OidcUserInfo) HasWebsite() bool { - if o != nil && o.Website != nil { + if o != nil && !IsNil(o.Website) { return true } @@ -655,7 +658,7 @@ func (o *OidcUserInfo) SetWebsite(v string) { // GetZoneinfo returns the Zoneinfo field value if set, zero value otherwise. func (o *OidcUserInfo) GetZoneinfo() string { - if o == nil || o.Zoneinfo == nil { + if o == nil || IsNil(o.Zoneinfo) { var ret string return ret } @@ -665,7 +668,7 @@ func (o *OidcUserInfo) GetZoneinfo() string { // GetZoneinfoOk returns a tuple with the Zoneinfo field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OidcUserInfo) GetZoneinfoOk() (*string, bool) { - if o == nil || o.Zoneinfo == nil { + if o == nil || IsNil(o.Zoneinfo) { return nil, false } return o.Zoneinfo, true @@ -673,7 +676,7 @@ func (o *OidcUserInfo) GetZoneinfoOk() (*string, bool) { // HasZoneinfo returns a boolean if a field has been set. func (o *OidcUserInfo) HasZoneinfo() bool { - if o != nil && o.Zoneinfo != nil { + if o != nil && !IsNil(o.Zoneinfo) { return true } @@ -686,62 +689,70 @@ func (o *OidcUserInfo) SetZoneinfo(v string) { } func (o OidcUserInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OidcUserInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Birthdate != nil { + if !IsNil(o.Birthdate) { toSerialize["birthdate"] = o.Birthdate } - if o.Email != nil { + if !IsNil(o.Email) { toSerialize["email"] = o.Email } - if o.EmailVerified != nil { + if !IsNil(o.EmailVerified) { toSerialize["email_verified"] = o.EmailVerified } - if o.FamilyName != nil { + if !IsNil(o.FamilyName) { toSerialize["family_name"] = o.FamilyName } - if o.Gender != nil { + if !IsNil(o.Gender) { toSerialize["gender"] = o.Gender } - if o.GivenName != nil { + if !IsNil(o.GivenName) { toSerialize["given_name"] = o.GivenName } - if o.Locale != nil { + if !IsNil(o.Locale) { toSerialize["locale"] = o.Locale } - if o.MiddleName != nil { + if !IsNil(o.MiddleName) { toSerialize["middle_name"] = o.MiddleName } - if o.Name != nil { + if !IsNil(o.Name) { toSerialize["name"] = o.Name } - if o.Nickname != nil { + if !IsNil(o.Nickname) { toSerialize["nickname"] = o.Nickname } - if o.PhoneNumber != nil { + if !IsNil(o.PhoneNumber) { toSerialize["phone_number"] = o.PhoneNumber } - if o.PhoneNumberVerified != nil { + if !IsNil(o.PhoneNumberVerified) { toSerialize["phone_number_verified"] = o.PhoneNumberVerified } - if o.Picture != nil { + if !IsNil(o.Picture) { toSerialize["picture"] = o.Picture } - if o.PreferredUsername != nil { + if !IsNil(o.PreferredUsername) { toSerialize["preferred_username"] = o.PreferredUsername } - if o.Profile != nil { + if !IsNil(o.Profile) { toSerialize["profile"] = o.Profile } - if o.Sub != nil { + if !IsNil(o.Sub) { toSerialize["sub"] = o.Sub } - if o.UpdatedAt != nil { + if !IsNil(o.UpdatedAt) { toSerialize["updated_at"] = o.UpdatedAt } - if o.Website != nil { + if !IsNil(o.Website) { toSerialize["website"] = o.Website } - if o.Zoneinfo != nil { + if !IsNil(o.Zoneinfo) { toSerialize["zoneinfo"] = o.Zoneinfo } @@ -749,16 +760,20 @@ func (o OidcUserInfo) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *OidcUserInfo) UnmarshalJSON(bytes []byte) (err error) { varOidcUserInfo := _OidcUserInfo{} - if err = json.Unmarshal(bytes, &varOidcUserInfo); err == nil { - *o = OidcUserInfo(varOidcUserInfo) + err = json.Unmarshal(bytes, &varOidcUserInfo) + + if err != nil { + return err } + *o = OidcUserInfo(varOidcUserInfo) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_pagination.go b/model_pagination.go index 5eda305..ab22741 100644 --- a/model_pagination.go +++ b/model_pagination.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} + // Pagination struct for Pagination type Pagination struct { // Items per page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). @@ -53,7 +56,7 @@ func NewPaginationWithDefaults() *Pagination { // GetPageSize returns the PageSize field value if set, zero value otherwise. func (o *Pagination) GetPageSize() int64 { - if o == nil || o.PageSize == nil { + if o == nil || IsNil(o.PageSize) { var ret int64 return ret } @@ -63,7 +66,7 @@ func (o *Pagination) GetPageSize() int64 { // GetPageSizeOk returns a tuple with the PageSize field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pagination) GetPageSizeOk() (*int64, bool) { - if o == nil || o.PageSize == nil { + if o == nil || IsNil(o.PageSize) { return nil, false } return o.PageSize, true @@ -71,7 +74,7 @@ func (o *Pagination) GetPageSizeOk() (*int64, bool) { // HasPageSize returns a boolean if a field has been set. func (o *Pagination) HasPageSize() bool { - if o != nil && o.PageSize != nil { + if o != nil && !IsNil(o.PageSize) { return true } @@ -85,7 +88,7 @@ func (o *Pagination) SetPageSize(v int64) { // GetPageToken returns the PageToken field value if set, zero value otherwise. func (o *Pagination) GetPageToken() string { - if o == nil || o.PageToken == nil { + if o == nil || IsNil(o.PageToken) { var ret string return ret } @@ -95,7 +98,7 @@ func (o *Pagination) GetPageToken() string { // GetPageTokenOk returns a tuple with the PageToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pagination) GetPageTokenOk() (*string, bool) { - if o == nil || o.PageToken == nil { + if o == nil || IsNil(o.PageToken) { return nil, false } return o.PageToken, true @@ -103,7 +106,7 @@ func (o *Pagination) GetPageTokenOk() (*string, bool) { // HasPageToken returns a boolean if a field has been set. func (o *Pagination) HasPageToken() bool { - if o != nil && o.PageToken != nil { + if o != nil && !IsNil(o.PageToken) { return true } @@ -116,11 +119,19 @@ func (o *Pagination) SetPageToken(v string) { } func (o Pagination) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Pagination) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.PageSize != nil { + if !IsNil(o.PageSize) { toSerialize["page_size"] = o.PageSize } - if o.PageToken != nil { + if !IsNil(o.PageToken) { toSerialize["page_token"] = o.PageToken } @@ -128,16 +139,20 @@ func (o Pagination) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *Pagination) UnmarshalJSON(bytes []byte) (err error) { varPagination := _Pagination{} - if err = json.Unmarshal(bytes, &varPagination); err == nil { - *o = Pagination(varPagination) + err = json.Unmarshal(bytes, &varPagination) + + if err != nil { + return err } + *o = Pagination(varPagination) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_pagination_headers.go b/model_pagination_headers.go index b9114d7..1778d7a 100644 --- a/model_pagination_headers.go +++ b/model_pagination_headers.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the PaginationHeaders type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginationHeaders{} + // PaginationHeaders struct for PaginationHeaders type PaginationHeaders struct { // The link header contains pagination links. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). in: header @@ -45,7 +48,7 @@ func NewPaginationHeadersWithDefaults() *PaginationHeaders { // GetLink returns the Link field value if set, zero value otherwise. func (o *PaginationHeaders) GetLink() string { - if o == nil || o.Link == nil { + if o == nil || IsNil(o.Link) { var ret string return ret } @@ -55,7 +58,7 @@ func (o *PaginationHeaders) GetLink() string { // GetLinkOk returns a tuple with the Link field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PaginationHeaders) GetLinkOk() (*string, bool) { - if o == nil || o.Link == nil { + if o == nil || IsNil(o.Link) { return nil, false } return o.Link, true @@ -63,7 +66,7 @@ func (o *PaginationHeaders) GetLinkOk() (*string, bool) { // HasLink returns a boolean if a field has been set. func (o *PaginationHeaders) HasLink() bool { - if o != nil && o.Link != nil { + if o != nil && !IsNil(o.Link) { return true } @@ -77,7 +80,7 @@ func (o *PaginationHeaders) SetLink(v string) { // GetXTotalCount returns the XTotalCount field value if set, zero value otherwise. func (o *PaginationHeaders) GetXTotalCount() string { - if o == nil || o.XTotalCount == nil { + if o == nil || IsNil(o.XTotalCount) { var ret string return ret } @@ -87,7 +90,7 @@ func (o *PaginationHeaders) GetXTotalCount() string { // GetXTotalCountOk returns a tuple with the XTotalCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *PaginationHeaders) GetXTotalCountOk() (*string, bool) { - if o == nil || o.XTotalCount == nil { + if o == nil || IsNil(o.XTotalCount) { return nil, false } return o.XTotalCount, true @@ -95,7 +98,7 @@ func (o *PaginationHeaders) GetXTotalCountOk() (*string, bool) { // HasXTotalCount returns a boolean if a field has been set. func (o *PaginationHeaders) HasXTotalCount() bool { - if o != nil && o.XTotalCount != nil { + if o != nil && !IsNil(o.XTotalCount) { return true } @@ -108,11 +111,19 @@ func (o *PaginationHeaders) SetXTotalCount(v string) { } func (o PaginationHeaders) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginationHeaders) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Link != nil { + if !IsNil(o.Link) { toSerialize["link"] = o.Link } - if o.XTotalCount != nil { + if !IsNil(o.XTotalCount) { toSerialize["x-total-count"] = o.XTotalCount } @@ -120,16 +131,20 @@ func (o PaginationHeaders) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *PaginationHeaders) UnmarshalJSON(bytes []byte) (err error) { varPaginationHeaders := _PaginationHeaders{} - if err = json.Unmarshal(bytes, &varPaginationHeaders); err == nil { - *o = PaginationHeaders(varPaginationHeaders) + err = json.Unmarshal(bytes, &varPaginationHeaders) + + if err != nil { + return err } + *o = PaginationHeaders(varPaginationHeaders) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_reject_o_auth2_request.go b/model_reject_o_auth2_request.go index ff036d1..719d157 100644 --- a/model_reject_o_auth2_request.go +++ b/model_reject_o_auth2_request.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the RejectOAuth2Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RejectOAuth2Request{} + // RejectOAuth2Request struct for RejectOAuth2Request type RejectOAuth2Request struct { // The error should follow the OAuth2 error format (e.g. `invalid_request`, `login_required`). Defaults to `request_denied`. @@ -51,7 +54,7 @@ func NewRejectOAuth2RequestWithDefaults() *RejectOAuth2Request { // GetError returns the Error field value if set, zero value otherwise. func (o *RejectOAuth2Request) GetError() string { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { var ret string return ret } @@ -61,7 +64,7 @@ func (o *RejectOAuth2Request) GetError() string { // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RejectOAuth2Request) GetErrorOk() (*string, bool) { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { return nil, false } return o.Error, true @@ -69,7 +72,7 @@ func (o *RejectOAuth2Request) GetErrorOk() (*string, bool) { // HasError returns a boolean if a field has been set. func (o *RejectOAuth2Request) HasError() bool { - if o != nil && o.Error != nil { + if o != nil && !IsNil(o.Error) { return true } @@ -83,7 +86,7 @@ func (o *RejectOAuth2Request) SetError(v string) { // GetErrorDebug returns the ErrorDebug field value if set, zero value otherwise. func (o *RejectOAuth2Request) GetErrorDebug() string { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { var ret string return ret } @@ -93,7 +96,7 @@ func (o *RejectOAuth2Request) GetErrorDebug() string { // GetErrorDebugOk returns a tuple with the ErrorDebug field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RejectOAuth2Request) GetErrorDebugOk() (*string, bool) { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { return nil, false } return o.ErrorDebug, true @@ -101,7 +104,7 @@ func (o *RejectOAuth2Request) GetErrorDebugOk() (*string, bool) { // HasErrorDebug returns a boolean if a field has been set. func (o *RejectOAuth2Request) HasErrorDebug() bool { - if o != nil && o.ErrorDebug != nil { + if o != nil && !IsNil(o.ErrorDebug) { return true } @@ -115,7 +118,7 @@ func (o *RejectOAuth2Request) SetErrorDebug(v string) { // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. func (o *RejectOAuth2Request) GetErrorDescription() string { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { var ret string return ret } @@ -125,7 +128,7 @@ func (o *RejectOAuth2Request) GetErrorDescription() string { // GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RejectOAuth2Request) GetErrorDescriptionOk() (*string, bool) { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { return nil, false } return o.ErrorDescription, true @@ -133,7 +136,7 @@ func (o *RejectOAuth2Request) GetErrorDescriptionOk() (*string, bool) { // HasErrorDescription returns a boolean if a field has been set. func (o *RejectOAuth2Request) HasErrorDescription() bool { - if o != nil && o.ErrorDescription != nil { + if o != nil && !IsNil(o.ErrorDescription) { return true } @@ -147,7 +150,7 @@ func (o *RejectOAuth2Request) SetErrorDescription(v string) { // GetErrorHint returns the ErrorHint field value if set, zero value otherwise. func (o *RejectOAuth2Request) GetErrorHint() string { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { var ret string return ret } @@ -157,7 +160,7 @@ func (o *RejectOAuth2Request) GetErrorHint() string { // GetErrorHintOk returns a tuple with the ErrorHint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RejectOAuth2Request) GetErrorHintOk() (*string, bool) { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { return nil, false } return o.ErrorHint, true @@ -165,7 +168,7 @@ func (o *RejectOAuth2Request) GetErrorHintOk() (*string, bool) { // HasErrorHint returns a boolean if a field has been set. func (o *RejectOAuth2Request) HasErrorHint() bool { - if o != nil && o.ErrorHint != nil { + if o != nil && !IsNil(o.ErrorHint) { return true } @@ -179,7 +182,7 @@ func (o *RejectOAuth2Request) SetErrorHint(v string) { // GetStatusCode returns the StatusCode field value if set, zero value otherwise. func (o *RejectOAuth2Request) GetStatusCode() int64 { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { var ret int64 return ret } @@ -189,7 +192,7 @@ func (o *RejectOAuth2Request) GetStatusCode() int64 { // GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RejectOAuth2Request) GetStatusCodeOk() (*int64, bool) { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { return nil, false } return o.StatusCode, true @@ -197,7 +200,7 @@ func (o *RejectOAuth2Request) GetStatusCodeOk() (*int64, bool) { // HasStatusCode returns a boolean if a field has been set. func (o *RejectOAuth2Request) HasStatusCode() bool { - if o != nil && o.StatusCode != nil { + if o != nil && !IsNil(o.StatusCode) { return true } @@ -210,20 +213,28 @@ func (o *RejectOAuth2Request) SetStatusCode(v int64) { } func (o RejectOAuth2Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RejectOAuth2Request) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Error != nil { + if !IsNil(o.Error) { toSerialize["error"] = o.Error } - if o.ErrorDebug != nil { + if !IsNil(o.ErrorDebug) { toSerialize["error_debug"] = o.ErrorDebug } - if o.ErrorDescription != nil { + if !IsNil(o.ErrorDescription) { toSerialize["error_description"] = o.ErrorDescription } - if o.ErrorHint != nil { + if !IsNil(o.ErrorHint) { toSerialize["error_hint"] = o.ErrorHint } - if o.StatusCode != nil { + if !IsNil(o.StatusCode) { toSerialize["status_code"] = o.StatusCode } @@ -231,16 +242,20 @@ func (o RejectOAuth2Request) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *RejectOAuth2Request) UnmarshalJSON(bytes []byte) (err error) { varRejectOAuth2Request := _RejectOAuth2Request{} - if err = json.Unmarshal(bytes, &varRejectOAuth2Request); err == nil { - *o = RejectOAuth2Request(varRejectOAuth2Request) + err = json.Unmarshal(bytes, &varRejectOAuth2Request) + + if err != nil { + return err } + *o = RejectOAuth2Request(varRejectOAuth2Request) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_rfc6749_error_json.go b/model_rfc6749_error_json.go index 694b8ee..96b74f4 100644 --- a/model_rfc6749_error_json.go +++ b/model_rfc6749_error_json.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the RFC6749ErrorJson type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RFC6749ErrorJson{} + // RFC6749ErrorJson struct for RFC6749ErrorJson type RFC6749ErrorJson struct { Error *string `json:"error,omitempty"` @@ -46,7 +49,7 @@ func NewRFC6749ErrorJsonWithDefaults() *RFC6749ErrorJson { // GetError returns the Error field value if set, zero value otherwise. func (o *RFC6749ErrorJson) GetError() string { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { var ret string return ret } @@ -56,7 +59,7 @@ func (o *RFC6749ErrorJson) GetError() string { // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RFC6749ErrorJson) GetErrorOk() (*string, bool) { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { return nil, false } return o.Error, true @@ -64,7 +67,7 @@ func (o *RFC6749ErrorJson) GetErrorOk() (*string, bool) { // HasError returns a boolean if a field has been set. func (o *RFC6749ErrorJson) HasError() bool { - if o != nil && o.Error != nil { + if o != nil && !IsNil(o.Error) { return true } @@ -78,7 +81,7 @@ func (o *RFC6749ErrorJson) SetError(v string) { // GetErrorDebug returns the ErrorDebug field value if set, zero value otherwise. func (o *RFC6749ErrorJson) GetErrorDebug() string { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { var ret string return ret } @@ -88,7 +91,7 @@ func (o *RFC6749ErrorJson) GetErrorDebug() string { // GetErrorDebugOk returns a tuple with the ErrorDebug field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RFC6749ErrorJson) GetErrorDebugOk() (*string, bool) { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { return nil, false } return o.ErrorDebug, true @@ -96,7 +99,7 @@ func (o *RFC6749ErrorJson) GetErrorDebugOk() (*string, bool) { // HasErrorDebug returns a boolean if a field has been set. func (o *RFC6749ErrorJson) HasErrorDebug() bool { - if o != nil && o.ErrorDebug != nil { + if o != nil && !IsNil(o.ErrorDebug) { return true } @@ -110,7 +113,7 @@ func (o *RFC6749ErrorJson) SetErrorDebug(v string) { // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. func (o *RFC6749ErrorJson) GetErrorDescription() string { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { var ret string return ret } @@ -120,7 +123,7 @@ func (o *RFC6749ErrorJson) GetErrorDescription() string { // GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RFC6749ErrorJson) GetErrorDescriptionOk() (*string, bool) { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { return nil, false } return o.ErrorDescription, true @@ -128,7 +131,7 @@ func (o *RFC6749ErrorJson) GetErrorDescriptionOk() (*string, bool) { // HasErrorDescription returns a boolean if a field has been set. func (o *RFC6749ErrorJson) HasErrorDescription() bool { - if o != nil && o.ErrorDescription != nil { + if o != nil && !IsNil(o.ErrorDescription) { return true } @@ -142,7 +145,7 @@ func (o *RFC6749ErrorJson) SetErrorDescription(v string) { // GetErrorHint returns the ErrorHint field value if set, zero value otherwise. func (o *RFC6749ErrorJson) GetErrorHint() string { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { var ret string return ret } @@ -152,7 +155,7 @@ func (o *RFC6749ErrorJson) GetErrorHint() string { // GetErrorHintOk returns a tuple with the ErrorHint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RFC6749ErrorJson) GetErrorHintOk() (*string, bool) { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { return nil, false } return o.ErrorHint, true @@ -160,7 +163,7 @@ func (o *RFC6749ErrorJson) GetErrorHintOk() (*string, bool) { // HasErrorHint returns a boolean if a field has been set. func (o *RFC6749ErrorJson) HasErrorHint() bool { - if o != nil && o.ErrorHint != nil { + if o != nil && !IsNil(o.ErrorHint) { return true } @@ -174,7 +177,7 @@ func (o *RFC6749ErrorJson) SetErrorHint(v string) { // GetStatusCode returns the StatusCode field value if set, zero value otherwise. func (o *RFC6749ErrorJson) GetStatusCode() int64 { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { var ret int64 return ret } @@ -184,7 +187,7 @@ func (o *RFC6749ErrorJson) GetStatusCode() int64 { // GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RFC6749ErrorJson) GetStatusCodeOk() (*int64, bool) { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { return nil, false } return o.StatusCode, true @@ -192,7 +195,7 @@ func (o *RFC6749ErrorJson) GetStatusCodeOk() (*int64, bool) { // HasStatusCode returns a boolean if a field has been set. func (o *RFC6749ErrorJson) HasStatusCode() bool { - if o != nil && o.StatusCode != nil { + if o != nil && !IsNil(o.StatusCode) { return true } @@ -205,20 +208,28 @@ func (o *RFC6749ErrorJson) SetStatusCode(v int64) { } func (o RFC6749ErrorJson) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RFC6749ErrorJson) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Error != nil { + if !IsNil(o.Error) { toSerialize["error"] = o.Error } - if o.ErrorDebug != nil { + if !IsNil(o.ErrorDebug) { toSerialize["error_debug"] = o.ErrorDebug } - if o.ErrorDescription != nil { + if !IsNil(o.ErrorDescription) { toSerialize["error_description"] = o.ErrorDescription } - if o.ErrorHint != nil { + if !IsNil(o.ErrorHint) { toSerialize["error_hint"] = o.ErrorHint } - if o.StatusCode != nil { + if !IsNil(o.StatusCode) { toSerialize["status_code"] = o.StatusCode } @@ -226,16 +237,20 @@ func (o RFC6749ErrorJson) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *RFC6749ErrorJson) UnmarshalJSON(bytes []byte) (err error) { varRFC6749ErrorJson := _RFC6749ErrorJson{} - if err = json.Unmarshal(bytes, &varRFC6749ErrorJson); err == nil { - *o = RFC6749ErrorJson(varRFC6749ErrorJson) + err = json.Unmarshal(bytes, &varRFC6749ErrorJson) + + if err != nil { + return err } + *o = RFC6749ErrorJson(varRFC6749ErrorJson) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_token_pagination.go b/model_token_pagination.go index ff677a7..b9af1a2 100644 --- a/model_token_pagination.go +++ b/model_token_pagination.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the TokenPagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenPagination{} + // TokenPagination struct for TokenPagination type TokenPagination struct { // Items per page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). @@ -53,7 +56,7 @@ func NewTokenPaginationWithDefaults() *TokenPagination { // GetPageSize returns the PageSize field value if set, zero value otherwise. func (o *TokenPagination) GetPageSize() int64 { - if o == nil || o.PageSize == nil { + if o == nil || IsNil(o.PageSize) { var ret int64 return ret } @@ -63,7 +66,7 @@ func (o *TokenPagination) GetPageSize() int64 { // GetPageSizeOk returns a tuple with the PageSize field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPagination) GetPageSizeOk() (*int64, bool) { - if o == nil || o.PageSize == nil { + if o == nil || IsNil(o.PageSize) { return nil, false } return o.PageSize, true @@ -71,7 +74,7 @@ func (o *TokenPagination) GetPageSizeOk() (*int64, bool) { // HasPageSize returns a boolean if a field has been set. func (o *TokenPagination) HasPageSize() bool { - if o != nil && o.PageSize != nil { + if o != nil && !IsNil(o.PageSize) { return true } @@ -85,7 +88,7 @@ func (o *TokenPagination) SetPageSize(v int64) { // GetPageToken returns the PageToken field value if set, zero value otherwise. func (o *TokenPagination) GetPageToken() string { - if o == nil || o.PageToken == nil { + if o == nil || IsNil(o.PageToken) { var ret string return ret } @@ -95,7 +98,7 @@ func (o *TokenPagination) GetPageToken() string { // GetPageTokenOk returns a tuple with the PageToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPagination) GetPageTokenOk() (*string, bool) { - if o == nil || o.PageToken == nil { + if o == nil || IsNil(o.PageToken) { return nil, false } return o.PageToken, true @@ -103,7 +106,7 @@ func (o *TokenPagination) GetPageTokenOk() (*string, bool) { // HasPageToken returns a boolean if a field has been set. func (o *TokenPagination) HasPageToken() bool { - if o != nil && o.PageToken != nil { + if o != nil && !IsNil(o.PageToken) { return true } @@ -116,11 +119,19 @@ func (o *TokenPagination) SetPageToken(v string) { } func (o TokenPagination) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenPagination) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.PageSize != nil { + if !IsNil(o.PageSize) { toSerialize["page_size"] = o.PageSize } - if o.PageToken != nil { + if !IsNil(o.PageToken) { toSerialize["page_token"] = o.PageToken } @@ -128,16 +139,20 @@ func (o TokenPagination) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *TokenPagination) UnmarshalJSON(bytes []byte) (err error) { varTokenPagination := _TokenPagination{} - if err = json.Unmarshal(bytes, &varTokenPagination); err == nil { - *o = TokenPagination(varTokenPagination) + err = json.Unmarshal(bytes, &varTokenPagination) + + if err != nil { + return err } + *o = TokenPagination(varTokenPagination) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_token_pagination_headers.go b/model_token_pagination_headers.go index 2959e41..cb35090 100644 --- a/model_token_pagination_headers.go +++ b/model_token_pagination_headers.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the TokenPaginationHeaders type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenPaginationHeaders{} + // TokenPaginationHeaders struct for TokenPaginationHeaders type TokenPaginationHeaders struct { // The link header contains pagination links. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). in: header @@ -45,7 +48,7 @@ func NewTokenPaginationHeadersWithDefaults() *TokenPaginationHeaders { // GetLink returns the Link field value if set, zero value otherwise. func (o *TokenPaginationHeaders) GetLink() string { - if o == nil || o.Link == nil { + if o == nil || IsNil(o.Link) { var ret string return ret } @@ -55,7 +58,7 @@ func (o *TokenPaginationHeaders) GetLink() string { // GetLinkOk returns a tuple with the Link field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPaginationHeaders) GetLinkOk() (*string, bool) { - if o == nil || o.Link == nil { + if o == nil || IsNil(o.Link) { return nil, false } return o.Link, true @@ -63,7 +66,7 @@ func (o *TokenPaginationHeaders) GetLinkOk() (*string, bool) { // HasLink returns a boolean if a field has been set. func (o *TokenPaginationHeaders) HasLink() bool { - if o != nil && o.Link != nil { + if o != nil && !IsNil(o.Link) { return true } @@ -77,7 +80,7 @@ func (o *TokenPaginationHeaders) SetLink(v string) { // GetXTotalCount returns the XTotalCount field value if set, zero value otherwise. func (o *TokenPaginationHeaders) GetXTotalCount() string { - if o == nil || o.XTotalCount == nil { + if o == nil || IsNil(o.XTotalCount) { var ret string return ret } @@ -87,7 +90,7 @@ func (o *TokenPaginationHeaders) GetXTotalCount() string { // GetXTotalCountOk returns a tuple with the XTotalCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPaginationHeaders) GetXTotalCountOk() (*string, bool) { - if o == nil || o.XTotalCount == nil { + if o == nil || IsNil(o.XTotalCount) { return nil, false } return o.XTotalCount, true @@ -95,7 +98,7 @@ func (o *TokenPaginationHeaders) GetXTotalCountOk() (*string, bool) { // HasXTotalCount returns a boolean if a field has been set. func (o *TokenPaginationHeaders) HasXTotalCount() bool { - if o != nil && o.XTotalCount != nil { + if o != nil && !IsNil(o.XTotalCount) { return true } @@ -108,11 +111,19 @@ func (o *TokenPaginationHeaders) SetXTotalCount(v string) { } func (o TokenPaginationHeaders) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenPaginationHeaders) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Link != nil { + if !IsNil(o.Link) { toSerialize["link"] = o.Link } - if o.XTotalCount != nil { + if !IsNil(o.XTotalCount) { toSerialize["x-total-count"] = o.XTotalCount } @@ -120,16 +131,20 @@ func (o TokenPaginationHeaders) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *TokenPaginationHeaders) UnmarshalJSON(bytes []byte) (err error) { varTokenPaginationHeaders := _TokenPaginationHeaders{} - if err = json.Unmarshal(bytes, &varTokenPaginationHeaders); err == nil { - *o = TokenPaginationHeaders(varTokenPaginationHeaders) + err = json.Unmarshal(bytes, &varTokenPaginationHeaders) + + if err != nil { + return err } + *o = TokenPaginationHeaders(varTokenPaginationHeaders) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_token_pagination_request_parameters.go b/model_token_pagination_request_parameters.go index fba6fa8..801d8ab 100644 --- a/model_token_pagination_request_parameters.go +++ b/model_token_pagination_request_parameters.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the TokenPaginationRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenPaginationRequestParameters{} + // TokenPaginationRequestParameters The `Link` HTTP header contains multiple links (`first`, `next`, `last`, `previous`) formatted as: `; rel=\"{page}\"` For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). type TokenPaginationRequestParameters struct { // Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). @@ -53,7 +56,7 @@ func NewTokenPaginationRequestParametersWithDefaults() *TokenPaginationRequestPa // GetPageSize returns the PageSize field value if set, zero value otherwise. func (o *TokenPaginationRequestParameters) GetPageSize() int64 { - if o == nil || o.PageSize == nil { + if o == nil || IsNil(o.PageSize) { var ret int64 return ret } @@ -63,7 +66,7 @@ func (o *TokenPaginationRequestParameters) GetPageSize() int64 { // GetPageSizeOk returns a tuple with the PageSize field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPaginationRequestParameters) GetPageSizeOk() (*int64, bool) { - if o == nil || o.PageSize == nil { + if o == nil || IsNil(o.PageSize) { return nil, false } return o.PageSize, true @@ -71,7 +74,7 @@ func (o *TokenPaginationRequestParameters) GetPageSizeOk() (*int64, bool) { // HasPageSize returns a boolean if a field has been set. func (o *TokenPaginationRequestParameters) HasPageSize() bool { - if o != nil && o.PageSize != nil { + if o != nil && !IsNil(o.PageSize) { return true } @@ -85,7 +88,7 @@ func (o *TokenPaginationRequestParameters) SetPageSize(v int64) { // GetPageToken returns the PageToken field value if set, zero value otherwise. func (o *TokenPaginationRequestParameters) GetPageToken() string { - if o == nil || o.PageToken == nil { + if o == nil || IsNil(o.PageToken) { var ret string return ret } @@ -95,7 +98,7 @@ func (o *TokenPaginationRequestParameters) GetPageToken() string { // GetPageTokenOk returns a tuple with the PageToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPaginationRequestParameters) GetPageTokenOk() (*string, bool) { - if o == nil || o.PageToken == nil { + if o == nil || IsNil(o.PageToken) { return nil, false } return o.PageToken, true @@ -103,7 +106,7 @@ func (o *TokenPaginationRequestParameters) GetPageTokenOk() (*string, bool) { // HasPageToken returns a boolean if a field has been set. func (o *TokenPaginationRequestParameters) HasPageToken() bool { - if o != nil && o.PageToken != nil { + if o != nil && !IsNil(o.PageToken) { return true } @@ -116,11 +119,19 @@ func (o *TokenPaginationRequestParameters) SetPageToken(v string) { } func (o TokenPaginationRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenPaginationRequestParameters) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.PageSize != nil { + if !IsNil(o.PageSize) { toSerialize["page_size"] = o.PageSize } - if o.PageToken != nil { + if !IsNil(o.PageToken) { toSerialize["page_token"] = o.PageToken } @@ -128,16 +139,20 @@ func (o TokenPaginationRequestParameters) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *TokenPaginationRequestParameters) UnmarshalJSON(bytes []byte) (err error) { varTokenPaginationRequestParameters := _TokenPaginationRequestParameters{} - if err = json.Unmarshal(bytes, &varTokenPaginationRequestParameters); err == nil { - *o = TokenPaginationRequestParameters(varTokenPaginationRequestParameters) + err = json.Unmarshal(bytes, &varTokenPaginationRequestParameters) + + if err != nil { + return err } + *o = TokenPaginationRequestParameters(varTokenPaginationRequestParameters) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_token_pagination_response_headers.go b/model_token_pagination_response_headers.go index 0a1d3a6..a619a0b 100644 --- a/model_token_pagination_response_headers.go +++ b/model_token_pagination_response_headers.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the TokenPaginationResponseHeaders type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenPaginationResponseHeaders{} + // TokenPaginationResponseHeaders The `Link` HTTP header contains multiple links (`first`, `next`, `last`, `previous`) formatted as: `; rel=\"{page}\"` For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). type TokenPaginationResponseHeaders struct { // The Link HTTP Header The `Link` header contains a comma-delimited list of links to the following pages: first: The first page of results. next: The next page of results. prev: The previous page of results. last: The last page of results. Pages are omitted if they do not exist. For example, if there is no next page, the `next` link is omitted. Examples: ; rel=\"first\",; rel=\"next\",; rel=\"prev\",; rel=\"last\" @@ -45,7 +48,7 @@ func NewTokenPaginationResponseHeadersWithDefaults() *TokenPaginationResponseHea // GetLink returns the Link field value if set, zero value otherwise. func (o *TokenPaginationResponseHeaders) GetLink() string { - if o == nil || o.Link == nil { + if o == nil || IsNil(o.Link) { var ret string return ret } @@ -55,7 +58,7 @@ func (o *TokenPaginationResponseHeaders) GetLink() string { // GetLinkOk returns a tuple with the Link field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPaginationResponseHeaders) GetLinkOk() (*string, bool) { - if o == nil || o.Link == nil { + if o == nil || IsNil(o.Link) { return nil, false } return o.Link, true @@ -63,7 +66,7 @@ func (o *TokenPaginationResponseHeaders) GetLinkOk() (*string, bool) { // HasLink returns a boolean if a field has been set. func (o *TokenPaginationResponseHeaders) HasLink() bool { - if o != nil && o.Link != nil { + if o != nil && !IsNil(o.Link) { return true } @@ -77,7 +80,7 @@ func (o *TokenPaginationResponseHeaders) SetLink(v string) { // GetXTotalCount returns the XTotalCount field value if set, zero value otherwise. func (o *TokenPaginationResponseHeaders) GetXTotalCount() int64 { - if o == nil || o.XTotalCount == nil { + if o == nil || IsNil(o.XTotalCount) { var ret int64 return ret } @@ -87,7 +90,7 @@ func (o *TokenPaginationResponseHeaders) GetXTotalCount() int64 { // GetXTotalCountOk returns a tuple with the XTotalCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenPaginationResponseHeaders) GetXTotalCountOk() (*int64, bool) { - if o == nil || o.XTotalCount == nil { + if o == nil || IsNil(o.XTotalCount) { return nil, false } return o.XTotalCount, true @@ -95,7 +98,7 @@ func (o *TokenPaginationResponseHeaders) GetXTotalCountOk() (*int64, bool) { // HasXTotalCount returns a boolean if a field has been set. func (o *TokenPaginationResponseHeaders) HasXTotalCount() bool { - if o != nil && o.XTotalCount != nil { + if o != nil && !IsNil(o.XTotalCount) { return true } @@ -108,11 +111,19 @@ func (o *TokenPaginationResponseHeaders) SetXTotalCount(v int64) { } func (o TokenPaginationResponseHeaders) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenPaginationResponseHeaders) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Link != nil { + if !IsNil(o.Link) { toSerialize["link"] = o.Link } - if o.XTotalCount != nil { + if !IsNil(o.XTotalCount) { toSerialize["x-total-count"] = o.XTotalCount } @@ -120,16 +131,20 @@ func (o TokenPaginationResponseHeaders) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *TokenPaginationResponseHeaders) UnmarshalJSON(bytes []byte) (err error) { varTokenPaginationResponseHeaders := _TokenPaginationResponseHeaders{} - if err = json.Unmarshal(bytes, &varTokenPaginationResponseHeaders); err == nil { - *o = TokenPaginationResponseHeaders(varTokenPaginationResponseHeaders) + err = json.Unmarshal(bytes, &varTokenPaginationResponseHeaders) + + if err != nil { + return err } + *o = TokenPaginationResponseHeaders(varTokenPaginationResponseHeaders) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_trust_o_auth2_jwt_grant_issuer.go b/model_trust_o_auth2_jwt_grant_issuer.go index 4b4b66f..9038213 100644 --- a/model_trust_o_auth2_jwt_grant_issuer.go +++ b/model_trust_o_auth2_jwt_grant_issuer.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -14,8 +14,12 @@ package client import ( "encoding/json" "time" + "fmt" ) +// checks if the TrustOAuth2JwtGrantIssuer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TrustOAuth2JwtGrantIssuer{} + // TrustOAuth2JwtGrantIssuer Trust OAuth2 JWT Bearer Grant Type Issuer Request Body type TrustOAuth2JwtGrantIssuer struct { // The \"allow_any_subject\" indicates that the issuer is allowed to have any principal as the subject of the JWT. @@ -57,7 +61,7 @@ func NewTrustOAuth2JwtGrantIssuerWithDefaults() *TrustOAuth2JwtGrantIssuer { // GetAllowAnySubject returns the AllowAnySubject field value if set, zero value otherwise. func (o *TrustOAuth2JwtGrantIssuer) GetAllowAnySubject() bool { - if o == nil || o.AllowAnySubject == nil { + if o == nil || IsNil(o.AllowAnySubject) { var ret bool return ret } @@ -67,7 +71,7 @@ func (o *TrustOAuth2JwtGrantIssuer) GetAllowAnySubject() bool { // GetAllowAnySubjectOk returns a tuple with the AllowAnySubject field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustOAuth2JwtGrantIssuer) GetAllowAnySubjectOk() (*bool, bool) { - if o == nil || o.AllowAnySubject == nil { + if o == nil || IsNil(o.AllowAnySubject) { return nil, false } return o.AllowAnySubject, true @@ -75,7 +79,7 @@ func (o *TrustOAuth2JwtGrantIssuer) GetAllowAnySubjectOk() (*bool, bool) { // HasAllowAnySubject returns a boolean if a field has been set. func (o *TrustOAuth2JwtGrantIssuer) HasAllowAnySubject() bool { - if o != nil && o.AllowAnySubject != nil { + if o != nil && !IsNil(o.AllowAnySubject) { return true } @@ -185,7 +189,7 @@ func (o *TrustOAuth2JwtGrantIssuer) SetScope(v []string) { // GetSubject returns the Subject field value if set, zero value otherwise. func (o *TrustOAuth2JwtGrantIssuer) GetSubject() string { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { var ret string return ret } @@ -195,7 +199,7 @@ func (o *TrustOAuth2JwtGrantIssuer) GetSubject() string { // GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustOAuth2JwtGrantIssuer) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { return nil, false } return o.Subject, true @@ -203,7 +207,7 @@ func (o *TrustOAuth2JwtGrantIssuer) GetSubjectOk() (*string, bool) { // HasSubject returns a boolean if a field has been set. func (o *TrustOAuth2JwtGrantIssuer) HasSubject() bool { - if o != nil && o.Subject != nil { + if o != nil && !IsNil(o.Subject) { return true } @@ -216,23 +220,23 @@ func (o *TrustOAuth2JwtGrantIssuer) SetSubject(v string) { } func (o TrustOAuth2JwtGrantIssuer) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TrustOAuth2JwtGrantIssuer) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AllowAnySubject != nil { + if !IsNil(o.AllowAnySubject) { toSerialize["allow_any_subject"] = o.AllowAnySubject } - if true { - toSerialize["expires_at"] = o.ExpiresAt - } - if true { - toSerialize["issuer"] = o.Issuer - } - if true { - toSerialize["jwk"] = o.Jwk - } - if true { - toSerialize["scope"] = o.Scope - } - if o.Subject != nil { + toSerialize["expires_at"] = o.ExpiresAt + toSerialize["issuer"] = o.Issuer + toSerialize["jwk"] = o.Jwk + toSerialize["scope"] = o.Scope + if !IsNil(o.Subject) { toSerialize["subject"] = o.Subject } @@ -240,16 +244,44 @@ func (o TrustOAuth2JwtGrantIssuer) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *TrustOAuth2JwtGrantIssuer) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "expires_at", + "issuer", + "jwk", + "scope", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + varTrustOAuth2JwtGrantIssuer := _TrustOAuth2JwtGrantIssuer{} - if err = json.Unmarshal(bytes, &varTrustOAuth2JwtGrantIssuer); err == nil { - *o = TrustOAuth2JwtGrantIssuer(varTrustOAuth2JwtGrantIssuer) + err = json.Unmarshal(bytes, &varTrustOAuth2JwtGrantIssuer) + + if err != nil { + return err } + *o = TrustOAuth2JwtGrantIssuer(varTrustOAuth2JwtGrantIssuer) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_trusted_o_auth2_jwt_grant_issuer.go b/model_trusted_o_auth2_jwt_grant_issuer.go index be13f0c..e0f515b 100644 --- a/model_trusted_o_auth2_jwt_grant_issuer.go +++ b/model_trusted_o_auth2_jwt_grant_issuer.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -16,6 +16,9 @@ import ( "time" ) +// checks if the TrustedOAuth2JwtGrantIssuer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TrustedOAuth2JwtGrantIssuer{} + // TrustedOAuth2JwtGrantIssuer OAuth2 JWT Bearer Grant Type Issuer Trust Relationship type TrustedOAuth2JwtGrantIssuer struct { // The \"allow_any_subject\" indicates that the issuer is allowed to have any principal as the subject of the JWT. @@ -56,7 +59,7 @@ func NewTrustedOAuth2JwtGrantIssuerWithDefaults() *TrustedOAuth2JwtGrantIssuer { // GetAllowAnySubject returns the AllowAnySubject field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetAllowAnySubject() bool { - if o == nil || o.AllowAnySubject == nil { + if o == nil || IsNil(o.AllowAnySubject) { var ret bool return ret } @@ -66,7 +69,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetAllowAnySubject() bool { // GetAllowAnySubjectOk returns a tuple with the AllowAnySubject field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetAllowAnySubjectOk() (*bool, bool) { - if o == nil || o.AllowAnySubject == nil { + if o == nil || IsNil(o.AllowAnySubject) { return nil, false } return o.AllowAnySubject, true @@ -74,7 +77,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetAllowAnySubjectOk() (*bool, bool) { // HasAllowAnySubject returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasAllowAnySubject() bool { - if o != nil && o.AllowAnySubject != nil { + if o != nil && !IsNil(o.AllowAnySubject) { return true } @@ -88,7 +91,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetAllowAnySubject(v bool) { // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetCreatedAt() time.Time { - if o == nil || o.CreatedAt == nil { + if o == nil || IsNil(o.CreatedAt) { var ret time.Time return ret } @@ -98,7 +101,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || o.CreatedAt == nil { + if o == nil || IsNil(o.CreatedAt) { return nil, false } return o.CreatedAt, true @@ -106,7 +109,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasCreatedAt() bool { - if o != nil && o.CreatedAt != nil { + if o != nil && !IsNil(o.CreatedAt) { return true } @@ -120,7 +123,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetCreatedAt(v time.Time) { // GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetExpiresAt() time.Time { - if o == nil || o.ExpiresAt == nil { + if o == nil || IsNil(o.ExpiresAt) { var ret time.Time return ret } @@ -130,7 +133,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetExpiresAt() time.Time { // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetExpiresAtOk() (*time.Time, bool) { - if o == nil || o.ExpiresAt == nil { + if o == nil || IsNil(o.ExpiresAt) { return nil, false } return o.ExpiresAt, true @@ -138,7 +141,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetExpiresAtOk() (*time.Time, bool) { // HasExpiresAt returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasExpiresAt() bool { - if o != nil && o.ExpiresAt != nil { + if o != nil && !IsNil(o.ExpiresAt) { return true } @@ -152,7 +155,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetExpiresAt(v time.Time) { // GetId returns the Id field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetId() string { - if o == nil || o.Id == nil { + if o == nil || IsNil(o.Id) { var ret string return ret } @@ -162,7 +165,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { + if o == nil || IsNil(o.Id) { return nil, false } return o.Id, true @@ -170,7 +173,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } @@ -184,7 +187,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetId(v string) { // GetIssuer returns the Issuer field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetIssuer() string { - if o == nil || o.Issuer == nil { + if o == nil || IsNil(o.Issuer) { var ret string return ret } @@ -194,7 +197,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetIssuer() string { // GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetIssuerOk() (*string, bool) { - if o == nil || o.Issuer == nil { + if o == nil || IsNil(o.Issuer) { return nil, false } return o.Issuer, true @@ -202,7 +205,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetIssuerOk() (*string, bool) { // HasIssuer returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasIssuer() bool { - if o != nil && o.Issuer != nil { + if o != nil && !IsNil(o.Issuer) { return true } @@ -216,7 +219,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetIssuer(v string) { // GetPublicKey returns the PublicKey field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetPublicKey() TrustedOAuth2JwtGrantJsonWebKey { - if o == nil || o.PublicKey == nil { + if o == nil || IsNil(o.PublicKey) { var ret TrustedOAuth2JwtGrantJsonWebKey return ret } @@ -226,7 +229,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetPublicKey() TrustedOAuth2JwtGrantJsonWe // GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetPublicKeyOk() (*TrustedOAuth2JwtGrantJsonWebKey, bool) { - if o == nil || o.PublicKey == nil { + if o == nil || IsNil(o.PublicKey) { return nil, false } return o.PublicKey, true @@ -234,7 +237,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetPublicKeyOk() (*TrustedOAuth2JwtGrantJs // HasPublicKey returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasPublicKey() bool { - if o != nil && o.PublicKey != nil { + if o != nil && !IsNil(o.PublicKey) { return true } @@ -248,7 +251,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetPublicKey(v TrustedOAuth2JwtGrantJsonWe // GetScope returns the Scope field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetScope() []string { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { var ret []string return ret } @@ -258,7 +261,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetScope() []string { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetScopeOk() ([]string, bool) { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { return nil, false } return o.Scope, true @@ -266,7 +269,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetScopeOk() ([]string, bool) { // HasScope returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasScope() bool { - if o != nil && o.Scope != nil { + if o != nil && !IsNil(o.Scope) { return true } @@ -280,7 +283,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetScope(v []string) { // GetSubject returns the Subject field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantIssuer) GetSubject() string { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { var ret string return ret } @@ -290,7 +293,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetSubject() string { // GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantIssuer) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { return nil, false } return o.Subject, true @@ -298,7 +301,7 @@ func (o *TrustedOAuth2JwtGrantIssuer) GetSubjectOk() (*string, bool) { // HasSubject returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantIssuer) HasSubject() bool { - if o != nil && o.Subject != nil { + if o != nil && !IsNil(o.Subject) { return true } @@ -311,29 +314,37 @@ func (o *TrustedOAuth2JwtGrantIssuer) SetSubject(v string) { } func (o TrustedOAuth2JwtGrantIssuer) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TrustedOAuth2JwtGrantIssuer) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AllowAnySubject != nil { + if !IsNil(o.AllowAnySubject) { toSerialize["allow_any_subject"] = o.AllowAnySubject } - if o.CreatedAt != nil { + if !IsNil(o.CreatedAt) { toSerialize["created_at"] = o.CreatedAt } - if o.ExpiresAt != nil { + if !IsNil(o.ExpiresAt) { toSerialize["expires_at"] = o.ExpiresAt } - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - if o.Issuer != nil { + if !IsNil(o.Issuer) { toSerialize["issuer"] = o.Issuer } - if o.PublicKey != nil { + if !IsNil(o.PublicKey) { toSerialize["public_key"] = o.PublicKey } - if o.Scope != nil { + if !IsNil(o.Scope) { toSerialize["scope"] = o.Scope } - if o.Subject != nil { + if !IsNil(o.Subject) { toSerialize["subject"] = o.Subject } @@ -341,16 +352,20 @@ func (o TrustedOAuth2JwtGrantIssuer) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *TrustedOAuth2JwtGrantIssuer) UnmarshalJSON(bytes []byte) (err error) { varTrustedOAuth2JwtGrantIssuer := _TrustedOAuth2JwtGrantIssuer{} - if err = json.Unmarshal(bytes, &varTrustedOAuth2JwtGrantIssuer); err == nil { - *o = TrustedOAuth2JwtGrantIssuer(varTrustedOAuth2JwtGrantIssuer) + err = json.Unmarshal(bytes, &varTrustedOAuth2JwtGrantIssuer) + + if err != nil { + return err } + *o = TrustedOAuth2JwtGrantIssuer(varTrustedOAuth2JwtGrantIssuer) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_trusted_o_auth2_jwt_grant_json_web_key.go b/model_trusted_o_auth2_jwt_grant_json_web_key.go index c88006b..f56805d 100644 --- a/model_trusted_o_auth2_jwt_grant_json_web_key.go +++ b/model_trusted_o_auth2_jwt_grant_json_web_key.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the TrustedOAuth2JwtGrantJsonWebKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TrustedOAuth2JwtGrantJsonWebKey{} + // TrustedOAuth2JwtGrantJsonWebKey OAuth2 JWT Bearer Grant Type Issuer Trusted JSON Web Key type TrustedOAuth2JwtGrantJsonWebKey struct { // The \"key_id\" is key unique identifier (same as kid header in jws/jwt). @@ -45,7 +48,7 @@ func NewTrustedOAuth2JwtGrantJsonWebKeyWithDefaults() *TrustedOAuth2JwtGrantJson // GetKid returns the Kid field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantJsonWebKey) GetKid() string { - if o == nil || o.Kid == nil { + if o == nil || IsNil(o.Kid) { var ret string return ret } @@ -55,7 +58,7 @@ func (o *TrustedOAuth2JwtGrantJsonWebKey) GetKid() string { // GetKidOk returns a tuple with the Kid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantJsonWebKey) GetKidOk() (*string, bool) { - if o == nil || o.Kid == nil { + if o == nil || IsNil(o.Kid) { return nil, false } return o.Kid, true @@ -63,7 +66,7 @@ func (o *TrustedOAuth2JwtGrantJsonWebKey) GetKidOk() (*string, bool) { // HasKid returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantJsonWebKey) HasKid() bool { - if o != nil && o.Kid != nil { + if o != nil && !IsNil(o.Kid) { return true } @@ -77,7 +80,7 @@ func (o *TrustedOAuth2JwtGrantJsonWebKey) SetKid(v string) { // GetSet returns the Set field value if set, zero value otherwise. func (o *TrustedOAuth2JwtGrantJsonWebKey) GetSet() string { - if o == nil || o.Set == nil { + if o == nil || IsNil(o.Set) { var ret string return ret } @@ -87,7 +90,7 @@ func (o *TrustedOAuth2JwtGrantJsonWebKey) GetSet() string { // GetSetOk returns a tuple with the Set field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrustedOAuth2JwtGrantJsonWebKey) GetSetOk() (*string, bool) { - if o == nil || o.Set == nil { + if o == nil || IsNil(o.Set) { return nil, false } return o.Set, true @@ -95,7 +98,7 @@ func (o *TrustedOAuth2JwtGrantJsonWebKey) GetSetOk() (*string, bool) { // HasSet returns a boolean if a field has been set. func (o *TrustedOAuth2JwtGrantJsonWebKey) HasSet() bool { - if o != nil && o.Set != nil { + if o != nil && !IsNil(o.Set) { return true } @@ -108,11 +111,19 @@ func (o *TrustedOAuth2JwtGrantJsonWebKey) SetSet(v string) { } func (o TrustedOAuth2JwtGrantJsonWebKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TrustedOAuth2JwtGrantJsonWebKey) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Kid != nil { + if !IsNil(o.Kid) { toSerialize["kid"] = o.Kid } - if o.Set != nil { + if !IsNil(o.Set) { toSerialize["set"] = o.Set } @@ -120,16 +131,20 @@ func (o TrustedOAuth2JwtGrantJsonWebKey) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *TrustedOAuth2JwtGrantJsonWebKey) UnmarshalJSON(bytes []byte) (err error) { varTrustedOAuth2JwtGrantJsonWebKey := _TrustedOAuth2JwtGrantJsonWebKey{} - if err = json.Unmarshal(bytes, &varTrustedOAuth2JwtGrantJsonWebKey); err == nil { - *o = TrustedOAuth2JwtGrantJsonWebKey(varTrustedOAuth2JwtGrantJsonWebKey) + err = json.Unmarshal(bytes, &varTrustedOAuth2JwtGrantJsonWebKey) + + if err != nil { + return err } + *o = TrustedOAuth2JwtGrantJsonWebKey(varTrustedOAuth2JwtGrantJsonWebKey) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_verifiable_credential_priming_response.go b/model_verifiable_credential_priming_response.go index a251aae..8e8f6fa 100644 --- a/model_verifiable_credential_priming_response.go +++ b/model_verifiable_credential_priming_response.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the VerifiableCredentialPrimingResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VerifiableCredentialPrimingResponse{} + // VerifiableCredentialPrimingResponse struct for VerifiableCredentialPrimingResponse type VerifiableCredentialPrimingResponse struct { CNonce *string `json:"c_nonce,omitempty"` @@ -49,7 +52,7 @@ func NewVerifiableCredentialPrimingResponseWithDefaults() *VerifiableCredentialP // GetCNonce returns the CNonce field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetCNonce() string { - if o == nil || o.CNonce == nil { + if o == nil || IsNil(o.CNonce) { var ret string return ret } @@ -59,7 +62,7 @@ func (o *VerifiableCredentialPrimingResponse) GetCNonce() string { // GetCNonceOk returns a tuple with the CNonce field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetCNonceOk() (*string, bool) { - if o == nil || o.CNonce == nil { + if o == nil || IsNil(o.CNonce) { return nil, false } return o.CNonce, true @@ -67,7 +70,7 @@ func (o *VerifiableCredentialPrimingResponse) GetCNonceOk() (*string, bool) { // HasCNonce returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasCNonce() bool { - if o != nil && o.CNonce != nil { + if o != nil && !IsNil(o.CNonce) { return true } @@ -81,7 +84,7 @@ func (o *VerifiableCredentialPrimingResponse) SetCNonce(v string) { // GetCNonceExpiresIn returns the CNonceExpiresIn field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetCNonceExpiresIn() int64 { - if o == nil || o.CNonceExpiresIn == nil { + if o == nil || IsNil(o.CNonceExpiresIn) { var ret int64 return ret } @@ -91,7 +94,7 @@ func (o *VerifiableCredentialPrimingResponse) GetCNonceExpiresIn() int64 { // GetCNonceExpiresInOk returns a tuple with the CNonceExpiresIn field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetCNonceExpiresInOk() (*int64, bool) { - if o == nil || o.CNonceExpiresIn == nil { + if o == nil || IsNil(o.CNonceExpiresIn) { return nil, false } return o.CNonceExpiresIn, true @@ -99,7 +102,7 @@ func (o *VerifiableCredentialPrimingResponse) GetCNonceExpiresInOk() (*int64, bo // HasCNonceExpiresIn returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasCNonceExpiresIn() bool { - if o != nil && o.CNonceExpiresIn != nil { + if o != nil && !IsNil(o.CNonceExpiresIn) { return true } @@ -113,7 +116,7 @@ func (o *VerifiableCredentialPrimingResponse) SetCNonceExpiresIn(v int64) { // GetError returns the Error field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetError() string { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { var ret string return ret } @@ -123,7 +126,7 @@ func (o *VerifiableCredentialPrimingResponse) GetError() string { // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetErrorOk() (*string, bool) { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { return nil, false } return o.Error, true @@ -131,7 +134,7 @@ func (o *VerifiableCredentialPrimingResponse) GetErrorOk() (*string, bool) { // HasError returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasError() bool { - if o != nil && o.Error != nil { + if o != nil && !IsNil(o.Error) { return true } @@ -145,7 +148,7 @@ func (o *VerifiableCredentialPrimingResponse) SetError(v string) { // GetErrorDebug returns the ErrorDebug field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetErrorDebug() string { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { var ret string return ret } @@ -155,7 +158,7 @@ func (o *VerifiableCredentialPrimingResponse) GetErrorDebug() string { // GetErrorDebugOk returns a tuple with the ErrorDebug field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetErrorDebugOk() (*string, bool) { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { return nil, false } return o.ErrorDebug, true @@ -163,7 +166,7 @@ func (o *VerifiableCredentialPrimingResponse) GetErrorDebugOk() (*string, bool) // HasErrorDebug returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasErrorDebug() bool { - if o != nil && o.ErrorDebug != nil { + if o != nil && !IsNil(o.ErrorDebug) { return true } @@ -177,7 +180,7 @@ func (o *VerifiableCredentialPrimingResponse) SetErrorDebug(v string) { // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetErrorDescription() string { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { var ret string return ret } @@ -187,7 +190,7 @@ func (o *VerifiableCredentialPrimingResponse) GetErrorDescription() string { // GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetErrorDescriptionOk() (*string, bool) { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { return nil, false } return o.ErrorDescription, true @@ -195,7 +198,7 @@ func (o *VerifiableCredentialPrimingResponse) GetErrorDescriptionOk() (*string, // HasErrorDescription returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasErrorDescription() bool { - if o != nil && o.ErrorDescription != nil { + if o != nil && !IsNil(o.ErrorDescription) { return true } @@ -209,7 +212,7 @@ func (o *VerifiableCredentialPrimingResponse) SetErrorDescription(v string) { // GetErrorHint returns the ErrorHint field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetErrorHint() string { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { var ret string return ret } @@ -219,7 +222,7 @@ func (o *VerifiableCredentialPrimingResponse) GetErrorHint() string { // GetErrorHintOk returns a tuple with the ErrorHint field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetErrorHintOk() (*string, bool) { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { return nil, false } return o.ErrorHint, true @@ -227,7 +230,7 @@ func (o *VerifiableCredentialPrimingResponse) GetErrorHintOk() (*string, bool) { // HasErrorHint returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasErrorHint() bool { - if o != nil && o.ErrorHint != nil { + if o != nil && !IsNil(o.ErrorHint) { return true } @@ -241,7 +244,7 @@ func (o *VerifiableCredentialPrimingResponse) SetErrorHint(v string) { // GetFormat returns the Format field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetFormat() string { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { var ret string return ret } @@ -251,7 +254,7 @@ func (o *VerifiableCredentialPrimingResponse) GetFormat() string { // GetFormatOk returns a tuple with the Format field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetFormatOk() (*string, bool) { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { return nil, false } return o.Format, true @@ -259,7 +262,7 @@ func (o *VerifiableCredentialPrimingResponse) GetFormatOk() (*string, bool) { // HasFormat returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasFormat() bool { - if o != nil && o.Format != nil { + if o != nil && !IsNil(o.Format) { return true } @@ -273,7 +276,7 @@ func (o *VerifiableCredentialPrimingResponse) SetFormat(v string) { // GetStatusCode returns the StatusCode field value if set, zero value otherwise. func (o *VerifiableCredentialPrimingResponse) GetStatusCode() int64 { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { var ret int64 return ret } @@ -283,7 +286,7 @@ func (o *VerifiableCredentialPrimingResponse) GetStatusCode() int64 { // GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialPrimingResponse) GetStatusCodeOk() (*int64, bool) { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { return nil, false } return o.StatusCode, true @@ -291,7 +294,7 @@ func (o *VerifiableCredentialPrimingResponse) GetStatusCodeOk() (*int64, bool) { // HasStatusCode returns a boolean if a field has been set. func (o *VerifiableCredentialPrimingResponse) HasStatusCode() bool { - if o != nil && o.StatusCode != nil { + if o != nil && !IsNil(o.StatusCode) { return true } @@ -304,29 +307,37 @@ func (o *VerifiableCredentialPrimingResponse) SetStatusCode(v int64) { } func (o VerifiableCredentialPrimingResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerifiableCredentialPrimingResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.CNonce != nil { + if !IsNil(o.CNonce) { toSerialize["c_nonce"] = o.CNonce } - if o.CNonceExpiresIn != nil { + if !IsNil(o.CNonceExpiresIn) { toSerialize["c_nonce_expires_in"] = o.CNonceExpiresIn } - if o.Error != nil { + if !IsNil(o.Error) { toSerialize["error"] = o.Error } - if o.ErrorDebug != nil { + if !IsNil(o.ErrorDebug) { toSerialize["error_debug"] = o.ErrorDebug } - if o.ErrorDescription != nil { + if !IsNil(o.ErrorDescription) { toSerialize["error_description"] = o.ErrorDescription } - if o.ErrorHint != nil { + if !IsNil(o.ErrorHint) { toSerialize["error_hint"] = o.ErrorHint } - if o.Format != nil { + if !IsNil(o.Format) { toSerialize["format"] = o.Format } - if o.StatusCode != nil { + if !IsNil(o.StatusCode) { toSerialize["status_code"] = o.StatusCode } @@ -334,16 +345,20 @@ func (o VerifiableCredentialPrimingResponse) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *VerifiableCredentialPrimingResponse) UnmarshalJSON(bytes []byte) (err error) { varVerifiableCredentialPrimingResponse := _VerifiableCredentialPrimingResponse{} - if err = json.Unmarshal(bytes, &varVerifiableCredentialPrimingResponse); err == nil { - *o = VerifiableCredentialPrimingResponse(varVerifiableCredentialPrimingResponse) + err = json.Unmarshal(bytes, &varVerifiableCredentialPrimingResponse) + + if err != nil { + return err } + *o = VerifiableCredentialPrimingResponse(varVerifiableCredentialPrimingResponse) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_verifiable_credential_proof.go b/model_verifiable_credential_proof.go index 6757961..b17bca8 100644 --- a/model_verifiable_credential_proof.go +++ b/model_verifiable_credential_proof.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the VerifiableCredentialProof type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VerifiableCredentialProof{} + // VerifiableCredentialProof struct for VerifiableCredentialProof type VerifiableCredentialProof struct { Jwt *string `json:"jwt,omitempty"` @@ -43,7 +46,7 @@ func NewVerifiableCredentialProofWithDefaults() *VerifiableCredentialProof { // GetJwt returns the Jwt field value if set, zero value otherwise. func (o *VerifiableCredentialProof) GetJwt() string { - if o == nil || o.Jwt == nil { + if o == nil || IsNil(o.Jwt) { var ret string return ret } @@ -53,7 +56,7 @@ func (o *VerifiableCredentialProof) GetJwt() string { // GetJwtOk returns a tuple with the Jwt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialProof) GetJwtOk() (*string, bool) { - if o == nil || o.Jwt == nil { + if o == nil || IsNil(o.Jwt) { return nil, false } return o.Jwt, true @@ -61,7 +64,7 @@ func (o *VerifiableCredentialProof) GetJwtOk() (*string, bool) { // HasJwt returns a boolean if a field has been set. func (o *VerifiableCredentialProof) HasJwt() bool { - if o != nil && o.Jwt != nil { + if o != nil && !IsNil(o.Jwt) { return true } @@ -75,7 +78,7 @@ func (o *VerifiableCredentialProof) SetJwt(v string) { // GetProofType returns the ProofType field value if set, zero value otherwise. func (o *VerifiableCredentialProof) GetProofType() string { - if o == nil || o.ProofType == nil { + if o == nil || IsNil(o.ProofType) { var ret string return ret } @@ -85,7 +88,7 @@ func (o *VerifiableCredentialProof) GetProofType() string { // GetProofTypeOk returns a tuple with the ProofType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialProof) GetProofTypeOk() (*string, bool) { - if o == nil || o.ProofType == nil { + if o == nil || IsNil(o.ProofType) { return nil, false } return o.ProofType, true @@ -93,7 +96,7 @@ func (o *VerifiableCredentialProof) GetProofTypeOk() (*string, bool) { // HasProofType returns a boolean if a field has been set. func (o *VerifiableCredentialProof) HasProofType() bool { - if o != nil && o.ProofType != nil { + if o != nil && !IsNil(o.ProofType) { return true } @@ -106,11 +109,19 @@ func (o *VerifiableCredentialProof) SetProofType(v string) { } func (o VerifiableCredentialProof) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerifiableCredentialProof) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Jwt != nil { + if !IsNil(o.Jwt) { toSerialize["jwt"] = o.Jwt } - if o.ProofType != nil { + if !IsNil(o.ProofType) { toSerialize["proof_type"] = o.ProofType } @@ -118,16 +129,20 @@ func (o VerifiableCredentialProof) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *VerifiableCredentialProof) UnmarshalJSON(bytes []byte) (err error) { varVerifiableCredentialProof := _VerifiableCredentialProof{} - if err = json.Unmarshal(bytes, &varVerifiableCredentialProof); err == nil { - *o = VerifiableCredentialProof(varVerifiableCredentialProof) + err = json.Unmarshal(bytes, &varVerifiableCredentialProof) + + if err != nil { + return err } + *o = VerifiableCredentialProof(varVerifiableCredentialProof) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_verifiable_credential_response.go b/model_verifiable_credential_response.go index 12a16f8..0ecbe61 100644 --- a/model_verifiable_credential_response.go +++ b/model_verifiable_credential_response.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the VerifiableCredentialResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VerifiableCredentialResponse{} + // VerifiableCredentialResponse struct for VerifiableCredentialResponse type VerifiableCredentialResponse struct { CredentialDraft00 *string `json:"credential_draft_00,omitempty"` @@ -43,7 +46,7 @@ func NewVerifiableCredentialResponseWithDefaults() *VerifiableCredentialResponse // GetCredentialDraft00 returns the CredentialDraft00 field value if set, zero value otherwise. func (o *VerifiableCredentialResponse) GetCredentialDraft00() string { - if o == nil || o.CredentialDraft00 == nil { + if o == nil || IsNil(o.CredentialDraft00) { var ret string return ret } @@ -53,7 +56,7 @@ func (o *VerifiableCredentialResponse) GetCredentialDraft00() string { // GetCredentialDraft00Ok returns a tuple with the CredentialDraft00 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialResponse) GetCredentialDraft00Ok() (*string, bool) { - if o == nil || o.CredentialDraft00 == nil { + if o == nil || IsNil(o.CredentialDraft00) { return nil, false } return o.CredentialDraft00, true @@ -61,7 +64,7 @@ func (o *VerifiableCredentialResponse) GetCredentialDraft00Ok() (*string, bool) // HasCredentialDraft00 returns a boolean if a field has been set. func (o *VerifiableCredentialResponse) HasCredentialDraft00() bool { - if o != nil && o.CredentialDraft00 != nil { + if o != nil && !IsNil(o.CredentialDraft00) { return true } @@ -75,7 +78,7 @@ func (o *VerifiableCredentialResponse) SetCredentialDraft00(v string) { // GetFormat returns the Format field value if set, zero value otherwise. func (o *VerifiableCredentialResponse) GetFormat() string { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { var ret string return ret } @@ -85,7 +88,7 @@ func (o *VerifiableCredentialResponse) GetFormat() string { // GetFormatOk returns a tuple with the Format field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *VerifiableCredentialResponse) GetFormatOk() (*string, bool) { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { return nil, false } return o.Format, true @@ -93,7 +96,7 @@ func (o *VerifiableCredentialResponse) GetFormatOk() (*string, bool) { // HasFormat returns a boolean if a field has been set. func (o *VerifiableCredentialResponse) HasFormat() bool { - if o != nil && o.Format != nil { + if o != nil && !IsNil(o.Format) { return true } @@ -106,11 +109,19 @@ func (o *VerifiableCredentialResponse) SetFormat(v string) { } func (o VerifiableCredentialResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerifiableCredentialResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.CredentialDraft00 != nil { + if !IsNil(o.CredentialDraft00) { toSerialize["credential_draft_00"] = o.CredentialDraft00 } - if o.Format != nil { + if !IsNil(o.Format) { toSerialize["format"] = o.Format } @@ -118,16 +129,20 @@ func (o VerifiableCredentialResponse) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *VerifiableCredentialResponse) UnmarshalJSON(bytes []byte) (err error) { varVerifiableCredentialResponse := _VerifiableCredentialResponse{} - if err = json.Unmarshal(bytes, &varVerifiableCredentialResponse); err == nil { - *o = VerifiableCredentialResponse(varVerifiableCredentialResponse) + err = json.Unmarshal(bytes, &varVerifiableCredentialResponse) + + if err != nil { + return err } + *o = VerifiableCredentialResponse(varVerifiableCredentialResponse) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/model_version.go b/model_version.go index e80d071..5975e72 100644 --- a/model_version.go +++ b/model_version.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the Version type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Version{} + // Version struct for Version type Version struct { // Version is the service's version. @@ -43,7 +46,7 @@ func NewVersionWithDefaults() *Version { // GetVersion returns the Version field value if set, zero value otherwise. func (o *Version) GetVersion() string { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { var ret string return ret } @@ -53,7 +56,7 @@ func (o *Version) GetVersion() string { // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Version) GetVersionOk() (*string, bool) { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { return nil, false } return o.Version, true @@ -61,7 +64,7 @@ func (o *Version) GetVersionOk() (*string, bool) { // HasVersion returns a boolean if a field has been set. func (o *Version) HasVersion() bool { - if o != nil && o.Version != nil { + if o != nil && !IsNil(o.Version) { return true } @@ -74,8 +77,16 @@ func (o *Version) SetVersion(v string) { } func (o Version) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Version) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Version != nil { + if !IsNil(o.Version) { toSerialize["version"] = o.Version } @@ -83,16 +94,20 @@ func (o Version) MarshalJSON() ([]byte, error) { toSerialize[key] = value } - return json.Marshal(toSerialize) + return toSerialize, nil } func (o *Version) UnmarshalJSON(bytes []byte) (err error) { varVersion := _Version{} - if err = json.Unmarshal(bytes, &varVersion); err == nil { - *o = Version(varVersion) + err = json.Unmarshal(bytes, &varVersion) + + if err != nil { + return err } + *o = Version(varVersion) + additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { diff --git a/response.go b/response.go index 96b859b..d42d346 100644 --- a/response.go +++ b/response.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ diff --git a/test/api_jwk_test.go b/test/api_jwk_test.go new file mode 100644 index 0000000..359b881 --- /dev/null +++ b/test/api_jwk_test.go @@ -0,0 +1,124 @@ +/* +Ory Hydra API + +Testing JwkAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package client + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/ory/hydra-client-go" +) + +func Test_client_JwkAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test JwkAPIService CreateJsonWebKeySet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var set string + + resp, httpRes, err := apiClient.JwkAPI.CreateJsonWebKeySet(context.Background(), set).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test JwkAPIService DeleteJsonWebKey", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var set string + var kid string + + httpRes, err := apiClient.JwkAPI.DeleteJsonWebKey(context.Background(), set, kid).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test JwkAPIService DeleteJsonWebKeySet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var set string + + httpRes, err := apiClient.JwkAPI.DeleteJsonWebKeySet(context.Background(), set).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test JwkAPIService GetJsonWebKey", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var set string + var kid string + + resp, httpRes, err := apiClient.JwkAPI.GetJsonWebKey(context.Background(), set, kid).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test JwkAPIService GetJsonWebKeySet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var set string + + resp, httpRes, err := apiClient.JwkAPI.GetJsonWebKeySet(context.Background(), set).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test JwkAPIService SetJsonWebKey", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var set string + var kid string + + resp, httpRes, err := apiClient.JwkAPI.SetJsonWebKey(context.Background(), set, kid).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test JwkAPIService SetJsonWebKeySet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var set string + + resp, httpRes, err := apiClient.JwkAPI.SetJsonWebKeySet(context.Background(), set).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_metadata_test.go b/test/api_metadata_test.go new file mode 100644 index 0000000..222d32b --- /dev/null +++ b/test/api_metadata_test.go @@ -0,0 +1,61 @@ +/* +Ory Hydra API + +Testing MetadataAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package client + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/ory/hydra-client-go" +) + +func Test_client_MetadataAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test MetadataAPIService GetVersion", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.MetadataAPI.GetVersion(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test MetadataAPIService IsAlive", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.MetadataAPI.IsAlive(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test MetadataAPIService IsReady", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.MetadataAPI.IsReady(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_o_auth2_test.go b/test/api_o_auth2_test.go new file mode 100644 index 0000000..a4d722e --- /dev/null +++ b/test/api_o_auth2_test.go @@ -0,0 +1,368 @@ +/* +Ory Hydra API + +Testing OAuth2APIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package client + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/ory/hydra-client-go" +) + +func Test_client_OAuth2APIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test OAuth2APIService AcceptOAuth2ConsentRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.AcceptOAuth2ConsentRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService AcceptOAuth2LoginRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.AcceptOAuth2LoginRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService AcceptOAuth2LogoutRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.AcceptOAuth2LogoutRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService CreateOAuth2Client", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.CreateOAuth2Client(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService DeleteOAuth2Client", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.OAuth2API.DeleteOAuth2Client(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService DeleteOAuth2Token", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.OAuth2API.DeleteOAuth2Token(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService DeleteTrustedOAuth2JwtGrantIssuer", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.OAuth2API.DeleteTrustedOAuth2JwtGrantIssuer(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService GetOAuth2Client", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OAuth2API.GetOAuth2Client(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService GetOAuth2ConsentRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.GetOAuth2ConsentRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService GetOAuth2LoginRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.GetOAuth2LoginRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService GetOAuth2LogoutRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.GetOAuth2LogoutRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService GetTrustedOAuth2JwtGrantIssuer", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OAuth2API.GetTrustedOAuth2JwtGrantIssuer(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService IntrospectOAuth2Token", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.IntrospectOAuth2Token(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService ListOAuth2Clients", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.ListOAuth2Clients(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService ListOAuth2ConsentSessions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.ListOAuth2ConsentSessions(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService ListTrustedOAuth2JwtGrantIssuers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.ListTrustedOAuth2JwtGrantIssuers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService OAuth2Authorize", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.OAuth2Authorize(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService Oauth2TokenExchange", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.Oauth2TokenExchange(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService PatchOAuth2Client", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OAuth2API.PatchOAuth2Client(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService RejectOAuth2ConsentRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.RejectOAuth2ConsentRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService RejectOAuth2LoginRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.RejectOAuth2LoginRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService RejectOAuth2LogoutRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.OAuth2API.RejectOAuth2LogoutRequest(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService RevokeOAuth2ConsentSessions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.OAuth2API.RevokeOAuth2ConsentSessions(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService RevokeOAuth2LoginSessions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.OAuth2API.RevokeOAuth2LoginSessions(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService RevokeOAuth2Token", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.OAuth2API.RevokeOAuth2Token(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService SetOAuth2Client", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OAuth2API.SetOAuth2Client(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService SetOAuth2ClientLifespans", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OAuth2API.SetOAuth2ClientLifespans(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OAuth2APIService TrustOAuth2JwtGrantIssuer", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OAuth2API.TrustOAuth2JwtGrantIssuer(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_oidc_test.go b/test/api_oidc_test.go new file mode 100644 index 0000000..373bd8d --- /dev/null +++ b/test/api_oidc_test.go @@ -0,0 +1,125 @@ +/* +Ory Hydra API + +Testing OidcAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package client + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/ory/hydra-client-go" +) + +func Test_client_OidcAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test OidcAPIService CreateOidcDynamicClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OidcAPI.CreateOidcDynamicClient(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OidcAPIService CreateVerifiableCredential", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OidcAPI.CreateVerifiableCredential(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OidcAPIService DeleteOidcDynamicClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.OidcAPI.DeleteOidcDynamicClient(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OidcAPIService DiscoverOidcConfiguration", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OidcAPI.DiscoverOidcConfiguration(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OidcAPIService GetOidcDynamicClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OidcAPI.GetOidcDynamicClient(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OidcAPIService GetOidcUserInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OidcAPI.GetOidcUserInfo(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OidcAPIService RevokeOidcSession", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.OidcAPI.RevokeOidcSession(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OidcAPIService SetOidcDynamicClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OidcAPI.SetOidcDynamicClient(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_wellknown_test.go b/test/api_wellknown_test.go new file mode 100644 index 0000000..fb33c03 --- /dev/null +++ b/test/api_wellknown_test.go @@ -0,0 +1,37 @@ +/* +Ory Hydra API + +Testing WellknownAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package client + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/ory/hydra-client-go" +) + +func Test_client_WellknownAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test WellknownAPIService DiscoverJsonWebKeys", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.WellknownAPI.DiscoverJsonWebKeys(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/utils.go b/utils.go index 878a621..25aa4c7 100644 --- a/utils.go +++ b/utils.go @@ -3,7 +3,7 @@ Ory Hydra API Documentation for all of Ory Hydra's APIs. -API version: v2.2.0-rc.3 +API version: v2.2.0 Contact: hi@ory.sh */ @@ -13,6 +13,7 @@ package client import ( "encoding/json" + "reflect" "time" ) @@ -327,3 +328,21 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +}