diff --git a/Makefile b/Makefile index 0d83b6ff9af..0799b703d9b 100644 --- a/Makefile +++ b/Makefile @@ -145,9 +145,10 @@ sdk: .bin/swagger .bin/ory node_modules -g go \ -o "internal/httpclient" \ --git-user-id ory \ - --git-repo-id hydra-client-go \ - --git-host github.com - (cd internal/httpclient && go mod edit -module github.com/ory/hydra-client-go/v2) + --git-repo-id hydra-client-go/v2 \ + --git-host github.com \ + --api-name-suffix "Api" \ + --global-property apiTests=false make format diff --git a/cmd/cmd_import_jwk.go b/cmd/cmd_import_jwk.go index d65545df119..812e58ebc0a 100644 --- a/cmd/cmd_import_jwk.go +++ b/cmd/cmd_import_jwk.go @@ -73,15 +73,18 @@ the imported keys will be added to that set. Otherwise, a new set will be create key = cli.ToSDKFriendlyJSONWebKey(key, "", "") - var buf bytes.Buffer - var jsonWebKey hydra.JsonWebKey + type jwk hydra.JsonWebKey // opt out of OpenAPI-generated UnmarshalJSON + var ( + buf bytes.Buffer + jsonWebKey jwk + ) if err := json.NewEncoder(&buf).Encode(key); err != nil { _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not encode key from `%s` to JSON: %s", src, err) return cmdx.FailSilently(cmd) } if err := json.NewDecoder(&buf).Decode(&jsonWebKey); err != nil { - _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not decode key from `%s` to JSON: %s", src, err) + _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not decode key from `%s` from JSON: %s", src, err) return cmdx.FailSilently(cmd) } @@ -107,7 +110,7 @@ the imported keys will be added to that set. Otherwise, a new set will be create return cmdx.FailSilently(cmd) } - keys[src] = append(keys[src], jsonWebKey) + keys[src] = append(keys[src], hydra.JsonWebKey(jsonWebKey)) } imported := make([]hydra.JsonWebKey, 0, len(keys)) diff --git a/internal/httpclient/.openapi-generator/VERSION b/internal/httpclient/.openapi-generator/VERSION index 6d54bbd7751..4b49d9bb63e 100644 --- a/internal/httpclient/.openapi-generator/VERSION +++ b/internal/httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.1 \ No newline at end of file +7.2.0 \ No newline at end of file diff --git a/internal/httpclient/README.md b/internal/httpclient/README.md index 54e38678e69..4bdf468453a 100644 --- a/internal/httpclient/README.md +++ b/internal/httpclient/README.md @@ -14,7 +14,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context @@ -22,13 +22,13 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: -```golang -import openapi "github.com/ory/hydra-client-go" +```go +import openapi "github.com/ory/hydra-client-go/v2" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -38,17 +38,17 @@ Default configuration comes with `Servers` field that contains server objects as ### Select Server Configuration -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. +For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`. -```golang +```go ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1) ``` ### Templated Server URL -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. +Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`. -```golang +```go ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{ "basePath": "v2", }) @@ -60,9 +60,9 @@ Note, enum values are always validated and all unused variables are silently ign Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. +Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps. -``` +```go ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) @@ -179,34 +179,32 @@ Class | Method | HTTP request | Description ## Documentation For Authorization - +Authentication schemes defined for the API: ### basic - **Type**: HTTP basic authentication Example -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", +```go +auth := context.WithValue(context.Background(), openapi.ContextBasicAuth, openapi.BasicAuth{ + UserName: "username", + Password: "password", }) r, err := client.Service.Operation(auth, args) ``` - ### bearer - **Type**: HTTP Bearer token authentication Example -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING") +```go +auth := context.WithValue(context.Background(), openapi.ContextAccessToken, "BEARER_TOKEN_STRING") r, err := client.Service.Operation(auth, args) ``` - ### oauth2 @@ -220,20 +218,20 @@ r, err := client.Service.Operation(auth, args) Example -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +```go +auth := context.WithValue(context.Background(), openapi.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` Or via OAuth2 module to automatically refresh tokens and perform user authentication. -```golang +```go import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +auth := context.WithValue(oauth2.NoContext, openapi.ContextOAuth2, tokenSource) r, err := client.Service.Operation(auth, args) ``` diff --git a/internal/httpclient/api/openapi.yaml b/internal/httpclient/api/openapi.yaml index 1d1de8ec753..f0acc7a8d07 100644 --- a/internal/httpclient/api/openapi.yaml +++ b/internal/httpclient/api/openapi.yaml @@ -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 OpenID 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: @@ -1913,14 +1943,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 +1963,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 +1977,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 +1991,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 +2046,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 +2218,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 +2241,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 +2263,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 +2273,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 +2300,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 +2324,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 +2336,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 +2380,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 +2407,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 +2452,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 +2516,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 +2540,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 @@ -2558,10 +2609,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 +2647,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: |- @@ -2613,8 +2667,10 @@ components: title: Time duration type: string client_id: - description: "OAuth 2.0 Client ID\n\nThe ID is immutable. If no ID is provided,\ - \ a UUID4 will be generated." + description: |- + OAuth 2.0 Client ID + + The ID is immutable. If no ID is provided, a UUID4 will be generated. type: string client_name: description: |- @@ -2624,9 +2680,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: |- @@ -2636,9 +2694,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: @@ -2654,19 +2715,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: @@ -2687,31 +2750,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,\ @@ -2735,10 +2795,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: @@ -2771,19 +2833,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: @@ -2798,9 +2865,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: @@ -2824,14 +2894,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: |- @@ -2856,12 +2927,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 @@ -3026,9 +3097,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: @@ -3061,11 +3132,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: @@ -3080,15 +3150,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 @@ -3108,36 +3178,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: {} @@ -3153,14 +3216,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 @@ -3302,14 +3363,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: @@ -3420,11 +3485,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: @@ -3446,18 +3510,17 @@ 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 @@ -3590,18 +3653,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. 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 @@ -3698,33 +3762,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 @@ -3749,16 +3819,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: |- @@ -3786,26 +3858,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: @@ -3813,25 +3884,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: |- @@ -3849,10 +3922,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 @@ -3863,11 +3937,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 @@ -3885,11 +3959,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 @@ -3908,10 +3982,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 @@ -4069,36 +4143,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: |- @@ -4124,69 +4211,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: |- @@ -4357,16 +4467,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/internal/httpclient/api_jwk.go b/internal/httpclient/api_jwk.go index eac14c93c1f..3449296411b 100644 --- a/internal/httpclient/api_jwk.go +++ b/internal/httpclient/api_jwk.go @@ -14,7 +14,7 @@ package openapi import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" "strings" @@ -75,7 +75,7 @@ func (a *JwkApiService) CreateJsonWebKeySetExecute(r ApiCreateJsonWebKeySetReque } 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{} @@ -113,9 +113,9 @@ func (a *JwkApiService) CreateJsonWebKeySetExecute(r ApiCreateJsonWebKeySetReque 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 } @@ -131,6 +131,7 @@ func (a *JwkApiService) CreateJsonWebKeySetExecute(r ApiCreateJsonWebKeySetReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -196,8 +197,8 @@ func (a *JwkApiService) DeleteJsonWebKeyExecute(r ApiDeleteJsonWebKeyRequest) (* } 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{} @@ -230,9 +231,9 @@ func (a *JwkApiService) DeleteJsonWebKeyExecute(r ApiDeleteJsonWebKeyRequest) (* 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 } @@ -248,6 +249,7 @@ func (a *JwkApiService) DeleteJsonWebKeyExecute(r ApiDeleteJsonWebKeyRequest) (* newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -298,7 +300,7 @@ func (a *JwkApiService) DeleteJsonWebKeySetExecute(r ApiDeleteJsonWebKeySetReque } 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{} @@ -331,9 +333,9 @@ func (a *JwkApiService) DeleteJsonWebKeySetExecute(r ApiDeleteJsonWebKeySetReque 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 } @@ -349,6 +351,7 @@ func (a *JwkApiService) DeleteJsonWebKeySetExecute(r ApiDeleteJsonWebKeySetReque newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -403,8 +406,8 @@ func (a *JwkApiService) GetJsonWebKeyExecute(r ApiGetJsonWebKeyRequest) (*JsonWe } 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{} @@ -437,9 +440,9 @@ func (a *JwkApiService) GetJsonWebKeyExecute(r ApiGetJsonWebKeyRequest) (*JsonWe 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 } @@ -455,6 +458,7 @@ func (a *JwkApiService) GetJsonWebKeyExecute(r ApiGetJsonWebKeyRequest) (*JsonWe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -517,7 +521,7 @@ func (a *JwkApiService) GetJsonWebKeySetExecute(r ApiGetJsonWebKeySetRequest) (* } 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{} @@ -550,9 +554,9 @@ func (a *JwkApiService) GetJsonWebKeySetExecute(r ApiGetJsonWebKeySetRequest) (* 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 } @@ -568,6 +572,7 @@ func (a *JwkApiService) GetJsonWebKeySetExecute(r ApiGetJsonWebKeySetRequest) (* newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -639,8 +644,8 @@ func (a *JwkApiService) SetJsonWebKeyExecute(r ApiSetJsonWebKeyRequest) (*JsonWe } 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{} @@ -675,9 +680,9 @@ func (a *JwkApiService) SetJsonWebKeyExecute(r ApiSetJsonWebKeyRequest) (*JsonWe 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 } @@ -693,6 +698,7 @@ func (a *JwkApiService) SetJsonWebKeyExecute(r ApiSetJsonWebKeyRequest) (*JsonWe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -761,7 +767,7 @@ func (a *JwkApiService) SetJsonWebKeySetExecute(r ApiSetJsonWebKeySetRequest) (* } 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{} @@ -796,9 +802,9 @@ func (a *JwkApiService) SetJsonWebKeySetExecute(r ApiSetJsonWebKeySetRequest) (* 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,6 +820,7 @@ func (a *JwkApiService) SetJsonWebKeySetExecute(r ApiSetJsonWebKeySetRequest) (* newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/internal/httpclient/api_metadata.go b/internal/httpclient/api_metadata.go index c57ea8ff5db..d05601db4db 100644 --- a/internal/httpclient/api_metadata.go +++ b/internal/httpclient/api_metadata.go @@ -14,7 +14,7 @@ package openapi import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" ) @@ -101,9 +101,9 @@ func (a *MetadataApiService) GetVersionExecute(r ApiGetVersionRequest) (*GetVers 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 } @@ -208,9 +208,9 @@ func (a *MetadataApiService) IsAliveExecute(r ApiIsAliveRequest) (*HealthStatus, 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 } @@ -227,6 +227,7 @@ func (a *MetadataApiService) IsAliveExecute(r ApiIsAliveRequest) (*HealthStatus, newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr @@ -324,9 +325,9 @@ func (a *MetadataApiService) IsReadyExecute(r ApiIsReadyRequest) (*IsReady200Res 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 } @@ -343,6 +344,7 @@ func (a *MetadataApiService) IsReadyExecute(r ApiIsReadyRequest) (*IsReady200Res newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/internal/httpclient/api_o_auth2.go b/internal/httpclient/api_o_auth2.go index f1b8f0348ae..162aeafda12 100644 --- a/internal/httpclient/api_o_auth2.go +++ b/internal/httpclient/api_o_auth2.go @@ -14,7 +14,7 @@ package openapi import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" "strings" @@ -100,7 +100,7 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r ApiAcceptOAuth2Co 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"} @@ -130,9 +130,9 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r ApiAcceptOAuth2Co 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 } @@ -148,6 +148,7 @@ func (a *OAuth2ApiService) AcceptOAuth2ConsentRequestExecute(r ApiAcceptOAuth2Co newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -236,7 +237,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r ApiAcceptOAuth2Logi 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"} @@ -266,9 +267,9 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r ApiAcceptOAuth2Logi 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 } @@ -284,6 +285,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LoginRequestExecute(r ApiAcceptOAuth2Logi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -358,7 +360,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r ApiAcceptOAuth2Log 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{} @@ -386,9 +388,9 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r ApiAcceptOAuth2Log 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 } @@ -404,6 +406,7 @@ func (a *OAuth2ApiService) AcceptOAuth2LogoutRequestExecute(r ApiAcceptOAuth2Log newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -506,9 +509,9 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r ApiCreateOAuth2ClientRequ 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 } @@ -525,6 +528,7 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r ApiCreateOAuth2ClientRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -534,6 +538,7 @@ func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r ApiCreateOAuth2ClientRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -596,7 +601,7 @@ func (a *OAuth2ApiService) DeleteOAuth2ClientExecute(r ApiDeleteOAuth2ClientRequ } 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{} @@ -629,9 +634,9 @@ func (a *OAuth2ApiService) DeleteOAuth2ClientExecute(r ApiDeleteOAuth2ClientRequ 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 } @@ -647,6 +652,7 @@ func (a *OAuth2ApiService) DeleteOAuth2ClientExecute(r ApiDeleteOAuth2ClientRequ newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -707,7 +713,7 @@ func (a *OAuth2ApiService) DeleteOAuth2TokenExecute(r ApiDeleteOAuth2TokenReques 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{} @@ -735,9 +741,9 @@ func (a *OAuth2ApiService) DeleteOAuth2TokenExecute(r ApiDeleteOAuth2TokenReques 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 } @@ -753,6 +759,7 @@ func (a *OAuth2ApiService) DeleteOAuth2TokenExecute(r ApiDeleteOAuth2TokenReques newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -805,7 +812,7 @@ func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r ApiDeleteT } 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{} @@ -838,9 +845,9 @@ func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r ApiDeleteT 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 } @@ -856,6 +863,7 @@ func (a *OAuth2ApiService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r ApiDeleteT newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -910,7 +918,7 @@ func (a *OAuth2ApiService) GetOAuth2ClientExecute(r ApiGetOAuth2ClientRequest) ( } 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{} @@ -943,9 +951,9 @@ func (a *OAuth2ApiService) GetOAuth2ClientExecute(r ApiGetOAuth2ClientRequest) ( 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 } @@ -961,6 +969,7 @@ func (a *OAuth2ApiService) GetOAuth2ClientExecute(r ApiGetOAuth2ClientRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1042,7 +1051,7 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r ApiGetOAuth2ConsentR 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{} @@ -1070,9 +1079,9 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r ApiGetOAuth2ConsentR 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 } @@ -1089,6 +1098,7 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r ApiGetOAuth2ConsentR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1098,6 +1108,7 @@ func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r ApiGetOAuth2ConsentR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1178,7 +1189,7 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r ApiGetOAuth2LoginReque 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{} @@ -1206,9 +1217,9 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r ApiGetOAuth2LoginReque 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 } @@ -1225,6 +1236,7 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r ApiGetOAuth2LoginReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1234,6 +1246,7 @@ func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r ApiGetOAuth2LoginReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1305,7 +1318,7 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r ApiGetOAuth2LogoutReq 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{} @@ -1333,9 +1346,9 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r ApiGetOAuth2LogoutReq 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 } @@ -1352,6 +1365,7 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r ApiGetOAuth2LogoutReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1361,6 +1375,7 @@ func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r ApiGetOAuth2LogoutReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1422,7 +1437,7 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r ApiGetTrusted } 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{} @@ -1455,9 +1470,9 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r ApiGetTrusted 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 } @@ -1473,6 +1488,7 @@ func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r ApiGetTrusted newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1572,9 +1588,9 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r ApiIntrospectOAuth2Tok 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 @@ -1585,9 +1601,9 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r ApiIntrospectOAuth2Tok 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 } @@ -1603,6 +1619,7 @@ func (a *OAuth2ApiService) IntrospectOAuth2TokenExecute(r ApiIntrospectOAuth2Tok newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1695,16 +1712,22 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r ApiListOAuth2ClientsReques 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{} @@ -1733,9 +1756,9 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r ApiListOAuth2ClientsReques 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 } @@ -1751,6 +1774,7 @@ func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r ApiListOAuth2ClientsReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1847,14 +1871,20 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r ApiListOAuth2Conse } 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{} @@ -1883,9 +1913,9 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r ApiListOAuth2Conse 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 } @@ -1901,6 +1931,7 @@ func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r ApiListOAuth2Conse newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1983,13 +2014,13 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r ApiListTrus 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{} @@ -2018,9 +2049,9 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r ApiListTrus 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 } @@ -2036,6 +2067,7 @@ func (a *OAuth2ApiService) ListTrustedOAuth2JwtGrantIssuersExecute(r ApiListTrus newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2128,9 +2160,9 @@ func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r ApiOAuth2AuthorizeRequest) ( 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 } @@ -2146,6 +2178,7 @@ func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r ApiOAuth2AuthorizeRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2262,17 +2295,17 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r ApiOauth2TokenExchangeRe 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 { @@ -2284,9 +2317,9 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r ApiOauth2TokenExchangeRe 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 } @@ -2302,6 +2335,7 @@ func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r ApiOauth2TokenExchangeRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2374,7 +2408,7 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientReques } 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{} @@ -2412,9 +2446,9 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientReques 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 } @@ -2431,6 +2465,7 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2440,6 +2475,7 @@ func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2532,7 +2568,7 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r ApiRejectOAuth2Co 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"} @@ -2562,9 +2598,9 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r ApiRejectOAuth2Co 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 } @@ -2580,6 +2616,7 @@ func (a *OAuth2ApiService) RejectOAuth2ConsentRequestExecute(r ApiRejectOAuth2Co newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2667,7 +2704,7 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r ApiRejectOAuth2Logi 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"} @@ -2697,9 +2734,9 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r ApiRejectOAuth2Logi 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 } @@ -2715,6 +2752,7 @@ func (a *OAuth2ApiService) RejectOAuth2LoginRequestExecute(r ApiRejectOAuth2Logi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2786,7 +2824,7 @@ func (a *OAuth2ApiService) RejectOAuth2LogoutRequestExecute(r ApiRejectOAuth2Log 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{} @@ -2814,9 +2852,9 @@ func (a *OAuth2ApiService) RejectOAuth2LogoutRequestExecute(r ApiRejectOAuth2Log 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 } @@ -2832,6 +2870,7 @@ func (a *OAuth2ApiService) RejectOAuth2LogoutRequestExecute(r ApiRejectOAuth2Log newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -2907,12 +2946,12 @@ func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r ApiRevokeOAuth2C 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{} @@ -2941,9 +2980,9 @@ func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r ApiRevokeOAuth2C 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 } @@ -2959,6 +2998,7 @@ func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r ApiRevokeOAuth2C newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -3031,10 +3071,10 @@ func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r ApiRevokeOAuth2Log 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{} @@ -3063,9 +3103,9 @@ func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r ApiRevokeOAuth2Log 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 } @@ -3081,6 +3121,7 @@ func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r ApiRevokeOAuth2Log newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -3173,12 +3214,12 @@ func (a *OAuth2ApiService) RevokeOAuth2TokenExecute(r ApiRevokeOAuth2TokenReques 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 @@ -3189,9 +3230,9 @@ func (a *OAuth2ApiService) RevokeOAuth2TokenExecute(r ApiRevokeOAuth2TokenReques 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 } @@ -3207,6 +3248,7 @@ func (a *OAuth2ApiService) RevokeOAuth2TokenExecute(r ApiRevokeOAuth2TokenReques newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -3271,7 +3313,7 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( } 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{} @@ -3309,9 +3351,9 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( 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 } @@ -3328,6 +3370,7 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3338,6 +3381,7 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3347,6 +3391,7 @@ func (a *OAuth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3413,7 +3458,7 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r ApiSetOAuth2ClientL } 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{} @@ -3448,9 +3493,9 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r ApiSetOAuth2ClientL 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 } @@ -3466,6 +3511,7 @@ func (a *OAuth2ApiService) SetOAuth2ClientLifespansExecute(r ApiSetOAuth2ClientL newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -3565,9 +3611,9 @@ func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuerExecute(r ApiTrustOAuth2JwtG 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 } @@ -3583,6 +3629,7 @@ func (a *OAuth2ApiService) TrustOAuth2JwtGrantIssuerExecute(r ApiTrustOAuth2JwtG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/internal/httpclient/api_oidc.go b/internal/httpclient/api_oidc.go index 814348a1376..c4c47d859eb 100644 --- a/internal/httpclient/api_oidc.go +++ b/internal/httpclient/api_oidc.go @@ -14,7 +14,7 @@ package openapi import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" "strings" @@ -118,9 +118,9 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r ApiCreateOidcDynamicCl 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 } @@ -137,6 +137,7 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r ApiCreateOidcDynamicCl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -146,6 +147,7 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r ApiCreateOidcDynamicCl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -248,9 +250,9 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r ApiCreateVerifiable 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 } @@ -267,6 +269,7 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r ApiCreateVerifiable newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -276,6 +279,7 @@ func (a *OidcApiService) CreateVerifiableCredentialExecute(r ApiCreateVerifiable newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -343,7 +347,7 @@ func (a *OidcApiService) DeleteOidcDynamicClientExecute(r ApiDeleteOidcDynamicCl } 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{} @@ -376,9 +380,9 @@ func (a *OidcApiService) DeleteOidcDynamicClientExecute(r ApiDeleteOidcDynamicCl 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 } @@ -394,6 +398,7 @@ func (a *OidcApiService) DeleteOidcDynamicClientExecute(r ApiDeleteOidcDynamicCl newErr.error = err.Error() return localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarHTTPResponse, newErr } @@ -477,9 +482,9 @@ func (a *OidcApiService) DiscoverOidcConfigurationExecute(r ApiDiscoverOidcConfi 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 } @@ -495,6 +500,7 @@ func (a *OidcApiService) DiscoverOidcConfigurationExecute(r ApiDiscoverOidcConfi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -561,7 +567,7 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r ApiGetOidcDynamicClientRe } 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{} @@ -594,9 +600,9 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r ApiGetOidcDynamicClientRe 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 } @@ -612,6 +618,7 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r ApiGetOidcDynamicClientRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -706,9 +713,9 @@ func (a *OidcApiService) GetOidcUserInfoExecute(r ApiGetOidcUserInfoRequest) (*O 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 } @@ -724,6 +731,7 @@ func (a *OidcApiService) GetOidcUserInfoExecute(r ApiGetOidcUserInfoRequest) (*O newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -815,9 +823,9 @@ func (a *OidcApiService) RevokeOidcSessionExecute(r ApiRevokeOidcSessionRequest) 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 } @@ -898,7 +906,7 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRe } 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{} @@ -936,9 +944,9 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRe 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 } @@ -955,6 +963,7 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } @@ -964,6 +973,7 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/internal/httpclient/api_wellknown.go b/internal/httpclient/api_wellknown.go index 2ba904fa4ef..7c13ec2cdff 100644 --- a/internal/httpclient/api_wellknown.go +++ b/internal/httpclient/api_wellknown.go @@ -14,7 +14,7 @@ package openapi import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" ) @@ -97,9 +97,9 @@ func (a *WellknownApiService) DiscoverJsonWebKeysExecute(r ApiDiscoverJsonWebKey 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 } @@ -115,6 +115,7 @@ func (a *WellknownApiService) DiscoverJsonWebKeysExecute(r ApiDiscoverJsonWebKey newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/internal/httpclient/client.go b/internal/httpclient/client.go index fe7ccccad0b..8e7c83789d3 100644 --- a/internal/httpclient/client.go +++ b/internal/httpclient/client.go @@ -19,7 +19,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "mime/multipart" "net/http" @@ -38,8 +37,10 @@ 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 v @@ -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 < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) + return - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } } - return fmt.Sprintf("%v", obj) + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } } // helper for converting interface{} parameters to json strings @@ -311,7 +390,11 @@ func (c *APIClient) prepareRequest( } // Encode the parameters. - url.RawQuery = query.Encode() + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) // Generate a new request if body != nil { @@ -378,8 +461,20 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } if f, ok := v.(**os.File); ok { - *f, err = ioutil.TempFile("", "HttpClientFile") + *f, err = os.CreateTemp("", "HttpClientFile") if err != nil { return } @@ -390,13 +485,13 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err _, err = (*f).Seek(0, io.SeekStart) return } - if xmlCheck.MatchString(contentType) { + if XmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err } return nil } - if jsonCheck.MatchString(contentType) { + if JsonCheck.MatchString(contentType) { if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined if err = unmarshalObj.UnmarshalJSON(b); err != nil { @@ -453,18 +548,22 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e if reader, ok := body.(io.Reader); ok { _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(**os.File); ok { - _, err = bodyBuf.ReadFrom(*fp) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) } else if b, ok := body.([]byte); ok { _, err = bodyBuf.Write(b) } else if s, ok := body.(string); ok { _, err = bodyBuf.WriteString(s) } else if s, ok := body.(*string); ok { _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { + } else if JsonCheck.MatchString(contentType) { err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } } if err != nil { @@ -472,7 +571,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -574,3 +673,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/internal/httpclient/configuration.go b/internal/httpclient/configuration.go index 548fdbb05c1..4a85bc09c1a 100644 --- a/internal/httpclient/configuration.go +++ b/internal/httpclient/configuration.go @@ -38,12 +38,6 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") @@ -123,7 +117,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -138,7 +132,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/internal/httpclient/docs/JwkApi.md b/internal/httpclient/docs/JwkApi.md index 3527e0b9622..88a02ff33f9 100644 --- a/internal/httpclient/docs/JwkApi.md +++ b/internal/httpclient/docs/JwkApi.md @@ -28,25 +28,25 @@ Create JSON Web Key package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - set := "set_example" // string | The JSON Web Key Set ID - createJsonWebKeySet := *openapiclient.NewCreateJsonWebKeySet("Alg_example", "Kid_example", "Use_example") // CreateJsonWebKeySet | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.JwkApi.CreateJsonWebKeySet(context.Background(), set).CreateJsonWebKeySet(createJsonWebKeySet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.CreateJsonWebKeySet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateJsonWebKeySet`: JsonWebKeySet - fmt.Fprintf(os.Stdout, "Response from `JwkApi.CreateJsonWebKeySet`: %v\n", resp) + set := "set_example" // string | The JSON Web Key Set ID + createJsonWebKeySet := *openapiclient.NewCreateJsonWebKeySet("Alg_example", "Kid_example", "Use_example") // CreateJsonWebKeySet | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JwkApi.CreateJsonWebKeySet(context.Background(), set).CreateJsonWebKeySet(createJsonWebKeySet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.CreateJsonWebKeySet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateJsonWebKeySet`: JsonWebKeySet + fmt.Fprintf(os.Stdout, "Response from `JwkApi.CreateJsonWebKeySet`: %v\n", resp) } ``` @@ -100,23 +100,23 @@ Delete JSON Web Key package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - set := "set_example" // string | The JSON Web Key Set - kid := "kid_example" // string | The JSON Web Key ID (kid) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.JwkApi.DeleteJsonWebKey(context.Background(), set, kid).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.DeleteJsonWebKey``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + set := "set_example" // string | The JSON Web Key Set + kid := "kid_example" // string | The JSON Web Key ID (kid) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.JwkApi.DeleteJsonWebKey(context.Background(), set, kid).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.DeleteJsonWebKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -171,22 +171,22 @@ Delete JSON Web Key Set package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - set := "set_example" // string | The JSON Web Key Set - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.JwkApi.DeleteJsonWebKeySet(context.Background(), set).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.DeleteJsonWebKeySet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + set := "set_example" // string | The JSON Web Key Set + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.JwkApi.DeleteJsonWebKeySet(context.Background(), set).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.DeleteJsonWebKeySet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -239,25 +239,25 @@ Get JSON Web Key package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - set := "set_example" // string | JSON Web Key Set ID - kid := "kid_example" // string | JSON Web Key ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.JwkApi.GetJsonWebKey(context.Background(), set, kid).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.GetJsonWebKey``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetJsonWebKey`: JsonWebKeySet - fmt.Fprintf(os.Stdout, "Response from `JwkApi.GetJsonWebKey`: %v\n", resp) + set := "set_example" // string | JSON Web Key Set ID + kid := "kid_example" // string | JSON Web Key ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JwkApi.GetJsonWebKey(context.Background(), set, kid).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.GetJsonWebKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetJsonWebKey`: JsonWebKeySet + fmt.Fprintf(os.Stdout, "Response from `JwkApi.GetJsonWebKey`: %v\n", resp) } ``` @@ -312,24 +312,24 @@ Retrieve a JSON Web Key Set package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - set := "set_example" // string | JSON Web Key Set ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.JwkApi.GetJsonWebKeySet(context.Background(), set).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.GetJsonWebKeySet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetJsonWebKeySet`: JsonWebKeySet - fmt.Fprintf(os.Stdout, "Response from `JwkApi.GetJsonWebKeySet`: %v\n", resp) + set := "set_example" // string | JSON Web Key Set ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JwkApi.GetJsonWebKeySet(context.Background(), set).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.GetJsonWebKeySet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetJsonWebKeySet`: JsonWebKeySet + fmt.Fprintf(os.Stdout, "Response from `JwkApi.GetJsonWebKeySet`: %v\n", resp) } ``` @@ -382,26 +382,26 @@ Set JSON Web Key package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - set := "set_example" // string | The JSON Web Key Set ID - kid := "kid_example" // string | JSON Web Key ID - jsonWebKey := *openapiclient.NewJsonWebKey("RS256", "1603dfe0af8f4596", "RSA", "sig") // JsonWebKey | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.JwkApi.SetJsonWebKey(context.Background(), set, kid).JsonWebKey(jsonWebKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.SetJsonWebKey``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetJsonWebKey`: JsonWebKey - fmt.Fprintf(os.Stdout, "Response from `JwkApi.SetJsonWebKey`: %v\n", resp) + set := "set_example" // string | The JSON Web Key Set ID + kid := "kid_example" // string | JSON Web Key ID + jsonWebKey := *openapiclient.NewJsonWebKey("RS256", "1603dfe0af8f4596", "RSA", "sig") // JsonWebKey | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JwkApi.SetJsonWebKey(context.Background(), set, kid).JsonWebKey(jsonWebKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.SetJsonWebKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetJsonWebKey`: JsonWebKey + fmt.Fprintf(os.Stdout, "Response from `JwkApi.SetJsonWebKey`: %v\n", resp) } ``` @@ -457,25 +457,25 @@ Update a JSON Web Key Set package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - set := "set_example" // string | The JSON Web Key Set ID - jsonWebKeySet := *openapiclient.NewJsonWebKeySet() // JsonWebKeySet | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.JwkApi.SetJsonWebKeySet(context.Background(), set).JsonWebKeySet(jsonWebKeySet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.SetJsonWebKeySet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetJsonWebKeySet`: JsonWebKeySet - fmt.Fprintf(os.Stdout, "Response from `JwkApi.SetJsonWebKeySet`: %v\n", resp) + set := "set_example" // string | The JSON Web Key Set ID + jsonWebKeySet := *openapiclient.NewJsonWebKeySet() // JsonWebKeySet | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.JwkApi.SetJsonWebKeySet(context.Background(), set).JsonWebKeySet(jsonWebKeySet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `JwkApi.SetJsonWebKeySet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetJsonWebKeySet`: JsonWebKeySet + fmt.Fprintf(os.Stdout, "Response from `JwkApi.SetJsonWebKeySet`: %v\n", resp) } ``` diff --git a/internal/httpclient/docs/MetadataApi.md b/internal/httpclient/docs/MetadataApi.md index 064272fd09b..ebd8273a09c 100644 --- a/internal/httpclient/docs/MetadataApi.md +++ b/internal/httpclient/docs/MetadataApi.md @@ -24,23 +24,23 @@ Return Running Software Version. package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetadataApi.GetVersion(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.GetVersion``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVersion`: GetVersion200Response - fmt.Fprintf(os.Stdout, "Response from `MetadataApi.GetVersion`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetadataApi.GetVersion(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.GetVersion``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVersion`: GetVersion200Response + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.GetVersion`: %v\n", resp) } ``` @@ -85,23 +85,23 @@ Check HTTP Server Status package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetadataApi.IsAlive(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsAlive``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `IsAlive`: HealthStatus - fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsAlive`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetadataApi.IsAlive(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsAlive``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `IsAlive`: HealthStatus + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsAlive`: %v\n", resp) } ``` @@ -146,23 +146,23 @@ Check HTTP Server and Database Status package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetadataApi.IsReady(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsReady``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `IsReady`: IsReady200Response - fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsReady`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetadataApi.IsReady(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsReady``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `IsReady`: IsReady200Response + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsReady`: %v\n", resp) } ``` diff --git a/internal/httpclient/docs/OAuth2Api.md b/internal/httpclient/docs/OAuth2Api.md index c5b4aff638c..85fbeeca27a 100644 --- a/internal/httpclient/docs/OAuth2Api.md +++ b/internal/httpclient/docs/OAuth2Api.md @@ -49,25 +49,25 @@ Accept OAuth 2.0 Consent Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - consentChallenge := "consentChallenge_example" // string | OAuth 2.0 Consent Request Challenge - acceptOAuth2ConsentRequest := *openapiclient.NewAcceptOAuth2ConsentRequest() // AcceptOAuth2ConsentRequest | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.AcceptOAuth2ConsentRequest(context.Background()).ConsentChallenge(consentChallenge).AcceptOAuth2ConsentRequest(acceptOAuth2ConsentRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.AcceptOAuth2ConsentRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AcceptOAuth2ConsentRequest`: OAuth2RedirectTo - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.AcceptOAuth2ConsentRequest`: %v\n", resp) + consentChallenge := "consentChallenge_example" // string | OAuth 2.0 Consent Request Challenge + acceptOAuth2ConsentRequest := *openapiclient.NewAcceptOAuth2ConsentRequest() // AcceptOAuth2ConsentRequest | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.AcceptOAuth2ConsentRequest(context.Background()).ConsentChallenge(consentChallenge).AcceptOAuth2ConsentRequest(acceptOAuth2ConsentRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.AcceptOAuth2ConsentRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AcceptOAuth2ConsentRequest`: OAuth2RedirectTo + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.AcceptOAuth2ConsentRequest`: %v\n", resp) } ``` @@ -117,25 +117,25 @@ Accept OAuth 2.0 Login Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - loginChallenge := "loginChallenge_example" // string | OAuth 2.0 Login Request Challenge - acceptOAuth2LoginRequest := *openapiclient.NewAcceptOAuth2LoginRequest("Subject_example") // AcceptOAuth2LoginRequest | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.AcceptOAuth2LoginRequest(context.Background()).LoginChallenge(loginChallenge).AcceptOAuth2LoginRequest(acceptOAuth2LoginRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.AcceptOAuth2LoginRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AcceptOAuth2LoginRequest`: OAuth2RedirectTo - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.AcceptOAuth2LoginRequest`: %v\n", resp) + loginChallenge := "loginChallenge_example" // string | OAuth 2.0 Login Request Challenge + acceptOAuth2LoginRequest := *openapiclient.NewAcceptOAuth2LoginRequest("Subject_example") // AcceptOAuth2LoginRequest | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.AcceptOAuth2LoginRequest(context.Background()).LoginChallenge(loginChallenge).AcceptOAuth2LoginRequest(acceptOAuth2LoginRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.AcceptOAuth2LoginRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AcceptOAuth2LoginRequest`: OAuth2RedirectTo + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.AcceptOAuth2LoginRequest`: %v\n", resp) } ``` @@ -185,24 +185,24 @@ Accept OAuth 2.0 Session Logout Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - logoutChallenge := "logoutChallenge_example" // string | OAuth 2.0 Logout Request Challenge - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.AcceptOAuth2LogoutRequest(context.Background()).LogoutChallenge(logoutChallenge).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.AcceptOAuth2LogoutRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AcceptOAuth2LogoutRequest`: OAuth2RedirectTo - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.AcceptOAuth2LogoutRequest`: %v\n", resp) + logoutChallenge := "logoutChallenge_example" // string | OAuth 2.0 Logout Request Challenge + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.AcceptOAuth2LogoutRequest(context.Background()).LogoutChallenge(logoutChallenge).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.AcceptOAuth2LogoutRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AcceptOAuth2LogoutRequest`: OAuth2RedirectTo + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.AcceptOAuth2LogoutRequest`: %v\n", resp) } ``` @@ -251,24 +251,24 @@ Create OAuth 2.0 Client package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | OAuth 2.0 Client Request Body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.CreateOAuth2Client(context.Background()).OAuth2Client(oAuth2Client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.CreateOAuth2Client``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateOAuth2Client`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.CreateOAuth2Client`: %v\n", resp) + oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | OAuth 2.0 Client Request Body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.CreateOAuth2Client(context.Background()).OAuth2Client(oAuth2Client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.CreateOAuth2Client``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateOAuth2Client`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.CreateOAuth2Client`: %v\n", resp) } ``` @@ -317,22 +317,22 @@ Delete OAuth 2.0 Client package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | The id of the OAuth 2.0 Client. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.DeleteOAuth2Client(context.Background(), id).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.DeleteOAuth2Client``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + id := "id_example" // string | The id of the OAuth 2.0 Client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OAuth2Api.DeleteOAuth2Client(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.DeleteOAuth2Client``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -385,22 +385,22 @@ Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - clientId := "clientId_example" // string | OAuth 2.0 Client ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.DeleteOAuth2Token(context.Background()).ClientId(clientId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.DeleteOAuth2Token``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + clientId := "clientId_example" // string | OAuth 2.0 Client ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OAuth2Api.DeleteOAuth2Token(context.Background()).ClientId(clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.DeleteOAuth2Token``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -449,22 +449,22 @@ Delete Trusted OAuth2 JWT Bearer Grant Type Issuer package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | The id of the desired grant - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.DeleteTrustedOAuth2JwtGrantIssuer(context.Background(), id).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.DeleteTrustedOAuth2JwtGrantIssuer``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + id := "id_example" // string | The id of the desired grant + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OAuth2Api.DeleteTrustedOAuth2JwtGrantIssuer(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.DeleteTrustedOAuth2JwtGrantIssuer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -517,24 +517,24 @@ Get an OAuth 2.0 Client package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | The id of the OAuth 2.0 Client. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.GetOAuth2Client(context.Background(), id).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2Client``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOAuth2Client`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2Client`: %v\n", resp) + id := "id_example" // string | The id of the OAuth 2.0 Client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.GetOAuth2Client(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2Client``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOAuth2Client`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2Client`: %v\n", resp) } ``` @@ -587,24 +587,24 @@ Get OAuth 2.0 Consent Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - consentChallenge := "consentChallenge_example" // string | OAuth 2.0 Consent Request Challenge - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.GetOAuth2ConsentRequest(context.Background()).ConsentChallenge(consentChallenge).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2ConsentRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOAuth2ConsentRequest`: OAuth2ConsentRequest - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2ConsentRequest`: %v\n", resp) + consentChallenge := "consentChallenge_example" // string | OAuth 2.0 Consent Request Challenge + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.GetOAuth2ConsentRequest(context.Background()).ConsentChallenge(consentChallenge).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2ConsentRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOAuth2ConsentRequest`: OAuth2ConsentRequest + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2ConsentRequest`: %v\n", resp) } ``` @@ -653,24 +653,24 @@ Get OAuth 2.0 Login Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - loginChallenge := "loginChallenge_example" // string | OAuth 2.0 Login Request Challenge - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.GetOAuth2LoginRequest(context.Background()).LoginChallenge(loginChallenge).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2LoginRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOAuth2LoginRequest`: OAuth2LoginRequest - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2LoginRequest`: %v\n", resp) + loginChallenge := "loginChallenge_example" // string | OAuth 2.0 Login Request Challenge + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.GetOAuth2LoginRequest(context.Background()).LoginChallenge(loginChallenge).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2LoginRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOAuth2LoginRequest`: OAuth2LoginRequest + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2LoginRequest`: %v\n", resp) } ``` @@ -719,24 +719,24 @@ Get OAuth 2.0 Session Logout Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - logoutChallenge := "logoutChallenge_example" // string | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.GetOAuth2LogoutRequest(context.Background()).LogoutChallenge(logoutChallenge).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2LogoutRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOAuth2LogoutRequest`: OAuth2LogoutRequest - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2LogoutRequest`: %v\n", resp) + logoutChallenge := "logoutChallenge_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.GetOAuth2LogoutRequest(context.Background()).LogoutChallenge(logoutChallenge).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetOAuth2LogoutRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOAuth2LogoutRequest`: OAuth2LogoutRequest + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetOAuth2LogoutRequest`: %v\n", resp) } ``` @@ -785,24 +785,24 @@ Get Trusted OAuth2 JWT Bearer Grant Type Issuer package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | The id of the desired grant - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.GetTrustedOAuth2JwtGrantIssuer(context.Background(), id).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetTrustedOAuth2JwtGrantIssuer``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetTrustedOAuth2JwtGrantIssuer`: TrustedOAuth2JwtGrantIssuer - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetTrustedOAuth2JwtGrantIssuer`: %v\n", resp) + id := "id_example" // string | The id of the desired grant + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.GetTrustedOAuth2JwtGrantIssuer(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.GetTrustedOAuth2JwtGrantIssuer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTrustedOAuth2JwtGrantIssuer`: TrustedOAuth2JwtGrantIssuer + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.GetTrustedOAuth2JwtGrantIssuer`: %v\n", resp) } ``` @@ -855,25 +855,25 @@ Introspect OAuth2 Access and Refresh Tokens package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - token := "token_example" // 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. - scope := "scope_example" // string | 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. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.IntrospectOAuth2Token(context.Background()).Token(token).Scope(scope).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.IntrospectOAuth2Token``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `IntrospectOAuth2Token`: IntrospectedOAuth2Token - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.IntrospectOAuth2Token`: %v\n", resp) + token := "token_example" // 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. + scope := "scope_example" // string | 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. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.IntrospectOAuth2Token(context.Background()).Token(token).Scope(scope).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.IntrospectOAuth2Token``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `IntrospectOAuth2Token`: IntrospectedOAuth2Token + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.IntrospectOAuth2Token`: %v\n", resp) } ``` @@ -923,27 +923,27 @@ List OAuth 2.0 Clients package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - pageSize := int64(789) // int64 | 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). (optional) (default to 250) - pageToken := "pageToken_example" // string | 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). (optional) (default to "1") - clientName := "clientName_example" // string | The name of the clients to filter by. (optional) - owner := "owner_example" // string | The owner of the clients to filter by. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.ListOAuth2Clients(context.Background()).PageSize(pageSize).PageToken(pageToken).ClientName(clientName).Owner(owner).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.ListOAuth2Clients``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ListOAuth2Clients`: []OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.ListOAuth2Clients`: %v\n", resp) + pageSize := int64(789) // int64 | 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). (optional) (default to 250) + pageToken := "pageToken_example" // string | 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). (optional) (default to "1") + clientName := "clientName_example" // string | The name of the clients to filter by. (optional) + owner := "owner_example" // string | The owner of the clients to filter by. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.ListOAuth2Clients(context.Background()).PageSize(pageSize).PageToken(pageToken).ClientName(clientName).Owner(owner).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.ListOAuth2Clients``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListOAuth2Clients`: []OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.ListOAuth2Clients`: %v\n", resp) } ``` @@ -995,27 +995,27 @@ List OAuth 2.0 Consent Sessions of a Subject package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - subject := "subject_example" // string | The subject to list the consent sessions for. - pageSize := int64(789) // int64 | 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). (optional) (default to 250) - pageToken := "pageToken_example" // string | 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). (optional) (default to "1") - loginSessionId := "loginSessionId_example" // string | The login session id to list the consent sessions for. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.ListOAuth2ConsentSessions(context.Background()).Subject(subject).PageSize(pageSize).PageToken(pageToken).LoginSessionId(loginSessionId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.ListOAuth2ConsentSessions``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ListOAuth2ConsentSessions`: []OAuth2ConsentSession - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.ListOAuth2ConsentSessions`: %v\n", resp) + subject := "subject_example" // string | The subject to list the consent sessions for. + pageSize := int64(789) // int64 | 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). (optional) (default to 250) + pageToken := "pageToken_example" // string | 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). (optional) (default to "1") + loginSessionId := "loginSessionId_example" // string | The login session id to list the consent sessions for. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.ListOAuth2ConsentSessions(context.Background()).Subject(subject).PageSize(pageSize).PageToken(pageToken).LoginSessionId(loginSessionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.ListOAuth2ConsentSessions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListOAuth2ConsentSessions`: []OAuth2ConsentSession + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.ListOAuth2ConsentSessions`: %v\n", resp) } ``` @@ -1067,26 +1067,26 @@ List Trusted OAuth2 JWT Bearer Grant Type Issuers package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - maxItems := int64(789) // int64 | (optional) - defaultItems := int64(789) // int64 | (optional) - issuer := "issuer_example" // string | If optional \"issuer\" is supplied, only jwt-bearer grants with this issuer will be returned. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.ListTrustedOAuth2JwtGrantIssuers(context.Background()).MaxItems(maxItems).DefaultItems(defaultItems).Issuer(issuer).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.ListTrustedOAuth2JwtGrantIssuers``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ListTrustedOAuth2JwtGrantIssuers`: []TrustedOAuth2JwtGrantIssuer - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.ListTrustedOAuth2JwtGrantIssuers`: %v\n", resp) + maxItems := int64(789) // int64 | (optional) + defaultItems := int64(789) // int64 | (optional) + issuer := "issuer_example" // string | If optional \"issuer\" is supplied, only jwt-bearer grants with this issuer will be returned. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.ListTrustedOAuth2JwtGrantIssuers(context.Background()).MaxItems(maxItems).DefaultItems(defaultItems).Issuer(issuer).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.ListTrustedOAuth2JwtGrantIssuers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListTrustedOAuth2JwtGrantIssuers`: []TrustedOAuth2JwtGrantIssuer + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.ListTrustedOAuth2JwtGrantIssuers`: %v\n", resp) } ``` @@ -1137,23 +1137,23 @@ OAuth 2.0 Authorize Endpoint package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.OAuth2Authorize(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.OAuth2Authorize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `OAuth2Authorize`: ErrorOAuth2 - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.OAuth2Authorize`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.OAuth2Authorize(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.OAuth2Authorize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `OAuth2Authorize`: ErrorOAuth2 + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.OAuth2Authorize`: %v\n", resp) } ``` @@ -1198,28 +1198,28 @@ The OAuth 2.0 Token Endpoint package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - grantType := "grantType_example" // string | - clientId := "clientId_example" // string | (optional) - code := "code_example" // string | (optional) - redirectUri := "redirectUri_example" // string | (optional) - refreshToken := "refreshToken_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.Oauth2TokenExchange(context.Background()).GrantType(grantType).ClientId(clientId).Code(code).RedirectUri(redirectUri).RefreshToken(refreshToken).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.Oauth2TokenExchange``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `Oauth2TokenExchange`: OAuth2TokenExchange - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.Oauth2TokenExchange`: %v\n", resp) + grantType := "grantType_example" // string | + clientId := "clientId_example" // string | (optional) + code := "code_example" // string | (optional) + redirectUri := "redirectUri_example" // string | (optional) + refreshToken := "refreshToken_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.Oauth2TokenExchange(context.Background()).GrantType(grantType).ClientId(clientId).Code(code).RedirectUri(redirectUri).RefreshToken(refreshToken).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.Oauth2TokenExchange``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Oauth2TokenExchange`: OAuth2TokenExchange + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.Oauth2TokenExchange`: %v\n", resp) } ``` @@ -1272,25 +1272,25 @@ Patch OAuth 2.0 Client package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | The id of the OAuth 2.0 Client. - jsonPatch := []openapiclient.JsonPatch{*openapiclient.NewJsonPatch("replace", "/name")} // []JsonPatch | OAuth 2.0 Client JSON Patch Body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.PatchOAuth2Client(context.Background(), id).JsonPatch(jsonPatch).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.PatchOAuth2Client``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchOAuth2Client`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.PatchOAuth2Client`: %v\n", resp) + id := "id_example" // string | The id of the OAuth 2.0 Client. + jsonPatch := []openapiclient.JsonPatch{*openapiclient.NewJsonPatch("replace", "/name")} // []JsonPatch | OAuth 2.0 Client JSON Patch Body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.PatchOAuth2Client(context.Background(), id).JsonPatch(jsonPatch).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.PatchOAuth2Client``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchOAuth2Client`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.PatchOAuth2Client`: %v\n", resp) } ``` @@ -1344,25 +1344,25 @@ Reject OAuth 2.0 Consent Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - consentChallenge := "consentChallenge_example" // string | OAuth 2.0 Consent Request Challenge - rejectOAuth2Request := *openapiclient.NewRejectOAuth2Request() // RejectOAuth2Request | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.RejectOAuth2ConsentRequest(context.Background()).ConsentChallenge(consentChallenge).RejectOAuth2Request(rejectOAuth2Request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RejectOAuth2ConsentRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RejectOAuth2ConsentRequest`: OAuth2RedirectTo - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.RejectOAuth2ConsentRequest`: %v\n", resp) + consentChallenge := "consentChallenge_example" // string | OAuth 2.0 Consent Request Challenge + rejectOAuth2Request := *openapiclient.NewRejectOAuth2Request() // RejectOAuth2Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.RejectOAuth2ConsentRequest(context.Background()).ConsentChallenge(consentChallenge).RejectOAuth2Request(rejectOAuth2Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RejectOAuth2ConsentRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RejectOAuth2ConsentRequest`: OAuth2RedirectTo + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.RejectOAuth2ConsentRequest`: %v\n", resp) } ``` @@ -1412,25 +1412,25 @@ Reject OAuth 2.0 Login Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - loginChallenge := "loginChallenge_example" // string | OAuth 2.0 Login Request Challenge - rejectOAuth2Request := *openapiclient.NewRejectOAuth2Request() // RejectOAuth2Request | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.RejectOAuth2LoginRequest(context.Background()).LoginChallenge(loginChallenge).RejectOAuth2Request(rejectOAuth2Request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RejectOAuth2LoginRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RejectOAuth2LoginRequest`: OAuth2RedirectTo - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.RejectOAuth2LoginRequest`: %v\n", resp) + loginChallenge := "loginChallenge_example" // string | OAuth 2.0 Login Request Challenge + rejectOAuth2Request := *openapiclient.NewRejectOAuth2Request() // RejectOAuth2Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.RejectOAuth2LoginRequest(context.Background()).LoginChallenge(loginChallenge).RejectOAuth2Request(rejectOAuth2Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RejectOAuth2LoginRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RejectOAuth2LoginRequest`: OAuth2RedirectTo + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.RejectOAuth2LoginRequest`: %v\n", resp) } ``` @@ -1480,22 +1480,22 @@ Reject OAuth 2.0 Session Logout Request package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - logoutChallenge := "logoutChallenge_example" // string | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.RejectOAuth2LogoutRequest(context.Background()).LogoutChallenge(logoutChallenge).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RejectOAuth2LogoutRequest``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + logoutChallenge := "logoutChallenge_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OAuth2Api.RejectOAuth2LogoutRequest(context.Background()).LogoutChallenge(logoutChallenge).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RejectOAuth2LogoutRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -1544,24 +1544,24 @@ Revoke OAuth 2.0 Consent Sessions of a Subject package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - subject := "subject_example" // string | OAuth 2.0 Consent Subject The subject whose consent sessions should be deleted. - client := "client_example" // string | OAuth 2.0 Client ID If set, deletes only those consent sessions that have been granted to the specified OAuth 2.0 Client ID. (optional) - all := true // bool | Revoke All Consent Sessions If set to `true` deletes all consent sessions by the Subject that have been granted. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.RevokeOAuth2ConsentSessions(context.Background()).Subject(subject).Client(client).All(all).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2ConsentSessions``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + subject := "subject_example" // string | OAuth 2.0 Consent Subject The subject whose consent sessions should be deleted. + client := "client_example" // string | OAuth 2.0 Client ID If set, deletes only those consent sessions that have been granted to the specified OAuth 2.0 Client ID. (optional) + all := true // bool | Revoke All Consent Sessions If set to `true` deletes all consent sessions by the Subject that have been granted. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OAuth2Api.RevokeOAuth2ConsentSessions(context.Background()).Subject(subject).Client(client).All(all).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2ConsentSessions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -1612,23 +1612,23 @@ Revokes OAuth 2.0 Login Sessions by either a Subject or a SessionID package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - subject := "subject_example" // string | OAuth 2.0 Subject The subject to revoke authentication sessions for. (optional) - sid := "sid_example" // string | OAuth 2.0 Subject The subject to revoke authentication sessions for. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.RevokeOAuth2LoginSessions(context.Background()).Subject(subject).Sid(sid).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2LoginSessions``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + subject := "subject_example" // string | OAuth 2.0 Subject The subject to revoke authentication sessions for. (optional) + sid := "sid_example" // string | OAuth 2.0 Subject The subject to revoke authentication sessions for. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OAuth2Api.RevokeOAuth2LoginSessions(context.Background()).Subject(subject).Sid(sid).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2LoginSessions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -1678,24 +1678,24 @@ Revoke OAuth 2.0 Access or Refresh Token package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - token := "token_example" // string | - clientId := "clientId_example" // string | (optional) - clientSecret := "clientSecret_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.RevokeOAuth2Token(context.Background()).Token(token).ClientId(clientId).ClientSecret(clientSecret).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2Token``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + token := "token_example" // string | + clientId := "clientId_example" // string | (optional) + clientSecret := "clientSecret_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OAuth2Api.RevokeOAuth2Token(context.Background()).Token(token).ClientId(clientId).ClientSecret(clientSecret).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2Token``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -1746,25 +1746,25 @@ Set OAuth 2.0 Client package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | OAuth 2.0 Client ID - oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | OAuth 2.0 Client Request Body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.SetOAuth2Client(context.Background(), id).OAuth2Client(oAuth2Client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.SetOAuth2Client``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetOAuth2Client`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.SetOAuth2Client`: %v\n", resp) + id := "id_example" // string | OAuth 2.0 Client ID + oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | OAuth 2.0 Client Request Body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.SetOAuth2Client(context.Background(), id).OAuth2Client(oAuth2Client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.SetOAuth2Client``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetOAuth2Client`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.SetOAuth2Client`: %v\n", resp) } ``` @@ -1818,25 +1818,25 @@ Set OAuth2 Client Token Lifespans package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | OAuth 2.0 Client ID - oAuth2ClientTokenLifespans := *openapiclient.NewOAuth2ClientTokenLifespans() // OAuth2ClientTokenLifespans | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.SetOAuth2ClientLifespans(context.Background(), id).OAuth2ClientTokenLifespans(oAuth2ClientTokenLifespans).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.SetOAuth2ClientLifespans``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetOAuth2ClientLifespans`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.SetOAuth2ClientLifespans`: %v\n", resp) + id := "id_example" // string | OAuth 2.0 Client ID + oAuth2ClientTokenLifespans := *openapiclient.NewOAuth2ClientTokenLifespans() // OAuth2ClientTokenLifespans | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.SetOAuth2ClientLifespans(context.Background(), id).OAuth2ClientTokenLifespans(oAuth2ClientTokenLifespans).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.SetOAuth2ClientLifespans``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetOAuth2ClientLifespans`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.SetOAuth2ClientLifespans`: %v\n", resp) } ``` @@ -1890,25 +1890,25 @@ Trust OAuth2 JWT Bearer Grant Type Issuer package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" "time" - openapiclient "./openapi" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - trustOAuth2JwtGrantIssuer := *openapiclient.NewTrustOAuth2JwtGrantIssuer(time.Now(), "https://jwt-idp.example.com", *openapiclient.NewJsonWebKey("RS256", "1603dfe0af8f4596", "RSA", "sig"), []string{"Scope_example"}) // TrustOAuth2JwtGrantIssuer | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OAuth2Api.TrustOAuth2JwtGrantIssuer(context.Background()).TrustOAuth2JwtGrantIssuer(trustOAuth2JwtGrantIssuer).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.TrustOAuth2JwtGrantIssuer``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TrustOAuth2JwtGrantIssuer`: TrustedOAuth2JwtGrantIssuer - fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.TrustOAuth2JwtGrantIssuer`: %v\n", resp) + trustOAuth2JwtGrantIssuer := *openapiclient.NewTrustOAuth2JwtGrantIssuer(time.Now(), "https://jwt-idp.example.com", *openapiclient.NewJsonWebKey("RS256", "1603dfe0af8f4596", "RSA", "sig"), []string{"Scope_example"}) // TrustOAuth2JwtGrantIssuer | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OAuth2Api.TrustOAuth2JwtGrantIssuer(context.Background()).TrustOAuth2JwtGrantIssuer(trustOAuth2JwtGrantIssuer).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.TrustOAuth2JwtGrantIssuer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TrustOAuth2JwtGrantIssuer`: TrustedOAuth2JwtGrantIssuer + fmt.Fprintf(os.Stdout, "Response from `OAuth2Api.TrustOAuth2JwtGrantIssuer`: %v\n", resp) } ``` diff --git a/internal/httpclient/docs/OidcApi.md b/internal/httpclient/docs/OidcApi.md index e1884fa2ad4..0044a83c157 100644 --- a/internal/httpclient/docs/OidcApi.md +++ b/internal/httpclient/docs/OidcApi.md @@ -29,24 +29,24 @@ Register OAuth2 Client using OpenID Dynamic Client Registration package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | Dynamic Client Registration Request Body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.CreateOidcDynamicClient(context.Background()).OAuth2Client(oAuth2Client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.CreateOidcDynamicClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateOidcDynamicClient`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OidcApi.CreateOidcDynamicClient`: %v\n", resp) + oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | Dynamic Client Registration Request Body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OidcApi.CreateOidcDynamicClient(context.Background()).OAuth2Client(oAuth2Client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.CreateOidcDynamicClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateOidcDynamicClient`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OidcApi.CreateOidcDynamicClient`: %v\n", resp) } ``` @@ -95,24 +95,24 @@ Issues a Verifiable Credential package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - createVerifiableCredentialRequestBody := *openapiclient.NewCreateVerifiableCredentialRequestBody() // CreateVerifiableCredentialRequestBody | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.CreateVerifiableCredential(context.Background()).CreateVerifiableCredentialRequestBody(createVerifiableCredentialRequestBody).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.CreateVerifiableCredential``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateVerifiableCredential`: VerifiableCredentialResponse - fmt.Fprintf(os.Stdout, "Response from `OidcApi.CreateVerifiableCredential`: %v\n", resp) + createVerifiableCredentialRequestBody := *openapiclient.NewCreateVerifiableCredentialRequestBody() // CreateVerifiableCredentialRequestBody | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OidcApi.CreateVerifiableCredential(context.Background()).CreateVerifiableCredentialRequestBody(createVerifiableCredentialRequestBody).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.CreateVerifiableCredential``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateVerifiableCredential`: VerifiableCredentialResponse + fmt.Fprintf(os.Stdout, "Response from `OidcApi.CreateVerifiableCredential`: %v\n", resp) } ``` @@ -161,22 +161,22 @@ Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | The id of the OAuth 2.0 Client. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.DeleteOidcDynamicClient(context.Background(), id).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.DeleteOidcDynamicClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + id := "id_example" // string | The id of the OAuth 2.0 Client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OidcApi.DeleteOidcDynamicClient(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.DeleteOidcDynamicClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -229,23 +229,23 @@ OpenID Connect Discovery package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.DiscoverOidcConfiguration(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.DiscoverOidcConfiguration``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DiscoverOidcConfiguration`: OidcConfiguration - fmt.Fprintf(os.Stdout, "Response from `OidcApi.DiscoverOidcConfiguration`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OidcApi.DiscoverOidcConfiguration(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.DiscoverOidcConfiguration``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DiscoverOidcConfiguration`: OidcConfiguration + fmt.Fprintf(os.Stdout, "Response from `OidcApi.DiscoverOidcConfiguration`: %v\n", resp) } ``` @@ -290,24 +290,24 @@ Get OAuth2 Client using OpenID Dynamic Client Registration package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | The id of the OAuth 2.0 Client. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.GetOidcDynamicClient(context.Background(), id).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.GetOidcDynamicClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOidcDynamicClient`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OidcApi.GetOidcDynamicClient`: %v\n", resp) + id := "id_example" // string | The id of the OAuth 2.0 Client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OidcApi.GetOidcDynamicClient(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.GetOidcDynamicClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOidcDynamicClient`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OidcApi.GetOidcDynamicClient`: %v\n", resp) } ``` @@ -360,23 +360,23 @@ OpenID Connect Userinfo package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.GetOidcUserInfo(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.GetOidcUserInfo``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOidcUserInfo`: OidcUserInfo - fmt.Fprintf(os.Stdout, "Response from `OidcApi.GetOidcUserInfo`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OidcApi.GetOidcUserInfo(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.GetOidcUserInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOidcUserInfo`: OidcUserInfo + fmt.Fprintf(os.Stdout, "Response from `OidcApi.GetOidcUserInfo`: %v\n", resp) } ``` @@ -421,21 +421,21 @@ OpenID Connect Front- and Back-channel Enabled Logout package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.RevokeOidcSession(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.RevokeOidcSession``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OidcApi.RevokeOidcSession(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.RevokeOidcSession``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -480,25 +480,25 @@ Set OAuth2 Client using OpenID Dynamic Client Registration package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - id := "id_example" // string | OAuth 2.0 Client ID - oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | OAuth 2.0 Client Request Body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.OidcApi.SetOidcDynamicClient(context.Background(), id).OAuth2Client(oAuth2Client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.SetOidcDynamicClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetOidcDynamicClient`: OAuth2Client - fmt.Fprintf(os.Stdout, "Response from `OidcApi.SetOidcDynamicClient`: %v\n", resp) + id := "id_example" // string | OAuth 2.0 Client ID + oAuth2Client := *openapiclient.NewOAuth2Client() // OAuth2Client | OAuth 2.0 Client Request Body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OidcApi.SetOidcDynamicClient(context.Background(), id).OAuth2Client(oAuth2Client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OidcApi.SetOidcDynamicClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetOidcDynamicClient`: OAuth2Client + fmt.Fprintf(os.Stdout, "Response from `OidcApi.SetOidcDynamicClient`: %v\n", resp) } ``` diff --git a/internal/httpclient/docs/WellknownApi.md b/internal/httpclient/docs/WellknownApi.md index 5f184777044..593a997c9b1 100644 --- a/internal/httpclient/docs/WellknownApi.md +++ b/internal/httpclient/docs/WellknownApi.md @@ -22,23 +22,23 @@ Discover Well-Known JSON Web Keys package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "github.com/ory/hydra-client-go/v2" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WellknownApi.DiscoverJsonWebKeys(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WellknownApi.DiscoverJsonWebKeys``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DiscoverJsonWebKeys`: JsonWebKeySet - fmt.Fprintf(os.Stdout, "Response from `WellknownApi.DiscoverJsonWebKeys`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WellknownApi.DiscoverJsonWebKeys(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WellknownApi.DiscoverJsonWebKeys``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DiscoverJsonWebKeys`: JsonWebKeySet + fmt.Fprintf(os.Stdout, "Response from `WellknownApi.DiscoverJsonWebKeys`: %v\n", resp) } ``` diff --git a/internal/httpclient/git_push.sh b/internal/httpclient/git_push.sh index cb3fc304a3a..c25540340a5 100644 --- a/internal/httpclient/git_push.sh +++ b/internal/httpclient/git_push.sh @@ -19,7 +19,7 @@ if [ "$git_user_id" = "" ]; then fi if [ "$git_repo_id" = "" ]; then - git_repo_id="hydra-client-go" + git_repo_id="hydra-client-go/v2" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/internal/httpclient/go.mod b/internal/httpclient/go.mod index 7f4824c2827..4a8378d605e 100644 --- a/internal/httpclient/go.mod +++ b/internal/httpclient/go.mod @@ -1,5 +1,7 @@ module github.com/ory/hydra-client-go/v2 -go 1.13 +go 1.18 -require golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 +require ( + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 +) diff --git a/internal/httpclient/model_accept_o_auth2_consent_request.go b/internal/httpclient/model_accept_o_auth2_consent_request.go index 11d6459acfd..758576adc3e 100644 --- a/internal/httpclient/model_accept_o_auth2_consent_request.go +++ b/internal/httpclient/model_accept_o_auth2_consent_request.go @@ -16,6 +16,9 @@ import ( "time" ) +// checks if the AcceptOAuth2ConsentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AcceptOAuth2ConsentRequest{} + // AcceptOAuth2ConsentRequest struct for AcceptOAuth2ConsentRequest type AcceptOAuth2ConsentRequest struct { GrantAccessTokenAudience []string `json:"grant_access_token_audience,omitempty"` @@ -47,7 +50,7 @@ func NewAcceptOAuth2ConsentRequestWithDefaults() *AcceptOAuth2ConsentRequest { // GetGrantAccessTokenAudience returns the GrantAccessTokenAudience field value if set, zero value otherwise. func (o *AcceptOAuth2ConsentRequest) GetGrantAccessTokenAudience() []string { - if o == nil || o.GrantAccessTokenAudience == nil { + if o == nil || IsNil(o.GrantAccessTokenAudience) { var ret []string return ret } @@ -57,7 +60,7 @@ func (o *AcceptOAuth2ConsentRequest) 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 *AcceptOAuth2ConsentRequest) GetGrantAccessTokenAudienceOk() ([]string, bool) { - if o == nil || o.GrantAccessTokenAudience == nil { + if o == nil || IsNil(o.GrantAccessTokenAudience) { return nil, false } return o.GrantAccessTokenAudience, true @@ -65,7 +68,7 @@ func (o *AcceptOAuth2ConsentRequest) GetGrantAccessTokenAudienceOk() ([]string, // HasGrantAccessTokenAudience returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequest) HasGrantAccessTokenAudience() bool { - if o != nil && o.GrantAccessTokenAudience != nil { + if o != nil && !IsNil(o.GrantAccessTokenAudience) { return true } @@ -79,7 +82,7 @@ func (o *AcceptOAuth2ConsentRequest) SetGrantAccessTokenAudience(v []string) { // GetGrantScope returns the GrantScope field value if set, zero value otherwise. func (o *AcceptOAuth2ConsentRequest) GetGrantScope() []string { - if o == nil || o.GrantScope == nil { + if o == nil || IsNil(o.GrantScope) { var ret []string return ret } @@ -89,7 +92,7 @@ func (o *AcceptOAuth2ConsentRequest) 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 *AcceptOAuth2ConsentRequest) GetGrantScopeOk() ([]string, bool) { - if o == nil || o.GrantScope == nil { + if o == nil || IsNil(o.GrantScope) { return nil, false } return o.GrantScope, true @@ -97,7 +100,7 @@ func (o *AcceptOAuth2ConsentRequest) GetGrantScopeOk() ([]string, bool) { // HasGrantScope returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequest) HasGrantScope() bool { - if o != nil && o.GrantScope != nil { + if o != nil && !IsNil(o.GrantScope) { return true } @@ -111,7 +114,7 @@ func (o *AcceptOAuth2ConsentRequest) SetGrantScope(v []string) { // GetHandledAt returns the HandledAt field value if set, zero value otherwise. func (o *AcceptOAuth2ConsentRequest) GetHandledAt() time.Time { - if o == nil || o.HandledAt == nil { + if o == nil || IsNil(o.HandledAt) { var ret time.Time return ret } @@ -121,7 +124,7 @@ func (o *AcceptOAuth2ConsentRequest) 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 *AcceptOAuth2ConsentRequest) GetHandledAtOk() (*time.Time, bool) { - if o == nil || o.HandledAt == nil { + if o == nil || IsNil(o.HandledAt) { return nil, false } return o.HandledAt, true @@ -129,7 +132,7 @@ func (o *AcceptOAuth2ConsentRequest) GetHandledAtOk() (*time.Time, bool) { // HasHandledAt returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequest) HasHandledAt() bool { - if o != nil && o.HandledAt != nil { + if o != nil && !IsNil(o.HandledAt) { return true } @@ -143,7 +146,7 @@ func (o *AcceptOAuth2ConsentRequest) SetHandledAt(v time.Time) { // GetRemember returns the Remember field value if set, zero value otherwise. func (o *AcceptOAuth2ConsentRequest) GetRemember() bool { - if o == nil || o.Remember == nil { + if o == nil || IsNil(o.Remember) { var ret bool return ret } @@ -153,7 +156,7 @@ func (o *AcceptOAuth2ConsentRequest) 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 *AcceptOAuth2ConsentRequest) GetRememberOk() (*bool, bool) { - if o == nil || o.Remember == nil { + if o == nil || IsNil(o.Remember) { return nil, false } return o.Remember, true @@ -161,7 +164,7 @@ func (o *AcceptOAuth2ConsentRequest) GetRememberOk() (*bool, bool) { // HasRemember returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequest) HasRemember() bool { - if o != nil && o.Remember != nil { + if o != nil && !IsNil(o.Remember) { return true } @@ -175,7 +178,7 @@ func (o *AcceptOAuth2ConsentRequest) SetRemember(v bool) { // GetRememberFor returns the RememberFor field value if set, zero value otherwise. func (o *AcceptOAuth2ConsentRequest) GetRememberFor() int64 { - if o == nil || o.RememberFor == nil { + if o == nil || IsNil(o.RememberFor) { var ret int64 return ret } @@ -185,7 +188,7 @@ func (o *AcceptOAuth2ConsentRequest) 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 *AcceptOAuth2ConsentRequest) GetRememberForOk() (*int64, bool) { - if o == nil || o.RememberFor == nil { + if o == nil || IsNil(o.RememberFor) { return nil, false } return o.RememberFor, true @@ -193,7 +196,7 @@ func (o *AcceptOAuth2ConsentRequest) GetRememberForOk() (*int64, bool) { // HasRememberFor returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequest) HasRememberFor() bool { - if o != nil && o.RememberFor != nil { + if o != nil && !IsNil(o.RememberFor) { return true } @@ -207,7 +210,7 @@ func (o *AcceptOAuth2ConsentRequest) SetRememberFor(v int64) { // GetSession returns the Session field value if set, zero value otherwise. func (o *AcceptOAuth2ConsentRequest) GetSession() AcceptOAuth2ConsentRequestSession { - if o == nil || o.Session == nil { + if o == nil || IsNil(o.Session) { var ret AcceptOAuth2ConsentRequestSession return ret } @@ -217,7 +220,7 @@ func (o *AcceptOAuth2ConsentRequest) GetSession() AcceptOAuth2ConsentRequestSess // 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 *AcceptOAuth2ConsentRequest) GetSessionOk() (*AcceptOAuth2ConsentRequestSession, bool) { - if o == nil || o.Session == nil { + if o == nil || IsNil(o.Session) { return nil, false } return o.Session, true @@ -225,7 +228,7 @@ func (o *AcceptOAuth2ConsentRequest) GetSessionOk() (*AcceptOAuth2ConsentRequest // HasSession returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequest) HasSession() bool { - if o != nil && o.Session != nil { + if o != nil && !IsNil(o.Session) { return true } @@ -238,26 +241,34 @@ func (o *AcceptOAuth2ConsentRequest) SetSession(v AcceptOAuth2ConsentRequestSess } func (o AcceptOAuth2ConsentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AcceptOAuth2ConsentRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableAcceptOAuth2ConsentRequest struct { diff --git a/internal/httpclient/model_accept_o_auth2_consent_request_session.go b/internal/httpclient/model_accept_o_auth2_consent_request_session.go index 33f78991a43..04f7d1356e0 100644 --- a/internal/httpclient/model_accept_o_auth2_consent_request_session.go +++ b/internal/httpclient/model_accept_o_auth2_consent_request_session.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the AcceptOAuth2ConsentRequestSession type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AcceptOAuth2ConsentRequestSession{} + // AcceptOAuth2ConsentRequestSession struct for AcceptOAuth2ConsentRequestSession type AcceptOAuth2ConsentRequestSession struct { // 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! @@ -53,7 +56,7 @@ func (o *AcceptOAuth2ConsentRequestSession) GetAccessToken() interface{} { // 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 *AcceptOAuth2ConsentRequestSession) GetAccessTokenOk() (*interface{}, bool) { - if o == nil || o.AccessToken == nil { + if o == nil || IsNil(o.AccessToken) { return nil, false } return &o.AccessToken, true @@ -61,7 +64,7 @@ func (o *AcceptOAuth2ConsentRequestSession) GetAccessTokenOk() (*interface{}, bo // HasAccessToken returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequestSession) HasAccessToken() bool { - if o != nil && o.AccessToken != nil { + if o != nil && IsNil(o.AccessToken) { return true } @@ -86,7 +89,7 @@ func (o *AcceptOAuth2ConsentRequestSession) GetIdToken() interface{} { // 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 *AcceptOAuth2ConsentRequestSession) GetIdTokenOk() (*interface{}, bool) { - if o == nil || o.IdToken == nil { + if o == nil || IsNil(o.IdToken) { return nil, false } return &o.IdToken, true @@ -94,7 +97,7 @@ func (o *AcceptOAuth2ConsentRequestSession) GetIdTokenOk() (*interface{}, bool) // HasIdToken returns a boolean if a field has been set. func (o *AcceptOAuth2ConsentRequestSession) HasIdToken() bool { - if o != nil && o.IdToken != nil { + if o != nil && IsNil(o.IdToken) { return true } @@ -107,6 +110,14 @@ func (o *AcceptOAuth2ConsentRequestSession) SetIdToken(v interface{}) { } func (o AcceptOAuth2ConsentRequestSession) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AcceptOAuth2ConsentRequestSession) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.AccessToken != nil { toSerialize["access_token"] = o.AccessToken @@ -114,7 +125,7 @@ func (o AcceptOAuth2ConsentRequestSession) MarshalJSON() ([]byte, error) { if o.IdToken != nil { toSerialize["id_token"] = o.IdToken } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableAcceptOAuth2ConsentRequestSession struct { diff --git a/internal/httpclient/model_accept_o_auth2_login_request.go b/internal/httpclient/model_accept_o_auth2_login_request.go index 85c5355b2d6..6b3538dbe41 100644 --- a/internal/httpclient/model_accept_o_auth2_login_request.go +++ b/internal/httpclient/model_accept_o_auth2_login_request.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" ) +// checks if the AcceptOAuth2LoginRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AcceptOAuth2LoginRequest{} + // AcceptOAuth2LoginRequest struct for AcceptOAuth2LoginRequest type AcceptOAuth2LoginRequest struct { // 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. @@ -35,6 +40,8 @@ type AcceptOAuth2LoginRequest struct { Subject string `json:"subject"` } +type _AcceptOAuth2LoginRequest AcceptOAuth2LoginRequest + // NewAcceptOAuth2LoginRequest instantiates a new AcceptOAuth2LoginRequest object // 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 @@ -55,7 +62,7 @@ func NewAcceptOAuth2LoginRequestWithDefaults() *AcceptOAuth2LoginRequest { // GetAcr returns the Acr field value if set, zero value otherwise. func (o *AcceptOAuth2LoginRequest) GetAcr() string { - if o == nil || o.Acr == nil { + if o == nil || IsNil(o.Acr) { var ret string return ret } @@ -65,7 +72,7 @@ func (o *AcceptOAuth2LoginRequest) GetAcr() string { // GetAcrOk returns a tuple with the Acr field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AcceptOAuth2LoginRequest) GetAcrOk() (*string, bool) { - if o == nil || o.Acr == nil { + if o == nil || IsNil(o.Acr) { return nil, false } return o.Acr, true @@ -73,7 +80,7 @@ func (o *AcceptOAuth2LoginRequest) GetAcrOk() (*string, bool) { // HasAcr returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasAcr() bool { - if o != nil && o.Acr != nil { + if o != nil && !IsNil(o.Acr) { return true } @@ -87,7 +94,7 @@ func (o *AcceptOAuth2LoginRequest) SetAcr(v string) { // GetAmr returns the Amr field value if set, zero value otherwise. func (o *AcceptOAuth2LoginRequest) GetAmr() []string { - if o == nil || o.Amr == nil { + if o == nil || IsNil(o.Amr) { var ret []string return ret } @@ -97,7 +104,7 @@ func (o *AcceptOAuth2LoginRequest) GetAmr() []string { // GetAmrOk returns a tuple with the Amr field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AcceptOAuth2LoginRequest) GetAmrOk() ([]string, bool) { - if o == nil || o.Amr == nil { + if o == nil || IsNil(o.Amr) { return nil, false } return o.Amr, true @@ -105,7 +112,7 @@ func (o *AcceptOAuth2LoginRequest) GetAmrOk() ([]string, bool) { // HasAmr returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasAmr() bool { - if o != nil && o.Amr != nil { + if o != nil && !IsNil(o.Amr) { return true } @@ -130,7 +137,7 @@ func (o *AcceptOAuth2LoginRequest) GetContext() interface{} { // 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 *AcceptOAuth2LoginRequest) GetContextOk() (*interface{}, bool) { - if o == nil || o.Context == nil { + if o == nil || IsNil(o.Context) { return nil, false } return &o.Context, true @@ -138,7 +145,7 @@ func (o *AcceptOAuth2LoginRequest) GetContextOk() (*interface{}, bool) { // HasContext returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasContext() bool { - if o != nil && o.Context != nil { + if o != nil && IsNil(o.Context) { return true } @@ -152,7 +159,7 @@ func (o *AcceptOAuth2LoginRequest) SetContext(v interface{}) { // GetExtendSessionLifespan returns the ExtendSessionLifespan field value if set, zero value otherwise. func (o *AcceptOAuth2LoginRequest) GetExtendSessionLifespan() bool { - if o == nil || o.ExtendSessionLifespan == nil { + if o == nil || IsNil(o.ExtendSessionLifespan) { var ret bool return ret } @@ -162,7 +169,7 @@ func (o *AcceptOAuth2LoginRequest) GetExtendSessionLifespan() bool { // GetExtendSessionLifespanOk returns a tuple with the ExtendSessionLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AcceptOAuth2LoginRequest) GetExtendSessionLifespanOk() (*bool, bool) { - if o == nil || o.ExtendSessionLifespan == nil { + if o == nil || IsNil(o.ExtendSessionLifespan) { return nil, false } return o.ExtendSessionLifespan, true @@ -170,7 +177,7 @@ func (o *AcceptOAuth2LoginRequest) GetExtendSessionLifespanOk() (*bool, bool) { // HasExtendSessionLifespan returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasExtendSessionLifespan() bool { - if o != nil && o.ExtendSessionLifespan != nil { + if o != nil && !IsNil(o.ExtendSessionLifespan) { return true } @@ -184,7 +191,7 @@ func (o *AcceptOAuth2LoginRequest) SetExtendSessionLifespan(v bool) { // GetForceSubjectIdentifier returns the ForceSubjectIdentifier field value if set, zero value otherwise. func (o *AcceptOAuth2LoginRequest) GetForceSubjectIdentifier() string { - if o == nil || o.ForceSubjectIdentifier == nil { + if o == nil || IsNil(o.ForceSubjectIdentifier) { var ret string return ret } @@ -194,7 +201,7 @@ func (o *AcceptOAuth2LoginRequest) GetForceSubjectIdentifier() string { // GetForceSubjectIdentifierOk returns a tuple with the ForceSubjectIdentifier field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AcceptOAuth2LoginRequest) GetForceSubjectIdentifierOk() (*string, bool) { - if o == nil || o.ForceSubjectIdentifier == nil { + if o == nil || IsNil(o.ForceSubjectIdentifier) { return nil, false } return o.ForceSubjectIdentifier, true @@ -202,7 +209,7 @@ func (o *AcceptOAuth2LoginRequest) GetForceSubjectIdentifierOk() (*string, bool) // HasForceSubjectIdentifier returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasForceSubjectIdentifier() bool { - if o != nil && o.ForceSubjectIdentifier != nil { + if o != nil && !IsNil(o.ForceSubjectIdentifier) { return true } @@ -216,7 +223,7 @@ func (o *AcceptOAuth2LoginRequest) SetForceSubjectIdentifier(v string) { // GetIdentityProviderSessionId returns the IdentityProviderSessionId field value if set, zero value otherwise. func (o *AcceptOAuth2LoginRequest) GetIdentityProviderSessionId() string { - if o == nil || o.IdentityProviderSessionId == nil { + if o == nil || IsNil(o.IdentityProviderSessionId) { var ret string return ret } @@ -226,7 +233,7 @@ func (o *AcceptOAuth2LoginRequest) GetIdentityProviderSessionId() string { // GetIdentityProviderSessionIdOk returns a tuple with the IdentityProviderSessionId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AcceptOAuth2LoginRequest) GetIdentityProviderSessionIdOk() (*string, bool) { - if o == nil || o.IdentityProviderSessionId == nil { + if o == nil || IsNil(o.IdentityProviderSessionId) { return nil, false } return o.IdentityProviderSessionId, true @@ -234,7 +241,7 @@ func (o *AcceptOAuth2LoginRequest) GetIdentityProviderSessionIdOk() (*string, bo // HasIdentityProviderSessionId returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasIdentityProviderSessionId() bool { - if o != nil && o.IdentityProviderSessionId != nil { + if o != nil && !IsNil(o.IdentityProviderSessionId) { return true } @@ -248,7 +255,7 @@ func (o *AcceptOAuth2LoginRequest) SetIdentityProviderSessionId(v string) { // GetRemember returns the Remember field value if set, zero value otherwise. func (o *AcceptOAuth2LoginRequest) GetRemember() bool { - if o == nil || o.Remember == nil { + if o == nil || IsNil(o.Remember) { var ret bool return ret } @@ -258,7 +265,7 @@ func (o *AcceptOAuth2LoginRequest) 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 *AcceptOAuth2LoginRequest) GetRememberOk() (*bool, bool) { - if o == nil || o.Remember == nil { + if o == nil || IsNil(o.Remember) { return nil, false } return o.Remember, true @@ -266,7 +273,7 @@ func (o *AcceptOAuth2LoginRequest) GetRememberOk() (*bool, bool) { // HasRemember returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasRemember() bool { - if o != nil && o.Remember != nil { + if o != nil && !IsNil(o.Remember) { return true } @@ -280,7 +287,7 @@ func (o *AcceptOAuth2LoginRequest) SetRemember(v bool) { // GetRememberFor returns the RememberFor field value if set, zero value otherwise. func (o *AcceptOAuth2LoginRequest) GetRememberFor() int64 { - if o == nil || o.RememberFor == nil { + if o == nil || IsNil(o.RememberFor) { var ret int64 return ret } @@ -290,7 +297,7 @@ func (o *AcceptOAuth2LoginRequest) 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 *AcceptOAuth2LoginRequest) GetRememberForOk() (*int64, bool) { - if o == nil || o.RememberFor == nil { + if o == nil || IsNil(o.RememberFor) { return nil, false } return o.RememberFor, true @@ -298,7 +305,7 @@ func (o *AcceptOAuth2LoginRequest) GetRememberForOk() (*int64, bool) { // HasRememberFor returns a boolean if a field has been set. func (o *AcceptOAuth2LoginRequest) HasRememberFor() bool { - if o != nil && o.RememberFor != nil { + if o != nil && !IsNil(o.RememberFor) { return true } @@ -335,35 +342,78 @@ func (o *AcceptOAuth2LoginRequest) SetSubject(v string) { } func (o AcceptOAuth2LoginRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AcceptOAuth2LoginRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Acr != nil { + if !IsNil(o.Acr) { toSerialize["acr"] = o.Acr } - if o.Amr != nil { + if !IsNil(o.Amr) { toSerialize["amr"] = o.Amr } if o.Context != nil { toSerialize["context"] = o.Context } - if o.ExtendSessionLifespan != nil { + if !IsNil(o.ExtendSessionLifespan) { toSerialize["extend_session_lifespan"] = o.ExtendSessionLifespan } - if o.ForceSubjectIdentifier != nil { + if !IsNil(o.ForceSubjectIdentifier) { toSerialize["force_subject_identifier"] = o.ForceSubjectIdentifier } - if o.IdentityProviderSessionId != nil { + if !IsNil(o.IdentityProviderSessionId) { toSerialize["identity_provider_session_id"] = o.IdentityProviderSessionId } - 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 true { - toSerialize["subject"] = o.Subject + toSerialize["subject"] = o.Subject + return toSerialize, nil +} + +func (o *AcceptOAuth2LoginRequest) UnmarshalJSON(data []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{ + "subject", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &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) + } + } + + varAcceptOAuth2LoginRequest := _AcceptOAuth2LoginRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAcceptOAuth2LoginRequest) + + if err != nil { + return err + } + + *o = AcceptOAuth2LoginRequest(varAcceptOAuth2LoginRequest) + + return err } type NullableAcceptOAuth2LoginRequest struct { diff --git a/internal/httpclient/model_create_json_web_key_set.go b/internal/httpclient/model_create_json_web_key_set.go index 3c0f429b21b..4170214875e 100644 --- a/internal/httpclient/model_create_json_web_key_set.go +++ b/internal/httpclient/model_create_json_web_key_set.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" ) +// checks if the CreateJsonWebKeySet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateJsonWebKeySet{} + // CreateJsonWebKeySet Create JSON Web Key Set Request Body type CreateJsonWebKeySet struct { // JSON Web Key Algorithm The algorithm to be used for creating the key. Supports `RS256`, `ES256`, `ES512`, `HS512`, and `HS256`. @@ -25,6 +30,8 @@ type CreateJsonWebKeySet struct { Use string `json:"use"` } +type _CreateJsonWebKeySet CreateJsonWebKeySet + // NewCreateJsonWebKeySet instantiates a new CreateJsonWebKeySet object // 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 @@ -118,17 +125,58 @@ func (o *CreateJsonWebKeySet) SetUse(v string) { } func (o CreateJsonWebKeySet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateJsonWebKeySet) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["alg"] = o.Alg + toSerialize["alg"] = o.Alg + toSerialize["kid"] = o.Kid + toSerialize["use"] = o.Use + return toSerialize, nil +} + +func (o *CreateJsonWebKeySet) UnmarshalJSON(data []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{ + "alg", + "kid", + "use", } - if true { - toSerialize["kid"] = o.Kid + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err } - if true { - toSerialize["use"] = o.Use + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varCreateJsonWebKeySet := _CreateJsonWebKeySet{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateJsonWebKeySet) + + if err != nil { + return err + } + + *o = CreateJsonWebKeySet(varCreateJsonWebKeySet) + + return err } type NullableCreateJsonWebKeySet struct { diff --git a/internal/httpclient/model_create_verifiable_credential_request_body.go b/internal/httpclient/model_create_verifiable_credential_request_body.go index 290f703722a..463e4ac6501 100644 --- a/internal/httpclient/model_create_verifiable_credential_request_body.go +++ b/internal/httpclient/model_create_verifiable_credential_request_body.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the CreateVerifiableCredentialRequestBody type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateVerifiableCredentialRequestBody{} + // CreateVerifiableCredentialRequestBody struct for CreateVerifiableCredentialRequestBody type CreateVerifiableCredentialRequestBody struct { Format *string `json:"format,omitempty"` @@ -41,7 +44,7 @@ func NewCreateVerifiableCredentialRequestBodyWithDefaults() *CreateVerifiableCre // GetFormat returns the Format field value if set, zero value otherwise. func (o *CreateVerifiableCredentialRequestBody) GetFormat() string { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { var ret string return ret } @@ -51,7 +54,7 @@ func (o *CreateVerifiableCredentialRequestBody) 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 *CreateVerifiableCredentialRequestBody) GetFormatOk() (*string, bool) { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { return nil, false } return o.Format, true @@ -59,7 +62,7 @@ func (o *CreateVerifiableCredentialRequestBody) GetFormatOk() (*string, bool) { // HasFormat returns a boolean if a field has been set. func (o *CreateVerifiableCredentialRequestBody) HasFormat() bool { - if o != nil && o.Format != nil { + if o != nil && !IsNil(o.Format) { return true } @@ -73,7 +76,7 @@ func (o *CreateVerifiableCredentialRequestBody) SetFormat(v string) { // GetProof returns the Proof field value if set, zero value otherwise. func (o *CreateVerifiableCredentialRequestBody) GetProof() VerifiableCredentialProof { - if o == nil || o.Proof == nil { + if o == nil || IsNil(o.Proof) { var ret VerifiableCredentialProof return ret } @@ -83,7 +86,7 @@ func (o *CreateVerifiableCredentialRequestBody) GetProof() VerifiableCredentialP // GetProofOk returns a tuple with the Proof field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateVerifiableCredentialRequestBody) GetProofOk() (*VerifiableCredentialProof, bool) { - if o == nil || o.Proof == nil { + if o == nil || IsNil(o.Proof) { return nil, false } return o.Proof, true @@ -91,7 +94,7 @@ func (o *CreateVerifiableCredentialRequestBody) GetProofOk() (*VerifiableCredent // HasProof returns a boolean if a field has been set. func (o *CreateVerifiableCredentialRequestBody) HasProof() bool { - if o != nil && o.Proof != nil { + if o != nil && !IsNil(o.Proof) { return true } @@ -105,7 +108,7 @@ func (o *CreateVerifiableCredentialRequestBody) SetProof(v VerifiableCredentialP // GetTypes returns the Types field value if set, zero value otherwise. func (o *CreateVerifiableCredentialRequestBody) GetTypes() []string { - if o == nil || o.Types == nil { + if o == nil || IsNil(o.Types) { var ret []string return ret } @@ -115,7 +118,7 @@ func (o *CreateVerifiableCredentialRequestBody) GetTypes() []string { // GetTypesOk returns a tuple with the Types field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateVerifiableCredentialRequestBody) GetTypesOk() ([]string, bool) { - if o == nil || o.Types == nil { + if o == nil || IsNil(o.Types) { return nil, false } return o.Types, true @@ -123,7 +126,7 @@ func (o *CreateVerifiableCredentialRequestBody) GetTypesOk() ([]string, bool) { // HasTypes returns a boolean if a field has been set. func (o *CreateVerifiableCredentialRequestBody) HasTypes() bool { - if o != nil && o.Types != nil { + if o != nil && !IsNil(o.Types) { return true } @@ -136,17 +139,25 @@ func (o *CreateVerifiableCredentialRequestBody) SetTypes(v []string) { } func (o CreateVerifiableCredentialRequestBody) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateVerifiableCredentialRequestBody) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Format != nil { + if !IsNil(o.Format) { toSerialize["format"] = o.Format } - if o.Proof != nil { + if !IsNil(o.Proof) { toSerialize["proof"] = o.Proof } - if o.Types != nil { + if !IsNil(o.Types) { toSerialize["types"] = o.Types } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCreateVerifiableCredentialRequestBody struct { diff --git a/internal/httpclient/model_credential_supported_draft00.go b/internal/httpclient/model_credential_supported_draft00.go index f95e03ca9fe..47d1c5198e7 100644 --- a/internal/httpclient/model_credential_supported_draft00.go +++ b/internal/httpclient/model_credential_supported_draft00.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the CredentialSupportedDraft00 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialSupportedDraft00{} + // CredentialSupportedDraft00 Includes information about the supported verifiable credentials. type CredentialSupportedDraft00 struct { // OpenID Connect Verifiable Credentials Cryptographic Binding Methods Supported Contains a list of cryptographic binding methods supported for signing the proof. @@ -46,7 +49,7 @@ func NewCredentialSupportedDraft00WithDefaults() *CredentialSupportedDraft00 { // GetCryptographicBindingMethodsSupported returns the CryptographicBindingMethodsSupported field value if set, zero value otherwise. func (o *CredentialSupportedDraft00) GetCryptographicBindingMethodsSupported() []string { - if o == nil || o.CryptographicBindingMethodsSupported == nil { + if o == nil || IsNil(o.CryptographicBindingMethodsSupported) { var ret []string return ret } @@ -56,7 +59,7 @@ func (o *CredentialSupportedDraft00) GetCryptographicBindingMethodsSupported() [ // GetCryptographicBindingMethodsSupportedOk returns a tuple with the CryptographicBindingMethodsSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CredentialSupportedDraft00) GetCryptographicBindingMethodsSupportedOk() ([]string, bool) { - if o == nil || o.CryptographicBindingMethodsSupported == nil { + if o == nil || IsNil(o.CryptographicBindingMethodsSupported) { return nil, false } return o.CryptographicBindingMethodsSupported, true @@ -64,7 +67,7 @@ func (o *CredentialSupportedDraft00) GetCryptographicBindingMethodsSupportedOk() // HasCryptographicBindingMethodsSupported returns a boolean if a field has been set. func (o *CredentialSupportedDraft00) HasCryptographicBindingMethodsSupported() bool { - if o != nil && o.CryptographicBindingMethodsSupported != nil { + if o != nil && !IsNil(o.CryptographicBindingMethodsSupported) { return true } @@ -78,7 +81,7 @@ func (o *CredentialSupportedDraft00) SetCryptographicBindingMethodsSupported(v [ // GetCryptographicSuitesSupported returns the CryptographicSuitesSupported field value if set, zero value otherwise. func (o *CredentialSupportedDraft00) GetCryptographicSuitesSupported() []string { - if o == nil || o.CryptographicSuitesSupported == nil { + if o == nil || IsNil(o.CryptographicSuitesSupported) { var ret []string return ret } @@ -88,7 +91,7 @@ func (o *CredentialSupportedDraft00) GetCryptographicSuitesSupported() []string // GetCryptographicSuitesSupportedOk returns a tuple with the CryptographicSuitesSupported field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CredentialSupportedDraft00) GetCryptographicSuitesSupportedOk() ([]string, bool) { - if o == nil || o.CryptographicSuitesSupported == nil { + if o == nil || IsNil(o.CryptographicSuitesSupported) { return nil, false } return o.CryptographicSuitesSupported, true @@ -96,7 +99,7 @@ func (o *CredentialSupportedDraft00) GetCryptographicSuitesSupportedOk() ([]stri // HasCryptographicSuitesSupported returns a boolean if a field has been set. func (o *CredentialSupportedDraft00) HasCryptographicSuitesSupported() bool { - if o != nil && o.CryptographicSuitesSupported != nil { + if o != nil && !IsNil(o.CryptographicSuitesSupported) { return true } @@ -110,7 +113,7 @@ func (o *CredentialSupportedDraft00) SetCryptographicSuitesSupported(v []string) // GetFormat returns the Format field value if set, zero value otherwise. func (o *CredentialSupportedDraft00) GetFormat() string { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { var ret string return ret } @@ -120,7 +123,7 @@ func (o *CredentialSupportedDraft00) 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 *CredentialSupportedDraft00) GetFormatOk() (*string, bool) { - if o == nil || o.Format == nil { + if o == nil || IsNil(o.Format) { return nil, false } return o.Format, true @@ -128,7 +131,7 @@ func (o *CredentialSupportedDraft00) GetFormatOk() (*string, bool) { // HasFormat returns a boolean if a field has been set. func (o *CredentialSupportedDraft00) HasFormat() bool { - if o != nil && o.Format != nil { + if o != nil && !IsNil(o.Format) { return true } @@ -142,7 +145,7 @@ func (o *CredentialSupportedDraft00) SetFormat(v string) { // GetTypes returns the Types field value if set, zero value otherwise. func (o *CredentialSupportedDraft00) GetTypes() []string { - if o == nil || o.Types == nil { + if o == nil || IsNil(o.Types) { var ret []string return ret } @@ -152,7 +155,7 @@ func (o *CredentialSupportedDraft00) GetTypes() []string { // GetTypesOk returns a tuple with the Types field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CredentialSupportedDraft00) GetTypesOk() ([]string, bool) { - if o == nil || o.Types == nil { + if o == nil || IsNil(o.Types) { return nil, false } return o.Types, true @@ -160,7 +163,7 @@ func (o *CredentialSupportedDraft00) GetTypesOk() ([]string, bool) { // HasTypes returns a boolean if a field has been set. func (o *CredentialSupportedDraft00) HasTypes() bool { - if o != nil && o.Types != nil { + if o != nil && !IsNil(o.Types) { return true } @@ -173,20 +176,28 @@ func (o *CredentialSupportedDraft00) SetTypes(v []string) { } func (o CredentialSupportedDraft00) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialSupportedDraft00) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.CryptographicBindingMethodsSupported != nil { + if !IsNil(o.CryptographicBindingMethodsSupported) { toSerialize["cryptographic_binding_methods_supported"] = o.CryptographicBindingMethodsSupported } - if o.CryptographicSuitesSupported != nil { + if !IsNil(o.CryptographicSuitesSupported) { toSerialize["cryptographic_suites_supported"] = o.CryptographicSuitesSupported } - if o.Format != nil { + if !IsNil(o.Format) { toSerialize["format"] = o.Format } - if o.Types != nil { + if !IsNil(o.Types) { toSerialize["types"] = o.Types } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCredentialSupportedDraft00 struct { diff --git a/internal/httpclient/model_error_o_auth2.go b/internal/httpclient/model_error_o_auth2.go index 47b81b55881..f8be4fca180 100644 --- a/internal/httpclient/model_error_o_auth2.go +++ b/internal/httpclient/model_error_o_auth2.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the ErrorOAuth2 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorOAuth2{} + // ErrorOAuth2 Error type ErrorOAuth2 struct { // Error @@ -48,7 +51,7 @@ func NewErrorOAuth2WithDefaults() *ErrorOAuth2 { // GetError returns the Error field value if set, zero value otherwise. func (o *ErrorOAuth2) GetError() string { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { var ret string return ret } @@ -58,7 +61,7 @@ func (o *ErrorOAuth2) 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 *ErrorOAuth2) GetErrorOk() (*string, bool) { - if o == nil || o.Error == nil { + if o == nil || IsNil(o.Error) { return nil, false } return o.Error, true @@ -66,7 +69,7 @@ func (o *ErrorOAuth2) GetErrorOk() (*string, bool) { // HasError returns a boolean if a field has been set. func (o *ErrorOAuth2) HasError() bool { - if o != nil && o.Error != nil { + if o != nil && !IsNil(o.Error) { return true } @@ -80,7 +83,7 @@ func (o *ErrorOAuth2) SetError(v string) { // GetErrorDebug returns the ErrorDebug field value if set, zero value otherwise. func (o *ErrorOAuth2) GetErrorDebug() string { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { var ret string return ret } @@ -90,7 +93,7 @@ func (o *ErrorOAuth2) 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 *ErrorOAuth2) GetErrorDebugOk() (*string, bool) { - if o == nil || o.ErrorDebug == nil { + if o == nil || IsNil(o.ErrorDebug) { return nil, false } return o.ErrorDebug, true @@ -98,7 +101,7 @@ func (o *ErrorOAuth2) GetErrorDebugOk() (*string, bool) { // HasErrorDebug returns a boolean if a field has been set. func (o *ErrorOAuth2) HasErrorDebug() bool { - if o != nil && o.ErrorDebug != nil { + if o != nil && !IsNil(o.ErrorDebug) { return true } @@ -112,7 +115,7 @@ func (o *ErrorOAuth2) SetErrorDebug(v string) { // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. func (o *ErrorOAuth2) GetErrorDescription() string { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { var ret string return ret } @@ -122,7 +125,7 @@ func (o *ErrorOAuth2) 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 *ErrorOAuth2) GetErrorDescriptionOk() (*string, bool) { - if o == nil || o.ErrorDescription == nil { + if o == nil || IsNil(o.ErrorDescription) { return nil, false } return o.ErrorDescription, true @@ -130,7 +133,7 @@ func (o *ErrorOAuth2) GetErrorDescriptionOk() (*string, bool) { // HasErrorDescription returns a boolean if a field has been set. func (o *ErrorOAuth2) HasErrorDescription() bool { - if o != nil && o.ErrorDescription != nil { + if o != nil && !IsNil(o.ErrorDescription) { return true } @@ -144,7 +147,7 @@ func (o *ErrorOAuth2) SetErrorDescription(v string) { // GetErrorHint returns the ErrorHint field value if set, zero value otherwise. func (o *ErrorOAuth2) GetErrorHint() string { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { var ret string return ret } @@ -154,7 +157,7 @@ func (o *ErrorOAuth2) 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 *ErrorOAuth2) GetErrorHintOk() (*string, bool) { - if o == nil || o.ErrorHint == nil { + if o == nil || IsNil(o.ErrorHint) { return nil, false } return o.ErrorHint, true @@ -162,7 +165,7 @@ func (o *ErrorOAuth2) GetErrorHintOk() (*string, bool) { // HasErrorHint returns a boolean if a field has been set. func (o *ErrorOAuth2) HasErrorHint() bool { - if o != nil && o.ErrorHint != nil { + if o != nil && !IsNil(o.ErrorHint) { return true } @@ -176,7 +179,7 @@ func (o *ErrorOAuth2) SetErrorHint(v string) { // GetStatusCode returns the StatusCode field value if set, zero value otherwise. func (o *ErrorOAuth2) GetStatusCode() int64 { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { var ret int64 return ret } @@ -186,7 +189,7 @@ func (o *ErrorOAuth2) 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 *ErrorOAuth2) GetStatusCodeOk() (*int64, bool) { - if o == nil || o.StatusCode == nil { + if o == nil || IsNil(o.StatusCode) { return nil, false } return o.StatusCode, true @@ -194,7 +197,7 @@ func (o *ErrorOAuth2) GetStatusCodeOk() (*int64, bool) { // HasStatusCode returns a boolean if a field has been set. func (o *ErrorOAuth2) HasStatusCode() bool { - if o != nil && o.StatusCode != nil { + if o != nil && !IsNil(o.StatusCode) { return true } @@ -207,23 +210,31 @@ func (o *ErrorOAuth2) SetStatusCode(v int64) { } func (o ErrorOAuth2) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorOAuth2) 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableErrorOAuth2 struct { diff --git a/internal/httpclient/model_generic_error.go b/internal/httpclient/model_generic_error.go index ad78dc23583..18838178f7e 100644 --- a/internal/httpclient/model_generic_error.go +++ b/internal/httpclient/model_generic_error.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" ) +// checks if the GenericError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericError{} + // GenericError struct for GenericError type GenericError struct { // The status code @@ -35,6 +40,8 @@ type GenericError struct { Status *string `json:"status,omitempty"` } +type _GenericError GenericError + // NewGenericError instantiates a new GenericError object // 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 @@ -55,7 +62,7 @@ func NewGenericErrorWithDefaults() *GenericError { // GetCode returns the Code field value if set, zero value otherwise. func (o *GenericError) GetCode() int64 { - if o == nil || o.Code == nil { + if o == nil || IsNil(o.Code) { var ret int64 return ret } @@ -65,7 +72,7 @@ func (o *GenericError) GetCode() int64 { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *GenericError) GetCodeOk() (*int64, bool) { - if o == nil || o.Code == nil { + if o == nil || IsNil(o.Code) { return nil, false } return o.Code, true @@ -73,7 +80,7 @@ func (o *GenericError) GetCodeOk() (*int64, bool) { // HasCode returns a boolean if a field has been set. func (o *GenericError) HasCode() bool { - if o != nil && o.Code != nil { + if o != nil && !IsNil(o.Code) { return true } @@ -87,7 +94,7 @@ func (o *GenericError) SetCode(v int64) { // GetDebug returns the Debug field value if set, zero value otherwise. func (o *GenericError) GetDebug() string { - if o == nil || o.Debug == nil { + if o == nil || IsNil(o.Debug) { var ret string return ret } @@ -97,7 +104,7 @@ func (o *GenericError) GetDebug() string { // GetDebugOk returns a tuple with the Debug field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *GenericError) GetDebugOk() (*string, bool) { - if o == nil || o.Debug == nil { + if o == nil || IsNil(o.Debug) { return nil, false } return o.Debug, true @@ -105,7 +112,7 @@ func (o *GenericError) GetDebugOk() (*string, bool) { // HasDebug returns a boolean if a field has been set. func (o *GenericError) HasDebug() bool { - if o != nil && o.Debug != nil { + if o != nil && !IsNil(o.Debug) { return true } @@ -130,7 +137,7 @@ func (o *GenericError) GetDetails() interface{} { // 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 *GenericError) GetDetailsOk() (*interface{}, bool) { - if o == nil || o.Details == nil { + if o == nil || IsNil(o.Details) { return nil, false } return &o.Details, true @@ -138,7 +145,7 @@ func (o *GenericError) GetDetailsOk() (*interface{}, bool) { // HasDetails returns a boolean if a field has been set. func (o *GenericError) HasDetails() bool { - if o != nil && o.Details != nil { + if o != nil && IsNil(o.Details) { return true } @@ -152,7 +159,7 @@ func (o *GenericError) SetDetails(v interface{}) { // GetId returns the Id field value if set, zero value otherwise. func (o *GenericError) GetId() string { - if o == nil || o.Id == nil { + if o == nil || IsNil(o.Id) { var ret string return ret } @@ -162,7 +169,7 @@ func (o *GenericError) 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 *GenericError) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { + if o == nil || IsNil(o.Id) { return nil, false } return o.Id, true @@ -170,7 +177,7 @@ func (o *GenericError) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *GenericError) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } @@ -208,7 +215,7 @@ func (o *GenericError) SetMessage(v string) { // GetReason returns the Reason field value if set, zero value otherwise. func (o *GenericError) GetReason() string { - if o == nil || o.Reason == nil { + if o == nil || IsNil(o.Reason) { var ret string return ret } @@ -218,7 +225,7 @@ func (o *GenericError) GetReason() string { // GetReasonOk returns a tuple with the Reason field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *GenericError) GetReasonOk() (*string, bool) { - if o == nil || o.Reason == nil { + if o == nil || IsNil(o.Reason) { return nil, false } return o.Reason, true @@ -226,7 +233,7 @@ func (o *GenericError) GetReasonOk() (*string, bool) { // HasReason returns a boolean if a field has been set. func (o *GenericError) HasReason() bool { - if o != nil && o.Reason != nil { + if o != nil && !IsNil(o.Reason) { return true } @@ -240,7 +247,7 @@ func (o *GenericError) SetReason(v string) { // GetRequest returns the Request field value if set, zero value otherwise. func (o *GenericError) GetRequest() string { - if o == nil || o.Request == nil { + if o == nil || IsNil(o.Request) { var ret string return ret } @@ -250,7 +257,7 @@ func (o *GenericError) GetRequest() string { // GetRequestOk returns a tuple with the Request field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *GenericError) GetRequestOk() (*string, bool) { - if o == nil || o.Request == nil { + if o == nil || IsNil(o.Request) { return nil, false } return o.Request, true @@ -258,7 +265,7 @@ func (o *GenericError) GetRequestOk() (*string, bool) { // HasRequest returns a boolean if a field has been set. func (o *GenericError) HasRequest() bool { - if o != nil && o.Request != nil { + if o != nil && !IsNil(o.Request) { return true } @@ -272,7 +279,7 @@ func (o *GenericError) SetRequest(v string) { // GetStatus returns the Status field value if set, zero value otherwise. func (o *GenericError) GetStatus() string { - if o == nil || o.Status == nil { + if o == nil || IsNil(o.Status) { var ret string return ret } @@ -282,7 +289,7 @@ func (o *GenericError) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *GenericError) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { + if o == nil || IsNil(o.Status) { return nil, false } return o.Status, true @@ -290,7 +297,7 @@ func (o *GenericError) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *GenericError) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && !IsNil(o.Status) { return true } @@ -303,32 +310,75 @@ func (o *GenericError) SetStatus(v string) { } func (o GenericError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Code != nil { + if !IsNil(o.Code) { toSerialize["code"] = o.Code } - if o.Debug != nil { + if !IsNil(o.Debug) { toSerialize["debug"] = o.Debug } if o.Details != nil { toSerialize["details"] = o.Details } - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - if true { - toSerialize["message"] = o.Message - } - if o.Reason != nil { + toSerialize["message"] = o.Message + if !IsNil(o.Reason) { toSerialize["reason"] = o.Reason } - if o.Request != nil { + if !IsNil(o.Request) { toSerialize["request"] = o.Request } - if o.Status != nil { + if !IsNil(o.Status) { toSerialize["status"] = o.Status } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *GenericError) UnmarshalJSON(data []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{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &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) + } + } + + varGenericError := _GenericError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGenericError) + + if err != nil { + return err + } + + *o = GenericError(varGenericError) + + return err } type NullableGenericError struct { diff --git a/internal/httpclient/model_get_version_200_response.go b/internal/httpclient/model_get_version_200_response.go index d53f4a72dcb..d4b885e3011 100644 --- a/internal/httpclient/model_get_version_200_response.go +++ b/internal/httpclient/model_get_version_200_response.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the GetVersion200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetVersion200Response{} + // GetVersion200Response struct for GetVersion200Response type GetVersion200Response struct { // The version of Ory Hydra. @@ -40,7 +43,7 @@ func NewGetVersion200ResponseWithDefaults() *GetVersion200Response { // GetVersion returns the Version field value if set, zero value otherwise. func (o *GetVersion200Response) GetVersion() string { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { var ret string return ret } @@ -50,7 +53,7 @@ func (o *GetVersion200Response) 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 *GetVersion200Response) GetVersionOk() (*string, bool) { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { return nil, false } return o.Version, true @@ -58,7 +61,7 @@ func (o *GetVersion200Response) GetVersionOk() (*string, bool) { // HasVersion returns a boolean if a field has been set. func (o *GetVersion200Response) HasVersion() bool { - if o != nil && o.Version != nil { + if o != nil && !IsNil(o.Version) { return true } @@ -71,11 +74,19 @@ func (o *GetVersion200Response) SetVersion(v string) { } func (o GetVersion200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetVersion200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Version != nil { + if !IsNil(o.Version) { toSerialize["version"] = o.Version } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableGetVersion200Response struct { diff --git a/internal/httpclient/model_health_not_ready_status.go b/internal/httpclient/model_health_not_ready_status.go index 97ac1e0b8fc..1fcf0b32667 100644 --- a/internal/httpclient/model_health_not_ready_status.go +++ b/internal/httpclient/model_health_not_ready_status.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the HealthNotReadyStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HealthNotReadyStatus{} + // HealthNotReadyStatus struct for HealthNotReadyStatus type HealthNotReadyStatus struct { // Errors contains a list of errors that caused the not ready status. @@ -40,7 +43,7 @@ func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus { // GetErrors returns the Errors field value if set, zero value otherwise. func (o *HealthNotReadyStatus) GetErrors() map[string]string { - if o == nil || o.Errors == nil { + if o == nil || IsNil(o.Errors) { var ret map[string]string return ret } @@ -50,7 +53,7 @@ func (o *HealthNotReadyStatus) GetErrors() map[string]string { // GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool) { - if o == nil || o.Errors == nil { + if o == nil || IsNil(o.Errors) { return nil, false } return o.Errors, true @@ -58,7 +61,7 @@ func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool) { // HasErrors returns a boolean if a field has been set. func (o *HealthNotReadyStatus) HasErrors() bool { - if o != nil && o.Errors != nil { + if o != nil && !IsNil(o.Errors) { return true } @@ -71,11 +74,19 @@ func (o *HealthNotReadyStatus) SetErrors(v map[string]string) { } func (o HealthNotReadyStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HealthNotReadyStatus) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Errors != nil { + if !IsNil(o.Errors) { toSerialize["errors"] = o.Errors } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableHealthNotReadyStatus struct { diff --git a/internal/httpclient/model_health_status.go b/internal/httpclient/model_health_status.go index 193dc526174..20d626d914a 100644 --- a/internal/httpclient/model_health_status.go +++ b/internal/httpclient/model_health_status.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the HealthStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HealthStatus{} + // HealthStatus struct for HealthStatus type HealthStatus struct { // Status always contains \"ok\". @@ -40,7 +43,7 @@ func NewHealthStatusWithDefaults() *HealthStatus { // GetStatus returns the Status field value if set, zero value otherwise. func (o *HealthStatus) GetStatus() string { - if o == nil || o.Status == nil { + if o == nil || IsNil(o.Status) { var ret string return ret } @@ -50,7 +53,7 @@ func (o *HealthStatus) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HealthStatus) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { + if o == nil || IsNil(o.Status) { return nil, false } return o.Status, true @@ -58,7 +61,7 @@ func (o *HealthStatus) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *HealthStatus) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && !IsNil(o.Status) { return true } @@ -71,11 +74,19 @@ func (o *HealthStatus) SetStatus(v string) { } func (o HealthStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HealthStatus) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Status != nil { + if !IsNil(o.Status) { toSerialize["status"] = o.Status } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableHealthStatus struct { diff --git a/internal/httpclient/model_introspected_o_auth2_token.go b/internal/httpclient/model_introspected_o_auth2_token.go index a7d55aff1c0..18929106342 100644 --- a/internal/httpclient/model_introspected_o_auth2_token.go +++ b/internal/httpclient/model_introspected_o_auth2_token.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" ) +// checks if the IntrospectedOAuth2Token type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntrospectedOAuth2Token{} + // IntrospectedOAuth2Token Introspection contains an access token's session data as specified by [IETF RFC 7662](https://tools.ietf.org/html/rfc7662) type IntrospectedOAuth2Token struct { // 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). @@ -47,6 +52,8 @@ type IntrospectedOAuth2Token struct { Username *string `json:"username,omitempty"` } +type _IntrospectedOAuth2Token IntrospectedOAuth2Token + // NewIntrospectedOAuth2Token instantiates a new IntrospectedOAuth2Token object // 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 @@ -91,7 +98,7 @@ func (o *IntrospectedOAuth2Token) SetActive(v bool) { // GetAud returns the Aud field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetAud() []string { - if o == nil || o.Aud == nil { + if o == nil || IsNil(o.Aud) { var ret []string return ret } @@ -101,7 +108,7 @@ func (o *IntrospectedOAuth2Token) GetAud() []string { // GetAudOk returns a tuple with the Aud field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetAudOk() ([]string, bool) { - if o == nil || o.Aud == nil { + if o == nil || IsNil(o.Aud) { return nil, false } return o.Aud, true @@ -109,7 +116,7 @@ func (o *IntrospectedOAuth2Token) GetAudOk() ([]string, bool) { // HasAud returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasAud() bool { - if o != nil && o.Aud != nil { + if o != nil && !IsNil(o.Aud) { return true } @@ -123,7 +130,7 @@ func (o *IntrospectedOAuth2Token) SetAud(v []string) { // GetClientId returns the ClientId field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetClientId() string { - if o == nil || o.ClientId == nil { + if o == nil || IsNil(o.ClientId) { var ret string return ret } @@ -133,7 +140,7 @@ func (o *IntrospectedOAuth2Token) GetClientId() string { // GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetClientIdOk() (*string, bool) { - if o == nil || o.ClientId == nil { + if o == nil || IsNil(o.ClientId) { return nil, false } return o.ClientId, true @@ -141,7 +148,7 @@ func (o *IntrospectedOAuth2Token) GetClientIdOk() (*string, bool) { // HasClientId returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasClientId() bool { - if o != nil && o.ClientId != nil { + if o != nil && !IsNil(o.ClientId) { return true } @@ -155,7 +162,7 @@ func (o *IntrospectedOAuth2Token) SetClientId(v string) { // GetExp returns the Exp field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetExp() int64 { - if o == nil || o.Exp == nil { + if o == nil || IsNil(o.Exp) { var ret int64 return ret } @@ -165,7 +172,7 @@ func (o *IntrospectedOAuth2Token) GetExp() int64 { // GetExpOk returns a tuple with the Exp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetExpOk() (*int64, bool) { - if o == nil || o.Exp == nil { + if o == nil || IsNil(o.Exp) { return nil, false } return o.Exp, true @@ -173,7 +180,7 @@ func (o *IntrospectedOAuth2Token) GetExpOk() (*int64, bool) { // HasExp returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasExp() bool { - if o != nil && o.Exp != nil { + if o != nil && !IsNil(o.Exp) { return true } @@ -187,7 +194,7 @@ func (o *IntrospectedOAuth2Token) SetExp(v int64) { // GetExt returns the Ext field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetExt() map[string]interface{} { - if o == nil || o.Ext == nil { + if o == nil || IsNil(o.Ext) { var ret map[string]interface{} return ret } @@ -197,15 +204,15 @@ func (o *IntrospectedOAuth2Token) GetExt() map[string]interface{} { // GetExtOk returns a tuple with the Ext field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetExtOk() (map[string]interface{}, bool) { - if o == nil || o.Ext == nil { - return nil, false + if o == nil || IsNil(o.Ext) { + return map[string]interface{}{}, false } return o.Ext, true } // HasExt returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasExt() bool { - if o != nil && o.Ext != nil { + if o != nil && !IsNil(o.Ext) { return true } @@ -219,7 +226,7 @@ func (o *IntrospectedOAuth2Token) SetExt(v map[string]interface{}) { // GetIat returns the Iat field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetIat() int64 { - if o == nil || o.Iat == nil { + if o == nil || IsNil(o.Iat) { var ret int64 return ret } @@ -229,7 +236,7 @@ func (o *IntrospectedOAuth2Token) GetIat() int64 { // GetIatOk returns a tuple with the Iat field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetIatOk() (*int64, bool) { - if o == nil || o.Iat == nil { + if o == nil || IsNil(o.Iat) { return nil, false } return o.Iat, true @@ -237,7 +244,7 @@ func (o *IntrospectedOAuth2Token) GetIatOk() (*int64, bool) { // HasIat returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasIat() bool { - if o != nil && o.Iat != nil { + if o != nil && !IsNil(o.Iat) { return true } @@ -251,7 +258,7 @@ func (o *IntrospectedOAuth2Token) SetIat(v int64) { // GetIss returns the Iss field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetIss() string { - if o == nil || o.Iss == nil { + if o == nil || IsNil(o.Iss) { var ret string return ret } @@ -261,7 +268,7 @@ func (o *IntrospectedOAuth2Token) GetIss() string { // GetIssOk returns a tuple with the Iss field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetIssOk() (*string, bool) { - if o == nil || o.Iss == nil { + if o == nil || IsNil(o.Iss) { return nil, false } return o.Iss, true @@ -269,7 +276,7 @@ func (o *IntrospectedOAuth2Token) GetIssOk() (*string, bool) { // HasIss returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasIss() bool { - if o != nil && o.Iss != nil { + if o != nil && !IsNil(o.Iss) { return true } @@ -283,7 +290,7 @@ func (o *IntrospectedOAuth2Token) SetIss(v string) { // GetNbf returns the Nbf field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetNbf() int64 { - if o == nil || o.Nbf == nil { + if o == nil || IsNil(o.Nbf) { var ret int64 return ret } @@ -293,7 +300,7 @@ func (o *IntrospectedOAuth2Token) GetNbf() int64 { // GetNbfOk returns a tuple with the Nbf field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetNbfOk() (*int64, bool) { - if o == nil || o.Nbf == nil { + if o == nil || IsNil(o.Nbf) { return nil, false } return o.Nbf, true @@ -301,7 +308,7 @@ func (o *IntrospectedOAuth2Token) GetNbfOk() (*int64, bool) { // HasNbf returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasNbf() bool { - if o != nil && o.Nbf != nil { + if o != nil && !IsNil(o.Nbf) { return true } @@ -315,7 +322,7 @@ func (o *IntrospectedOAuth2Token) SetNbf(v int64) { // GetObfuscatedSubject returns the ObfuscatedSubject field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetObfuscatedSubject() string { - if o == nil || o.ObfuscatedSubject == nil { + if o == nil || IsNil(o.ObfuscatedSubject) { var ret string return ret } @@ -325,7 +332,7 @@ func (o *IntrospectedOAuth2Token) GetObfuscatedSubject() string { // GetObfuscatedSubjectOk returns a tuple with the ObfuscatedSubject field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetObfuscatedSubjectOk() (*string, bool) { - if o == nil || o.ObfuscatedSubject == nil { + if o == nil || IsNil(o.ObfuscatedSubject) { return nil, false } return o.ObfuscatedSubject, true @@ -333,7 +340,7 @@ func (o *IntrospectedOAuth2Token) GetObfuscatedSubjectOk() (*string, bool) { // HasObfuscatedSubject returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasObfuscatedSubject() bool { - if o != nil && o.ObfuscatedSubject != nil { + if o != nil && !IsNil(o.ObfuscatedSubject) { return true } @@ -347,7 +354,7 @@ func (o *IntrospectedOAuth2Token) SetObfuscatedSubject(v string) { // GetScope returns the Scope field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetScope() string { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { var ret string return ret } @@ -357,7 +364,7 @@ func (o *IntrospectedOAuth2Token) 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 *IntrospectedOAuth2Token) GetScopeOk() (*string, bool) { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { return nil, false } return o.Scope, true @@ -365,7 +372,7 @@ func (o *IntrospectedOAuth2Token) GetScopeOk() (*string, bool) { // HasScope returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasScope() bool { - if o != nil && o.Scope != nil { + if o != nil && !IsNil(o.Scope) { return true } @@ -379,7 +386,7 @@ func (o *IntrospectedOAuth2Token) SetScope(v string) { // GetSub returns the Sub field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetSub() string { - if o == nil || o.Sub == nil { + if o == nil || IsNil(o.Sub) { var ret string return ret } @@ -389,7 +396,7 @@ func (o *IntrospectedOAuth2Token) 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 *IntrospectedOAuth2Token) GetSubOk() (*string, bool) { - if o == nil || o.Sub == nil { + if o == nil || IsNil(o.Sub) { return nil, false } return o.Sub, true @@ -397,7 +404,7 @@ func (o *IntrospectedOAuth2Token) GetSubOk() (*string, bool) { // HasSub returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasSub() bool { - if o != nil && o.Sub != nil { + if o != nil && !IsNil(o.Sub) { return true } @@ -411,7 +418,7 @@ func (o *IntrospectedOAuth2Token) SetSub(v string) { // GetTokenType returns the TokenType field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetTokenType() string { - if o == nil || o.TokenType == nil { + if o == nil || IsNil(o.TokenType) { var ret string return ret } @@ -421,7 +428,7 @@ func (o *IntrospectedOAuth2Token) 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 *IntrospectedOAuth2Token) GetTokenTypeOk() (*string, bool) { - if o == nil || o.TokenType == nil { + if o == nil || IsNil(o.TokenType) { return nil, false } return o.TokenType, true @@ -429,7 +436,7 @@ func (o *IntrospectedOAuth2Token) GetTokenTypeOk() (*string, bool) { // HasTokenType returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasTokenType() bool { - if o != nil && o.TokenType != nil { + if o != nil && !IsNil(o.TokenType) { return true } @@ -443,7 +450,7 @@ func (o *IntrospectedOAuth2Token) SetTokenType(v string) { // GetTokenUse returns the TokenUse field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetTokenUse() string { - if o == nil || o.TokenUse == nil { + if o == nil || IsNil(o.TokenUse) { var ret string return ret } @@ -453,7 +460,7 @@ func (o *IntrospectedOAuth2Token) GetTokenUse() string { // GetTokenUseOk returns a tuple with the TokenUse field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetTokenUseOk() (*string, bool) { - if o == nil || o.TokenUse == nil { + if o == nil || IsNil(o.TokenUse) { return nil, false } return o.TokenUse, true @@ -461,7 +468,7 @@ func (o *IntrospectedOAuth2Token) GetTokenUseOk() (*string, bool) { // HasTokenUse returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasTokenUse() bool { - if o != nil && o.TokenUse != nil { + if o != nil && !IsNil(o.TokenUse) { return true } @@ -475,7 +482,7 @@ func (o *IntrospectedOAuth2Token) SetTokenUse(v string) { // GetUsername returns the Username field value if set, zero value otherwise. func (o *IntrospectedOAuth2Token) GetUsername() string { - if o == nil || o.Username == nil { + if o == nil || IsNil(o.Username) { var ret string return ret } @@ -485,7 +492,7 @@ func (o *IntrospectedOAuth2Token) GetUsername() string { // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IntrospectedOAuth2Token) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { + if o == nil || IsNil(o.Username) { return nil, false } return o.Username, true @@ -493,7 +500,7 @@ func (o *IntrospectedOAuth2Token) GetUsernameOk() (*string, bool) { // HasUsername returns a boolean if a field has been set. func (o *IntrospectedOAuth2Token) HasUsername() bool { - if o != nil && o.Username != nil { + if o != nil && !IsNil(o.Username) { return true } @@ -506,50 +513,93 @@ func (o *IntrospectedOAuth2Token) SetUsername(v string) { } func (o IntrospectedOAuth2Token) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["active"] = o.Active + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Aud != nil { + return json.Marshal(toSerialize) +} + +func (o IntrospectedOAuth2Token) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["active"] = o.Active + if !IsNil(o.Aud) { toSerialize["aud"] = o.Aud } - if o.ClientId != nil { + if !IsNil(o.ClientId) { toSerialize["client_id"] = o.ClientId } - if o.Exp != nil { + if !IsNil(o.Exp) { toSerialize["exp"] = o.Exp } - if o.Ext != nil { + if !IsNil(o.Ext) { toSerialize["ext"] = o.Ext } - if o.Iat != nil { + if !IsNil(o.Iat) { toSerialize["iat"] = o.Iat } - if o.Iss != nil { + if !IsNil(o.Iss) { toSerialize["iss"] = o.Iss } - if o.Nbf != nil { + if !IsNil(o.Nbf) { toSerialize["nbf"] = o.Nbf } - if o.ObfuscatedSubject != nil { + if !IsNil(o.ObfuscatedSubject) { toSerialize["obfuscated_subject"] = o.ObfuscatedSubject } - if o.Scope != nil { + if !IsNil(o.Scope) { toSerialize["scope"] = o.Scope } - if o.Sub != nil { + if !IsNil(o.Sub) { toSerialize["sub"] = o.Sub } - if o.TokenType != nil { + if !IsNil(o.TokenType) { toSerialize["token_type"] = o.TokenType } - if o.TokenUse != nil { + if !IsNil(o.TokenUse) { toSerialize["token_use"] = o.TokenUse } - if o.Username != nil { + if !IsNil(o.Username) { toSerialize["username"] = o.Username } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *IntrospectedOAuth2Token) UnmarshalJSON(data []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{ + "active", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &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) + } + } + + varIntrospectedOAuth2Token := _IntrospectedOAuth2Token{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIntrospectedOAuth2Token) + + if err != nil { + return err + } + + *o = IntrospectedOAuth2Token(varIntrospectedOAuth2Token) + + return err } type NullableIntrospectedOAuth2Token struct { diff --git a/internal/httpclient/model_is_ready_200_response.go b/internal/httpclient/model_is_ready_200_response.go index f7b8957c70f..8a44bacc885 100644 --- a/internal/httpclient/model_is_ready_200_response.go +++ b/internal/httpclient/model_is_ready_200_response.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the IsReady200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IsReady200Response{} + // IsReady200Response struct for IsReady200Response type IsReady200Response struct { // Always \"ok\". @@ -40,7 +43,7 @@ func NewIsReady200ResponseWithDefaults() *IsReady200Response { // GetStatus returns the Status field value if set, zero value otherwise. func (o *IsReady200Response) GetStatus() string { - if o == nil || o.Status == nil { + if o == nil || IsNil(o.Status) { var ret string return ret } @@ -50,7 +53,7 @@ func (o *IsReady200Response) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IsReady200Response) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { + if o == nil || IsNil(o.Status) { return nil, false } return o.Status, true @@ -58,7 +61,7 @@ func (o *IsReady200Response) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *IsReady200Response) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && !IsNil(o.Status) { return true } @@ -71,11 +74,19 @@ func (o *IsReady200Response) SetStatus(v string) { } func (o IsReady200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IsReady200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Status != nil { + if !IsNil(o.Status) { toSerialize["status"] = o.Status } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableIsReady200Response struct { diff --git a/internal/httpclient/model_is_ready_503_response.go b/internal/httpclient/model_is_ready_503_response.go index 14788440b2b..f0696c01c6f 100644 --- a/internal/httpclient/model_is_ready_503_response.go +++ b/internal/httpclient/model_is_ready_503_response.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the IsReady503Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IsReady503Response{} + // IsReady503Response struct for IsReady503Response type IsReady503Response struct { // Errors contains a list of errors that caused the not ready status. @@ -40,7 +43,7 @@ func NewIsReady503ResponseWithDefaults() *IsReady503Response { // GetErrors returns the Errors field value if set, zero value otherwise. func (o *IsReady503Response) GetErrors() map[string]string { - if o == nil || o.Errors == nil { + if o == nil || IsNil(o.Errors) { var ret map[string]string return ret } @@ -50,7 +53,7 @@ func (o *IsReady503Response) GetErrors() map[string]string { // GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IsReady503Response) GetErrorsOk() (*map[string]string, bool) { - if o == nil || o.Errors == nil { + if o == nil || IsNil(o.Errors) { return nil, false } return o.Errors, true @@ -58,7 +61,7 @@ func (o *IsReady503Response) GetErrorsOk() (*map[string]string, bool) { // HasErrors returns a boolean if a field has been set. func (o *IsReady503Response) HasErrors() bool { - if o != nil && o.Errors != nil { + if o != nil && !IsNil(o.Errors) { return true } @@ -71,11 +74,19 @@ func (o *IsReady503Response) SetErrors(v map[string]string) { } func (o IsReady503Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IsReady503Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Errors != nil { + if !IsNil(o.Errors) { toSerialize["errors"] = o.Errors } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableIsReady503Response struct { diff --git a/internal/httpclient/model_json_patch.go b/internal/httpclient/model_json_patch.go index 4489698fd83..ec1b6786d0e 100644 --- a/internal/httpclient/model_json_patch.go +++ b/internal/httpclient/model_json_patch.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" ) +// checks if the JsonPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JsonPatch{} + // JsonPatch A JSONPatch document as defined by RFC 6902 type JsonPatch struct { // 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). @@ -27,6 +32,8 @@ type JsonPatch struct { Value interface{} `json:"value,omitempty"` } +type _JsonPatch JsonPatch + // NewJsonPatch instantiates a new JsonPatch object // 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 @@ -48,7 +55,7 @@ func NewJsonPatchWithDefaults() *JsonPatch { // GetFrom returns the From field value if set, zero value otherwise. func (o *JsonPatch) GetFrom() string { - if o == nil || o.From == nil { + if o == nil || IsNil(o.From) { var ret string return ret } @@ -58,7 +65,7 @@ func (o *JsonPatch) GetFrom() string { // GetFromOk returns a tuple with the From field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonPatch) GetFromOk() (*string, bool) { - if o == nil || o.From == nil { + if o == nil || IsNil(o.From) { return nil, false } return o.From, true @@ -66,7 +73,7 @@ func (o *JsonPatch) GetFromOk() (*string, bool) { // HasFrom returns a boolean if a field has been set. func (o *JsonPatch) HasFrom() bool { - if o != nil && o.From != nil { + if o != nil && !IsNil(o.From) { return true } @@ -139,7 +146,7 @@ func (o *JsonPatch) GetValue() interface{} { // 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 *JsonPatch) GetValueOk() (*interface{}, bool) { - if o == nil || o.Value == nil { + if o == nil || IsNil(o.Value) { return nil, false } return &o.Value, true @@ -147,7 +154,7 @@ func (o *JsonPatch) GetValueOk() (*interface{}, bool) { // HasValue returns a boolean if a field has been set. func (o *JsonPatch) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && IsNil(o.Value) { return true } @@ -160,20 +167,62 @@ func (o *JsonPatch) SetValue(v interface{}) { } func (o JsonPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JsonPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.From != nil { + if !IsNil(o.From) { toSerialize["from"] = o.From } - if true { - toSerialize["op"] = o.Op - } - if true { - toSerialize["path"] = o.Path - } + toSerialize["op"] = o.Op + toSerialize["path"] = o.Path if o.Value != nil { toSerialize["value"] = o.Value } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *JsonPatch) UnmarshalJSON(data []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{ + "op", + "path", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &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) + } + } + + varJsonPatch := _JsonPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varJsonPatch) + + if err != nil { + return err + } + + *o = JsonPatch(varJsonPatch) + + return err } type NullableJsonPatch struct { diff --git a/internal/httpclient/model_json_web_key.go b/internal/httpclient/model_json_web_key.go index a56124b5ec1..c10a80c8fe9 100644 --- a/internal/httpclient/model_json_web_key.go +++ b/internal/httpclient/model_json_web_key.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" ) +// checks if the JsonWebKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JsonWebKey{} + // JsonWebKey struct for JsonWebKey type JsonWebKey struct { // 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. @@ -41,6 +46,8 @@ type JsonWebKey struct { Y *string `json:"y,omitempty"` } +type _JsonWebKey JsonWebKey + // NewJsonWebKey instantiates a new JsonWebKey object // 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 @@ -88,7 +95,7 @@ func (o *JsonWebKey) SetAlg(v string) { // GetCrv returns the Crv field value if set, zero value otherwise. func (o *JsonWebKey) GetCrv() string { - if o == nil || o.Crv == nil { + if o == nil || IsNil(o.Crv) { var ret string return ret } @@ -98,7 +105,7 @@ func (o *JsonWebKey) GetCrv() string { // GetCrvOk returns a tuple with the Crv field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetCrvOk() (*string, bool) { - if o == nil || o.Crv == nil { + if o == nil || IsNil(o.Crv) { return nil, false } return o.Crv, true @@ -106,7 +113,7 @@ func (o *JsonWebKey) GetCrvOk() (*string, bool) { // HasCrv returns a boolean if a field has been set. func (o *JsonWebKey) HasCrv() bool { - if o != nil && o.Crv != nil { + if o != nil && !IsNil(o.Crv) { return true } @@ -120,7 +127,7 @@ func (o *JsonWebKey) SetCrv(v string) { // GetD returns the D field value if set, zero value otherwise. func (o *JsonWebKey) GetD() string { - if o == nil || o.D == nil { + if o == nil || IsNil(o.D) { var ret string return ret } @@ -130,7 +137,7 @@ func (o *JsonWebKey) GetD() string { // GetDOk returns a tuple with the D field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetDOk() (*string, bool) { - if o == nil || o.D == nil { + if o == nil || IsNil(o.D) { return nil, false } return o.D, true @@ -138,7 +145,7 @@ func (o *JsonWebKey) GetDOk() (*string, bool) { // HasD returns a boolean if a field has been set. func (o *JsonWebKey) HasD() bool { - if o != nil && o.D != nil { + if o != nil && !IsNil(o.D) { return true } @@ -152,7 +159,7 @@ func (o *JsonWebKey) SetD(v string) { // GetDp returns the Dp field value if set, zero value otherwise. func (o *JsonWebKey) GetDp() string { - if o == nil || o.Dp == nil { + if o == nil || IsNil(o.Dp) { var ret string return ret } @@ -162,7 +169,7 @@ func (o *JsonWebKey) GetDp() string { // GetDpOk returns a tuple with the Dp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetDpOk() (*string, bool) { - if o == nil || o.Dp == nil { + if o == nil || IsNil(o.Dp) { return nil, false } return o.Dp, true @@ -170,7 +177,7 @@ func (o *JsonWebKey) GetDpOk() (*string, bool) { // HasDp returns a boolean if a field has been set. func (o *JsonWebKey) HasDp() bool { - if o != nil && o.Dp != nil { + if o != nil && !IsNil(o.Dp) { return true } @@ -184,7 +191,7 @@ func (o *JsonWebKey) SetDp(v string) { // GetDq returns the Dq field value if set, zero value otherwise. func (o *JsonWebKey) GetDq() string { - if o == nil || o.Dq == nil { + if o == nil || IsNil(o.Dq) { var ret string return ret } @@ -194,7 +201,7 @@ func (o *JsonWebKey) GetDq() string { // GetDqOk returns a tuple with the Dq field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetDqOk() (*string, bool) { - if o == nil || o.Dq == nil { + if o == nil || IsNil(o.Dq) { return nil, false } return o.Dq, true @@ -202,7 +209,7 @@ func (o *JsonWebKey) GetDqOk() (*string, bool) { // HasDq returns a boolean if a field has been set. func (o *JsonWebKey) HasDq() bool { - if o != nil && o.Dq != nil { + if o != nil && !IsNil(o.Dq) { return true } @@ -216,7 +223,7 @@ func (o *JsonWebKey) SetDq(v string) { // GetE returns the E field value if set, zero value otherwise. func (o *JsonWebKey) GetE() string { - if o == nil || o.E == nil { + if o == nil || IsNil(o.E) { var ret string return ret } @@ -226,7 +233,7 @@ func (o *JsonWebKey) GetE() string { // GetEOk returns a tuple with the E field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetEOk() (*string, bool) { - if o == nil || o.E == nil { + if o == nil || IsNil(o.E) { return nil, false } return o.E, true @@ -234,7 +241,7 @@ func (o *JsonWebKey) GetEOk() (*string, bool) { // HasE returns a boolean if a field has been set. func (o *JsonWebKey) HasE() bool { - if o != nil && o.E != nil { + if o != nil && !IsNil(o.E) { return true } @@ -248,7 +255,7 @@ func (o *JsonWebKey) SetE(v string) { // GetK returns the K field value if set, zero value otherwise. func (o *JsonWebKey) GetK() string { - if o == nil || o.K == nil { + if o == nil || IsNil(o.K) { var ret string return ret } @@ -258,7 +265,7 @@ func (o *JsonWebKey) GetK() string { // GetKOk returns a tuple with the K field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetKOk() (*string, bool) { - if o == nil || o.K == nil { + if o == nil || IsNil(o.K) { return nil, false } return o.K, true @@ -266,7 +273,7 @@ func (o *JsonWebKey) GetKOk() (*string, bool) { // HasK returns a boolean if a field has been set. func (o *JsonWebKey) HasK() bool { - if o != nil && o.K != nil { + if o != nil && !IsNil(o.K) { return true } @@ -328,7 +335,7 @@ func (o *JsonWebKey) SetKty(v string) { // GetN returns the N field value if set, zero value otherwise. func (o *JsonWebKey) GetN() string { - if o == nil || o.N == nil { + if o == nil || IsNil(o.N) { var ret string return ret } @@ -338,7 +345,7 @@ func (o *JsonWebKey) GetN() string { // GetNOk returns a tuple with the N field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetNOk() (*string, bool) { - if o == nil || o.N == nil { + if o == nil || IsNil(o.N) { return nil, false } return o.N, true @@ -346,7 +353,7 @@ func (o *JsonWebKey) GetNOk() (*string, bool) { // HasN returns a boolean if a field has been set. func (o *JsonWebKey) HasN() bool { - if o != nil && o.N != nil { + if o != nil && !IsNil(o.N) { return true } @@ -360,7 +367,7 @@ func (o *JsonWebKey) SetN(v string) { // GetP returns the P field value if set, zero value otherwise. func (o *JsonWebKey) GetP() string { - if o == nil || o.P == nil { + if o == nil || IsNil(o.P) { var ret string return ret } @@ -370,7 +377,7 @@ func (o *JsonWebKey) GetP() string { // GetPOk returns a tuple with the P field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetPOk() (*string, bool) { - if o == nil || o.P == nil { + if o == nil || IsNil(o.P) { return nil, false } return o.P, true @@ -378,7 +385,7 @@ func (o *JsonWebKey) GetPOk() (*string, bool) { // HasP returns a boolean if a field has been set. func (o *JsonWebKey) HasP() bool { - if o != nil && o.P != nil { + if o != nil && !IsNil(o.P) { return true } @@ -392,7 +399,7 @@ func (o *JsonWebKey) SetP(v string) { // GetQ returns the Q field value if set, zero value otherwise. func (o *JsonWebKey) GetQ() string { - if o == nil || o.Q == nil { + if o == nil || IsNil(o.Q) { var ret string return ret } @@ -402,7 +409,7 @@ func (o *JsonWebKey) GetQ() string { // GetQOk returns a tuple with the Q field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetQOk() (*string, bool) { - if o == nil || o.Q == nil { + if o == nil || IsNil(o.Q) { return nil, false } return o.Q, true @@ -410,7 +417,7 @@ func (o *JsonWebKey) GetQOk() (*string, bool) { // HasQ returns a boolean if a field has been set. func (o *JsonWebKey) HasQ() bool { - if o != nil && o.Q != nil { + if o != nil && !IsNil(o.Q) { return true } @@ -424,7 +431,7 @@ func (o *JsonWebKey) SetQ(v string) { // GetQi returns the Qi field value if set, zero value otherwise. func (o *JsonWebKey) GetQi() string { - if o == nil || o.Qi == nil { + if o == nil || IsNil(o.Qi) { var ret string return ret } @@ -434,7 +441,7 @@ func (o *JsonWebKey) GetQi() string { // GetQiOk returns a tuple with the Qi field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetQiOk() (*string, bool) { - if o == nil || o.Qi == nil { + if o == nil || IsNil(o.Qi) { return nil, false } return o.Qi, true @@ -442,7 +449,7 @@ func (o *JsonWebKey) GetQiOk() (*string, bool) { // HasQi returns a boolean if a field has been set. func (o *JsonWebKey) HasQi() bool { - if o != nil && o.Qi != nil { + if o != nil && !IsNil(o.Qi) { return true } @@ -480,7 +487,7 @@ func (o *JsonWebKey) SetUse(v string) { // GetX returns the X field value if set, zero value otherwise. func (o *JsonWebKey) GetX() string { - if o == nil || o.X == nil { + if o == nil || IsNil(o.X) { var ret string return ret } @@ -490,7 +497,7 @@ func (o *JsonWebKey) GetX() string { // GetXOk returns a tuple with the X field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetXOk() (*string, bool) { - if o == nil || o.X == nil { + if o == nil || IsNil(o.X) { return nil, false } return o.X, true @@ -498,7 +505,7 @@ func (o *JsonWebKey) GetXOk() (*string, bool) { // HasX returns a boolean if a field has been set. func (o *JsonWebKey) HasX() bool { - if o != nil && o.X != nil { + if o != nil && !IsNil(o.X) { return true } @@ -512,7 +519,7 @@ func (o *JsonWebKey) SetX(v string) { // GetX5c returns the X5c field value if set, zero value otherwise. func (o *JsonWebKey) GetX5c() []string { - if o == nil || o.X5c == nil { + if o == nil || IsNil(o.X5c) { var ret []string return ret } @@ -522,7 +529,7 @@ func (o *JsonWebKey) GetX5c() []string { // GetX5cOk returns a tuple with the X5c field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetX5cOk() ([]string, bool) { - if o == nil || o.X5c == nil { + if o == nil || IsNil(o.X5c) { return nil, false } return o.X5c, true @@ -530,7 +537,7 @@ func (o *JsonWebKey) GetX5cOk() ([]string, bool) { // HasX5c returns a boolean if a field has been set. func (o *JsonWebKey) HasX5c() bool { - if o != nil && o.X5c != nil { + if o != nil && !IsNil(o.X5c) { return true } @@ -544,7 +551,7 @@ func (o *JsonWebKey) SetX5c(v []string) { // GetY returns the Y field value if set, zero value otherwise. func (o *JsonWebKey) GetY() string { - if o == nil || o.Y == nil { + if o == nil || IsNil(o.Y) { var ret string return ret } @@ -554,7 +561,7 @@ func (o *JsonWebKey) GetY() string { // GetYOk returns a tuple with the Y field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKey) GetYOk() (*string, bool) { - if o == nil || o.Y == nil { + if o == nil || IsNil(o.Y) { return nil, false } return o.Y, true @@ -562,7 +569,7 @@ func (o *JsonWebKey) GetYOk() (*string, bool) { // HasY returns a boolean if a field has been set. func (o *JsonWebKey) HasY() bool { - if o != nil && o.Y != nil { + if o != nil && !IsNil(o.Y) { return true } @@ -575,59 +582,99 @@ func (o *JsonWebKey) SetY(v string) { } func (o JsonWebKey) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["alg"] = o.Alg + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Crv != nil { + return json.Marshal(toSerialize) +} + +func (o JsonWebKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["alg"] = o.Alg + if !IsNil(o.Crv) { toSerialize["crv"] = o.Crv } - if o.D != nil { + if !IsNil(o.D) { toSerialize["d"] = o.D } - if o.Dp != nil { + if !IsNil(o.Dp) { toSerialize["dp"] = o.Dp } - if o.Dq != nil { + if !IsNil(o.Dq) { toSerialize["dq"] = o.Dq } - if o.E != nil { + if !IsNil(o.E) { toSerialize["e"] = o.E } - if o.K != nil { + if !IsNil(o.K) { toSerialize["k"] = o.K } - if true { - toSerialize["kid"] = o.Kid - } - if true { - toSerialize["kty"] = o.Kty - } - if o.N != nil { + toSerialize["kid"] = o.Kid + toSerialize["kty"] = o.Kty + if !IsNil(o.N) { toSerialize["n"] = o.N } - if o.P != nil { + if !IsNil(o.P) { toSerialize["p"] = o.P } - if o.Q != nil { + if !IsNil(o.Q) { toSerialize["q"] = o.Q } - if o.Qi != nil { + if !IsNil(o.Qi) { toSerialize["qi"] = o.Qi } - if true { - toSerialize["use"] = o.Use - } - if o.X != nil { + toSerialize["use"] = o.Use + if !IsNil(o.X) { toSerialize["x"] = o.X } - if o.X5c != nil { + if !IsNil(o.X5c) { toSerialize["x5c"] = o.X5c } - if o.Y != nil { + if !IsNil(o.Y) { toSerialize["y"] = o.Y } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *JsonWebKey) UnmarshalJSON(data []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{ + "alg", + "kid", + "kty", + "use", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &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) + } + } + + varJsonWebKey := _JsonWebKey{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varJsonWebKey) + + if err != nil { + return err + } + + *o = JsonWebKey(varJsonWebKey) + + return err } type NullableJsonWebKey struct { diff --git a/internal/httpclient/model_json_web_key_set.go b/internal/httpclient/model_json_web_key_set.go index 6d328f6615d..28820351167 100644 --- a/internal/httpclient/model_json_web_key_set.go +++ b/internal/httpclient/model_json_web_key_set.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the JsonWebKeySet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JsonWebKeySet{} + // JsonWebKeySet JSON Web Key Set type JsonWebKeySet struct { // 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. @@ -40,7 +43,7 @@ func NewJsonWebKeySetWithDefaults() *JsonWebKeySet { // GetKeys returns the Keys field value if set, zero value otherwise. func (o *JsonWebKeySet) GetKeys() []JsonWebKey { - if o == nil || o.Keys == nil { + if o == nil || IsNil(o.Keys) { var ret []JsonWebKey return ret } @@ -50,7 +53,7 @@ func (o *JsonWebKeySet) GetKeys() []JsonWebKey { // GetKeysOk returns a tuple with the Keys field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *JsonWebKeySet) GetKeysOk() ([]JsonWebKey, bool) { - if o == nil || o.Keys == nil { + if o == nil || IsNil(o.Keys) { return nil, false } return o.Keys, true @@ -58,7 +61,7 @@ func (o *JsonWebKeySet) GetKeysOk() ([]JsonWebKey, bool) { // HasKeys returns a boolean if a field has been set. func (o *JsonWebKeySet) HasKeys() bool { - if o != nil && o.Keys != nil { + if o != nil && !IsNil(o.Keys) { return true } @@ -71,11 +74,19 @@ func (o *JsonWebKeySet) SetKeys(v []JsonWebKey) { } func (o JsonWebKeySet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JsonWebKeySet) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Keys != nil { + if !IsNil(o.Keys) { toSerialize["keys"] = o.Keys } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableJsonWebKeySet struct { diff --git a/internal/httpclient/model_o_auth2_client.go b/internal/httpclient/model_o_auth2_client.go index 2d26a45fe7e..738928626ab 100644 --- a/internal/httpclient/model_o_auth2_client.go +++ b/internal/httpclient/model_o_auth2_client.go @@ -16,6 +16,9 @@ import ( "time" ) +// checks if the OAuth2Client type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2Client{} + // OAuth2Client 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. type OAuth2Client struct { // 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`. @@ -128,7 +131,7 @@ func NewOAuth2ClientWithDefaults() *OAuth2Client { // GetAccessTokenStrategy returns the AccessTokenStrategy field value if set, zero value otherwise. func (o *OAuth2Client) GetAccessTokenStrategy() string { - if o == nil || o.AccessTokenStrategy == nil { + if o == nil || IsNil(o.AccessTokenStrategy) { var ret string return ret } @@ -138,7 +141,7 @@ func (o *OAuth2Client) GetAccessTokenStrategy() string { // GetAccessTokenStrategyOk returns a tuple with the AccessTokenStrategy field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetAccessTokenStrategyOk() (*string, bool) { - if o == nil || o.AccessTokenStrategy == nil { + if o == nil || IsNil(o.AccessTokenStrategy) { return nil, false } return o.AccessTokenStrategy, true @@ -146,7 +149,7 @@ func (o *OAuth2Client) GetAccessTokenStrategyOk() (*string, bool) { // HasAccessTokenStrategy returns a boolean if a field has been set. func (o *OAuth2Client) HasAccessTokenStrategy() bool { - if o != nil && o.AccessTokenStrategy != nil { + if o != nil && !IsNil(o.AccessTokenStrategy) { return true } @@ -160,7 +163,7 @@ func (o *OAuth2Client) SetAccessTokenStrategy(v string) { // GetAllowedCorsOrigins returns the AllowedCorsOrigins field value if set, zero value otherwise. func (o *OAuth2Client) GetAllowedCorsOrigins() []string { - if o == nil || o.AllowedCorsOrigins == nil { + if o == nil || IsNil(o.AllowedCorsOrigins) { var ret []string return ret } @@ -170,7 +173,7 @@ func (o *OAuth2Client) GetAllowedCorsOrigins() []string { // GetAllowedCorsOriginsOk returns a tuple with the AllowedCorsOrigins field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetAllowedCorsOriginsOk() ([]string, bool) { - if o == nil || o.AllowedCorsOrigins == nil { + if o == nil || IsNil(o.AllowedCorsOrigins) { return nil, false } return o.AllowedCorsOrigins, true @@ -178,7 +181,7 @@ func (o *OAuth2Client) GetAllowedCorsOriginsOk() ([]string, bool) { // HasAllowedCorsOrigins returns a boolean if a field has been set. func (o *OAuth2Client) HasAllowedCorsOrigins() bool { - if o != nil && o.AllowedCorsOrigins != nil { + if o != nil && !IsNil(o.AllowedCorsOrigins) { return true } @@ -192,7 +195,7 @@ func (o *OAuth2Client) SetAllowedCorsOrigins(v []string) { // GetAudience returns the Audience field value if set, zero value otherwise. func (o *OAuth2Client) GetAudience() []string { - if o == nil || o.Audience == nil { + if o == nil || IsNil(o.Audience) { var ret []string return ret } @@ -202,7 +205,7 @@ func (o *OAuth2Client) GetAudience() []string { // GetAudienceOk returns a tuple with the Audience field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetAudienceOk() ([]string, bool) { - if o == nil || o.Audience == nil { + if o == nil || IsNil(o.Audience) { return nil, false } return o.Audience, true @@ -210,7 +213,7 @@ func (o *OAuth2Client) GetAudienceOk() ([]string, bool) { // HasAudience returns a boolean if a field has been set. func (o *OAuth2Client) HasAudience() bool { - if o != nil && o.Audience != nil { + if o != nil && !IsNil(o.Audience) { return true } @@ -224,7 +227,7 @@ func (o *OAuth2Client) SetAudience(v []string) { // GetAuthorizationCodeGrantAccessTokenLifespan returns the AuthorizationCodeGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetAuthorizationCodeGrantAccessTokenLifespan() string { - if o == nil || o.AuthorizationCodeGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { var ret string return ret } @@ -234,7 +237,7 @@ func (o *OAuth2Client) GetAuthorizationCodeGrantAccessTokenLifespan() string { // GetAuthorizationCodeGrantAccessTokenLifespanOk returns a tuple with the AuthorizationCodeGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetAuthorizationCodeGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.AuthorizationCodeGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { return nil, false } return o.AuthorizationCodeGrantAccessTokenLifespan, true @@ -242,7 +245,7 @@ func (o *OAuth2Client) GetAuthorizationCodeGrantAccessTokenLifespanOk() (*string // HasAuthorizationCodeGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasAuthorizationCodeGrantAccessTokenLifespan() bool { - if o != nil && o.AuthorizationCodeGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { return true } @@ -256,7 +259,7 @@ func (o *OAuth2Client) SetAuthorizationCodeGrantAccessTokenLifespan(v string) { // GetAuthorizationCodeGrantIdTokenLifespan returns the AuthorizationCodeGrantIdTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetAuthorizationCodeGrantIdTokenLifespan() string { - if o == nil || o.AuthorizationCodeGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { var ret string return ret } @@ -266,7 +269,7 @@ func (o *OAuth2Client) GetAuthorizationCodeGrantIdTokenLifespan() string { // GetAuthorizationCodeGrantIdTokenLifespanOk returns a tuple with the AuthorizationCodeGrantIdTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetAuthorizationCodeGrantIdTokenLifespanOk() (*string, bool) { - if o == nil || o.AuthorizationCodeGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { return nil, false } return o.AuthorizationCodeGrantIdTokenLifespan, true @@ -274,7 +277,7 @@ func (o *OAuth2Client) GetAuthorizationCodeGrantIdTokenLifespanOk() (*string, bo // HasAuthorizationCodeGrantIdTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasAuthorizationCodeGrantIdTokenLifespan() bool { - if o != nil && o.AuthorizationCodeGrantIdTokenLifespan != nil { + if o != nil && !IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { return true } @@ -288,7 +291,7 @@ func (o *OAuth2Client) SetAuthorizationCodeGrantIdTokenLifespan(v string) { // GetAuthorizationCodeGrantRefreshTokenLifespan returns the AuthorizationCodeGrantRefreshTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetAuthorizationCodeGrantRefreshTokenLifespan() string { - if o == nil || o.AuthorizationCodeGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { var ret string return ret } @@ -298,7 +301,7 @@ func (o *OAuth2Client) GetAuthorizationCodeGrantRefreshTokenLifespan() string { // GetAuthorizationCodeGrantRefreshTokenLifespanOk returns a tuple with the AuthorizationCodeGrantRefreshTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetAuthorizationCodeGrantRefreshTokenLifespanOk() (*string, bool) { - if o == nil || o.AuthorizationCodeGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { return nil, false } return o.AuthorizationCodeGrantRefreshTokenLifespan, true @@ -306,7 +309,7 @@ func (o *OAuth2Client) GetAuthorizationCodeGrantRefreshTokenLifespanOk() (*strin // HasAuthorizationCodeGrantRefreshTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasAuthorizationCodeGrantRefreshTokenLifespan() bool { - if o != nil && o.AuthorizationCodeGrantRefreshTokenLifespan != nil { + if o != nil && !IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { return true } @@ -320,7 +323,7 @@ func (o *OAuth2Client) SetAuthorizationCodeGrantRefreshTokenLifespan(v string) { // GetBackchannelLogoutSessionRequired returns the BackchannelLogoutSessionRequired field value if set, zero value otherwise. func (o *OAuth2Client) GetBackchannelLogoutSessionRequired() bool { - if o == nil || o.BackchannelLogoutSessionRequired == nil { + if o == nil || IsNil(o.BackchannelLogoutSessionRequired) { var ret bool return ret } @@ -330,7 +333,7 @@ func (o *OAuth2Client) GetBackchannelLogoutSessionRequired() bool { // GetBackchannelLogoutSessionRequiredOk returns a tuple with the BackchannelLogoutSessionRequired field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetBackchannelLogoutSessionRequiredOk() (*bool, bool) { - if o == nil || o.BackchannelLogoutSessionRequired == nil { + if o == nil || IsNil(o.BackchannelLogoutSessionRequired) { return nil, false } return o.BackchannelLogoutSessionRequired, true @@ -338,7 +341,7 @@ func (o *OAuth2Client) GetBackchannelLogoutSessionRequiredOk() (*bool, bool) { // HasBackchannelLogoutSessionRequired returns a boolean if a field has been set. func (o *OAuth2Client) HasBackchannelLogoutSessionRequired() bool { - if o != nil && o.BackchannelLogoutSessionRequired != nil { + if o != nil && !IsNil(o.BackchannelLogoutSessionRequired) { return true } @@ -352,7 +355,7 @@ func (o *OAuth2Client) SetBackchannelLogoutSessionRequired(v bool) { // GetBackchannelLogoutUri returns the BackchannelLogoutUri field value if set, zero value otherwise. func (o *OAuth2Client) GetBackchannelLogoutUri() string { - if o == nil || o.BackchannelLogoutUri == nil { + if o == nil || IsNil(o.BackchannelLogoutUri) { var ret string return ret } @@ -362,7 +365,7 @@ func (o *OAuth2Client) GetBackchannelLogoutUri() string { // GetBackchannelLogoutUriOk returns a tuple with the BackchannelLogoutUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetBackchannelLogoutUriOk() (*string, bool) { - if o == nil || o.BackchannelLogoutUri == nil { + if o == nil || IsNil(o.BackchannelLogoutUri) { return nil, false } return o.BackchannelLogoutUri, true @@ -370,7 +373,7 @@ func (o *OAuth2Client) GetBackchannelLogoutUriOk() (*string, bool) { // HasBackchannelLogoutUri returns a boolean if a field has been set. func (o *OAuth2Client) HasBackchannelLogoutUri() bool { - if o != nil && o.BackchannelLogoutUri != nil { + if o != nil && !IsNil(o.BackchannelLogoutUri) { return true } @@ -384,7 +387,7 @@ func (o *OAuth2Client) SetBackchannelLogoutUri(v string) { // GetClientCredentialsGrantAccessTokenLifespan returns the ClientCredentialsGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetClientCredentialsGrantAccessTokenLifespan() string { - if o == nil || o.ClientCredentialsGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { var ret string return ret } @@ -394,7 +397,7 @@ func (o *OAuth2Client) GetClientCredentialsGrantAccessTokenLifespan() string { // GetClientCredentialsGrantAccessTokenLifespanOk returns a tuple with the ClientCredentialsGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetClientCredentialsGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.ClientCredentialsGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { return nil, false } return o.ClientCredentialsGrantAccessTokenLifespan, true @@ -402,7 +405,7 @@ func (o *OAuth2Client) GetClientCredentialsGrantAccessTokenLifespanOk() (*string // HasClientCredentialsGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasClientCredentialsGrantAccessTokenLifespan() bool { - if o != nil && o.ClientCredentialsGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { return true } @@ -416,7 +419,7 @@ func (o *OAuth2Client) SetClientCredentialsGrantAccessTokenLifespan(v string) { // GetClientId returns the ClientId field value if set, zero value otherwise. func (o *OAuth2Client) GetClientId() string { - if o == nil || o.ClientId == nil { + if o == nil || IsNil(o.ClientId) { var ret string return ret } @@ -426,7 +429,7 @@ func (o *OAuth2Client) GetClientId() string { // GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetClientIdOk() (*string, bool) { - if o == nil || o.ClientId == nil { + if o == nil || IsNil(o.ClientId) { return nil, false } return o.ClientId, true @@ -434,7 +437,7 @@ func (o *OAuth2Client) GetClientIdOk() (*string, bool) { // HasClientId returns a boolean if a field has been set. func (o *OAuth2Client) HasClientId() bool { - if o != nil && o.ClientId != nil { + if o != nil && !IsNil(o.ClientId) { return true } @@ -448,7 +451,7 @@ func (o *OAuth2Client) SetClientId(v string) { // GetClientName returns the ClientName field value if set, zero value otherwise. func (o *OAuth2Client) GetClientName() string { - if o == nil || o.ClientName == nil { + if o == nil || IsNil(o.ClientName) { var ret string return ret } @@ -458,7 +461,7 @@ func (o *OAuth2Client) GetClientName() string { // GetClientNameOk returns a tuple with the ClientName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetClientNameOk() (*string, bool) { - if o == nil || o.ClientName == nil { + if o == nil || IsNil(o.ClientName) { return nil, false } return o.ClientName, true @@ -466,7 +469,7 @@ func (o *OAuth2Client) GetClientNameOk() (*string, bool) { // HasClientName returns a boolean if a field has been set. func (o *OAuth2Client) HasClientName() bool { - if o != nil && o.ClientName != nil { + if o != nil && !IsNil(o.ClientName) { return true } @@ -480,7 +483,7 @@ func (o *OAuth2Client) SetClientName(v string) { // GetClientSecret returns the ClientSecret field value if set, zero value otherwise. func (o *OAuth2Client) GetClientSecret() string { - if o == nil || o.ClientSecret == nil { + if o == nil || IsNil(o.ClientSecret) { var ret string return ret } @@ -490,7 +493,7 @@ func (o *OAuth2Client) GetClientSecret() string { // GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetClientSecretOk() (*string, bool) { - if o == nil || o.ClientSecret == nil { + if o == nil || IsNil(o.ClientSecret) { return nil, false } return o.ClientSecret, true @@ -498,7 +501,7 @@ func (o *OAuth2Client) GetClientSecretOk() (*string, bool) { // HasClientSecret returns a boolean if a field has been set. func (o *OAuth2Client) HasClientSecret() bool { - if o != nil && o.ClientSecret != nil { + if o != nil && !IsNil(o.ClientSecret) { return true } @@ -512,7 +515,7 @@ func (o *OAuth2Client) SetClientSecret(v string) { // GetClientSecretExpiresAt returns the ClientSecretExpiresAt field value if set, zero value otherwise. func (o *OAuth2Client) GetClientSecretExpiresAt() int64 { - if o == nil || o.ClientSecretExpiresAt == nil { + if o == nil || IsNil(o.ClientSecretExpiresAt) { var ret int64 return ret } @@ -522,7 +525,7 @@ func (o *OAuth2Client) GetClientSecretExpiresAt() int64 { // GetClientSecretExpiresAtOk returns a tuple with the ClientSecretExpiresAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetClientSecretExpiresAtOk() (*int64, bool) { - if o == nil || o.ClientSecretExpiresAt == nil { + if o == nil || IsNil(o.ClientSecretExpiresAt) { return nil, false } return o.ClientSecretExpiresAt, true @@ -530,7 +533,7 @@ func (o *OAuth2Client) GetClientSecretExpiresAtOk() (*int64, bool) { // HasClientSecretExpiresAt returns a boolean if a field has been set. func (o *OAuth2Client) HasClientSecretExpiresAt() bool { - if o != nil && o.ClientSecretExpiresAt != nil { + if o != nil && !IsNil(o.ClientSecretExpiresAt) { return true } @@ -544,7 +547,7 @@ func (o *OAuth2Client) SetClientSecretExpiresAt(v int64) { // GetClientUri returns the ClientUri field value if set, zero value otherwise. func (o *OAuth2Client) GetClientUri() string { - if o == nil || o.ClientUri == nil { + if o == nil || IsNil(o.ClientUri) { var ret string return ret } @@ -554,7 +557,7 @@ func (o *OAuth2Client) GetClientUri() string { // GetClientUriOk returns a tuple with the ClientUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetClientUriOk() (*string, bool) { - if o == nil || o.ClientUri == nil { + if o == nil || IsNil(o.ClientUri) { return nil, false } return o.ClientUri, true @@ -562,7 +565,7 @@ func (o *OAuth2Client) GetClientUriOk() (*string, bool) { // HasClientUri returns a boolean if a field has been set. func (o *OAuth2Client) HasClientUri() bool { - if o != nil && o.ClientUri != nil { + if o != nil && !IsNil(o.ClientUri) { return true } @@ -576,7 +579,7 @@ func (o *OAuth2Client) SetClientUri(v string) { // GetContacts returns the Contacts field value if set, zero value otherwise. func (o *OAuth2Client) GetContacts() []string { - if o == nil || o.Contacts == nil { + if o == nil || IsNil(o.Contacts) { var ret []string return ret } @@ -586,7 +589,7 @@ func (o *OAuth2Client) GetContacts() []string { // GetContactsOk returns a tuple with the Contacts field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetContactsOk() ([]string, bool) { - if o == nil || o.Contacts == nil { + if o == nil || IsNil(o.Contacts) { return nil, false } return o.Contacts, true @@ -594,7 +597,7 @@ func (o *OAuth2Client) GetContactsOk() ([]string, bool) { // HasContacts returns a boolean if a field has been set. func (o *OAuth2Client) HasContacts() bool { - if o != nil && o.Contacts != nil { + if o != nil && !IsNil(o.Contacts) { return true } @@ -608,7 +611,7 @@ func (o *OAuth2Client) SetContacts(v []string) { // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *OAuth2Client) GetCreatedAt() time.Time { - if o == nil || o.CreatedAt == nil { + if o == nil || IsNil(o.CreatedAt) { var ret time.Time return ret } @@ -618,7 +621,7 @@ func (o *OAuth2Client) 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 *OAuth2Client) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || o.CreatedAt == nil { + if o == nil || IsNil(o.CreatedAt) { return nil, false } return o.CreatedAt, true @@ -626,7 +629,7 @@ func (o *OAuth2Client) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *OAuth2Client) HasCreatedAt() bool { - if o != nil && o.CreatedAt != nil { + if o != nil && !IsNil(o.CreatedAt) { return true } @@ -640,7 +643,7 @@ func (o *OAuth2Client) SetCreatedAt(v time.Time) { // GetFrontchannelLogoutSessionRequired returns the FrontchannelLogoutSessionRequired field value if set, zero value otherwise. func (o *OAuth2Client) GetFrontchannelLogoutSessionRequired() bool { - if o == nil || o.FrontchannelLogoutSessionRequired == nil { + if o == nil || IsNil(o.FrontchannelLogoutSessionRequired) { var ret bool return ret } @@ -650,7 +653,7 @@ func (o *OAuth2Client) GetFrontchannelLogoutSessionRequired() bool { // GetFrontchannelLogoutSessionRequiredOk returns a tuple with the FrontchannelLogoutSessionRequired field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetFrontchannelLogoutSessionRequiredOk() (*bool, bool) { - if o == nil || o.FrontchannelLogoutSessionRequired == nil { + if o == nil || IsNil(o.FrontchannelLogoutSessionRequired) { return nil, false } return o.FrontchannelLogoutSessionRequired, true @@ -658,7 +661,7 @@ func (o *OAuth2Client) GetFrontchannelLogoutSessionRequiredOk() (*bool, bool) { // HasFrontchannelLogoutSessionRequired returns a boolean if a field has been set. func (o *OAuth2Client) HasFrontchannelLogoutSessionRequired() bool { - if o != nil && o.FrontchannelLogoutSessionRequired != nil { + if o != nil && !IsNil(o.FrontchannelLogoutSessionRequired) { return true } @@ -672,7 +675,7 @@ func (o *OAuth2Client) SetFrontchannelLogoutSessionRequired(v bool) { // GetFrontchannelLogoutUri returns the FrontchannelLogoutUri field value if set, zero value otherwise. func (o *OAuth2Client) GetFrontchannelLogoutUri() string { - if o == nil || o.FrontchannelLogoutUri == nil { + if o == nil || IsNil(o.FrontchannelLogoutUri) { var ret string return ret } @@ -682,7 +685,7 @@ func (o *OAuth2Client) GetFrontchannelLogoutUri() string { // GetFrontchannelLogoutUriOk returns a tuple with the FrontchannelLogoutUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetFrontchannelLogoutUriOk() (*string, bool) { - if o == nil || o.FrontchannelLogoutUri == nil { + if o == nil || IsNil(o.FrontchannelLogoutUri) { return nil, false } return o.FrontchannelLogoutUri, true @@ -690,7 +693,7 @@ func (o *OAuth2Client) GetFrontchannelLogoutUriOk() (*string, bool) { // HasFrontchannelLogoutUri returns a boolean if a field has been set. func (o *OAuth2Client) HasFrontchannelLogoutUri() bool { - if o != nil && o.FrontchannelLogoutUri != nil { + if o != nil && !IsNil(o.FrontchannelLogoutUri) { return true } @@ -704,7 +707,7 @@ func (o *OAuth2Client) SetFrontchannelLogoutUri(v string) { // GetGrantTypes returns the GrantTypes field value if set, zero value otherwise. func (o *OAuth2Client) GetGrantTypes() []string { - if o == nil || o.GrantTypes == nil { + if o == nil || IsNil(o.GrantTypes) { var ret []string return ret } @@ -714,7 +717,7 @@ func (o *OAuth2Client) GetGrantTypes() []string { // GetGrantTypesOk returns a tuple with the GrantTypes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetGrantTypesOk() ([]string, bool) { - if o == nil || o.GrantTypes == nil { + if o == nil || IsNil(o.GrantTypes) { return nil, false } return o.GrantTypes, true @@ -722,7 +725,7 @@ func (o *OAuth2Client) GetGrantTypesOk() ([]string, bool) { // HasGrantTypes returns a boolean if a field has been set. func (o *OAuth2Client) HasGrantTypes() bool { - if o != nil && o.GrantTypes != nil { + if o != nil && !IsNil(o.GrantTypes) { return true } @@ -736,7 +739,7 @@ func (o *OAuth2Client) SetGrantTypes(v []string) { // GetImplicitGrantAccessTokenLifespan returns the ImplicitGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetImplicitGrantAccessTokenLifespan() string { - if o == nil || o.ImplicitGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantAccessTokenLifespan) { var ret string return ret } @@ -746,7 +749,7 @@ func (o *OAuth2Client) GetImplicitGrantAccessTokenLifespan() string { // GetImplicitGrantAccessTokenLifespanOk returns a tuple with the ImplicitGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetImplicitGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.ImplicitGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantAccessTokenLifespan) { return nil, false } return o.ImplicitGrantAccessTokenLifespan, true @@ -754,7 +757,7 @@ func (o *OAuth2Client) GetImplicitGrantAccessTokenLifespanOk() (*string, bool) { // HasImplicitGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasImplicitGrantAccessTokenLifespan() bool { - if o != nil && o.ImplicitGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.ImplicitGrantAccessTokenLifespan) { return true } @@ -768,7 +771,7 @@ func (o *OAuth2Client) SetImplicitGrantAccessTokenLifespan(v string) { // GetImplicitGrantIdTokenLifespan returns the ImplicitGrantIdTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetImplicitGrantIdTokenLifespan() string { - if o == nil || o.ImplicitGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantIdTokenLifespan) { var ret string return ret } @@ -778,7 +781,7 @@ func (o *OAuth2Client) GetImplicitGrantIdTokenLifespan() string { // GetImplicitGrantIdTokenLifespanOk returns a tuple with the ImplicitGrantIdTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetImplicitGrantIdTokenLifespanOk() (*string, bool) { - if o == nil || o.ImplicitGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantIdTokenLifespan) { return nil, false } return o.ImplicitGrantIdTokenLifespan, true @@ -786,7 +789,7 @@ func (o *OAuth2Client) GetImplicitGrantIdTokenLifespanOk() (*string, bool) { // HasImplicitGrantIdTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasImplicitGrantIdTokenLifespan() bool { - if o != nil && o.ImplicitGrantIdTokenLifespan != nil { + if o != nil && !IsNil(o.ImplicitGrantIdTokenLifespan) { return true } @@ -811,7 +814,7 @@ func (o *OAuth2Client) GetJwks() interface{} { // 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 *OAuth2Client) GetJwksOk() (*interface{}, bool) { - if o == nil || o.Jwks == nil { + if o == nil || IsNil(o.Jwks) { return nil, false } return &o.Jwks, true @@ -819,7 +822,7 @@ func (o *OAuth2Client) GetJwksOk() (*interface{}, bool) { // HasJwks returns a boolean if a field has been set. func (o *OAuth2Client) HasJwks() bool { - if o != nil && o.Jwks != nil { + if o != nil && IsNil(o.Jwks) { return true } @@ -833,7 +836,7 @@ func (o *OAuth2Client) SetJwks(v interface{}) { // GetJwksUri returns the JwksUri field value if set, zero value otherwise. func (o *OAuth2Client) GetJwksUri() string { - if o == nil || o.JwksUri == nil { + if o == nil || IsNil(o.JwksUri) { var ret string return ret } @@ -843,7 +846,7 @@ func (o *OAuth2Client) GetJwksUri() string { // GetJwksUriOk returns a tuple with the JwksUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetJwksUriOk() (*string, bool) { - if o == nil || o.JwksUri == nil { + if o == nil || IsNil(o.JwksUri) { return nil, false } return o.JwksUri, true @@ -851,7 +854,7 @@ func (o *OAuth2Client) GetJwksUriOk() (*string, bool) { // HasJwksUri returns a boolean if a field has been set. func (o *OAuth2Client) HasJwksUri() bool { - if o != nil && o.JwksUri != nil { + if o != nil && !IsNil(o.JwksUri) { return true } @@ -865,7 +868,7 @@ func (o *OAuth2Client) SetJwksUri(v string) { // GetJwtBearerGrantAccessTokenLifespan returns the JwtBearerGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetJwtBearerGrantAccessTokenLifespan() string { - if o == nil || o.JwtBearerGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.JwtBearerGrantAccessTokenLifespan) { var ret string return ret } @@ -875,7 +878,7 @@ func (o *OAuth2Client) GetJwtBearerGrantAccessTokenLifespan() string { // GetJwtBearerGrantAccessTokenLifespanOk returns a tuple with the JwtBearerGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetJwtBearerGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.JwtBearerGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.JwtBearerGrantAccessTokenLifespan) { return nil, false } return o.JwtBearerGrantAccessTokenLifespan, true @@ -883,7 +886,7 @@ func (o *OAuth2Client) GetJwtBearerGrantAccessTokenLifespanOk() (*string, bool) // HasJwtBearerGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasJwtBearerGrantAccessTokenLifespan() bool { - if o != nil && o.JwtBearerGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.JwtBearerGrantAccessTokenLifespan) { return true } @@ -897,7 +900,7 @@ func (o *OAuth2Client) SetJwtBearerGrantAccessTokenLifespan(v string) { // GetLogoUri returns the LogoUri field value if set, zero value otherwise. func (o *OAuth2Client) GetLogoUri() string { - if o == nil || o.LogoUri == nil { + if o == nil || IsNil(o.LogoUri) { var ret string return ret } @@ -907,7 +910,7 @@ func (o *OAuth2Client) GetLogoUri() string { // GetLogoUriOk returns a tuple with the LogoUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetLogoUriOk() (*string, bool) { - if o == nil || o.LogoUri == nil { + if o == nil || IsNil(o.LogoUri) { return nil, false } return o.LogoUri, true @@ -915,7 +918,7 @@ func (o *OAuth2Client) GetLogoUriOk() (*string, bool) { // HasLogoUri returns a boolean if a field has been set. func (o *OAuth2Client) HasLogoUri() bool { - if o != nil && o.LogoUri != nil { + if o != nil && !IsNil(o.LogoUri) { return true } @@ -940,7 +943,7 @@ func (o *OAuth2Client) GetMetadata() interface{} { // 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 *OAuth2Client) GetMetadataOk() (*interface{}, bool) { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } return &o.Metadata, true @@ -948,7 +951,7 @@ func (o *OAuth2Client) GetMetadataOk() (*interface{}, bool) { // HasMetadata returns a boolean if a field has been set. func (o *OAuth2Client) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && IsNil(o.Metadata) { return true } @@ -962,7 +965,7 @@ func (o *OAuth2Client) SetMetadata(v interface{}) { // GetOwner returns the Owner field value if set, zero value otherwise. func (o *OAuth2Client) GetOwner() string { - if o == nil || o.Owner == nil { + if o == nil || IsNil(o.Owner) { var ret string return ret } @@ -972,7 +975,7 @@ func (o *OAuth2Client) GetOwner() string { // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetOwnerOk() (*string, bool) { - if o == nil || o.Owner == nil { + if o == nil || IsNil(o.Owner) { return nil, false } return o.Owner, true @@ -980,7 +983,7 @@ func (o *OAuth2Client) GetOwnerOk() (*string, bool) { // HasOwner returns a boolean if a field has been set. func (o *OAuth2Client) HasOwner() bool { - if o != nil && o.Owner != nil { + if o != nil && !IsNil(o.Owner) { return true } @@ -994,7 +997,7 @@ func (o *OAuth2Client) SetOwner(v string) { // GetPolicyUri returns the PolicyUri field value if set, zero value otherwise. func (o *OAuth2Client) GetPolicyUri() string { - if o == nil || o.PolicyUri == nil { + if o == nil || IsNil(o.PolicyUri) { var ret string return ret } @@ -1004,7 +1007,7 @@ func (o *OAuth2Client) GetPolicyUri() string { // GetPolicyUriOk returns a tuple with the PolicyUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetPolicyUriOk() (*string, bool) { - if o == nil || o.PolicyUri == nil { + if o == nil || IsNil(o.PolicyUri) { return nil, false } return o.PolicyUri, true @@ -1012,7 +1015,7 @@ func (o *OAuth2Client) GetPolicyUriOk() (*string, bool) { // HasPolicyUri returns a boolean if a field has been set. func (o *OAuth2Client) HasPolicyUri() bool { - if o != nil && o.PolicyUri != nil { + if o != nil && !IsNil(o.PolicyUri) { return true } @@ -1026,7 +1029,7 @@ func (o *OAuth2Client) SetPolicyUri(v string) { // GetPostLogoutRedirectUris returns the PostLogoutRedirectUris field value if set, zero value otherwise. func (o *OAuth2Client) GetPostLogoutRedirectUris() []string { - if o == nil || o.PostLogoutRedirectUris == nil { + if o == nil || IsNil(o.PostLogoutRedirectUris) { var ret []string return ret } @@ -1036,7 +1039,7 @@ func (o *OAuth2Client) GetPostLogoutRedirectUris() []string { // GetPostLogoutRedirectUrisOk returns a tuple with the PostLogoutRedirectUris field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetPostLogoutRedirectUrisOk() ([]string, bool) { - if o == nil || o.PostLogoutRedirectUris == nil { + if o == nil || IsNil(o.PostLogoutRedirectUris) { return nil, false } return o.PostLogoutRedirectUris, true @@ -1044,7 +1047,7 @@ func (o *OAuth2Client) GetPostLogoutRedirectUrisOk() ([]string, bool) { // HasPostLogoutRedirectUris returns a boolean if a field has been set. func (o *OAuth2Client) HasPostLogoutRedirectUris() bool { - if o != nil && o.PostLogoutRedirectUris != nil { + if o != nil && !IsNil(o.PostLogoutRedirectUris) { return true } @@ -1058,7 +1061,7 @@ func (o *OAuth2Client) SetPostLogoutRedirectUris(v []string) { // GetRedirectUris returns the RedirectUris field value if set, zero value otherwise. func (o *OAuth2Client) GetRedirectUris() []string { - if o == nil || o.RedirectUris == nil { + if o == nil || IsNil(o.RedirectUris) { var ret []string return ret } @@ -1068,7 +1071,7 @@ func (o *OAuth2Client) GetRedirectUris() []string { // GetRedirectUrisOk returns a tuple with the RedirectUris field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRedirectUrisOk() ([]string, bool) { - if o == nil || o.RedirectUris == nil { + if o == nil || IsNil(o.RedirectUris) { return nil, false } return o.RedirectUris, true @@ -1076,7 +1079,7 @@ func (o *OAuth2Client) GetRedirectUrisOk() ([]string, bool) { // HasRedirectUris returns a boolean if a field has been set. func (o *OAuth2Client) HasRedirectUris() bool { - if o != nil && o.RedirectUris != nil { + if o != nil && !IsNil(o.RedirectUris) { return true } @@ -1090,7 +1093,7 @@ func (o *OAuth2Client) SetRedirectUris(v []string) { // GetRefreshTokenGrantAccessTokenLifespan returns the RefreshTokenGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetRefreshTokenGrantAccessTokenLifespan() string { - if o == nil || o.RefreshTokenGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantAccessTokenLifespan) { var ret string return ret } @@ -1100,7 +1103,7 @@ func (o *OAuth2Client) GetRefreshTokenGrantAccessTokenLifespan() string { // GetRefreshTokenGrantAccessTokenLifespanOk returns a tuple with the RefreshTokenGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRefreshTokenGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.RefreshTokenGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantAccessTokenLifespan) { return nil, false } return o.RefreshTokenGrantAccessTokenLifespan, true @@ -1108,7 +1111,7 @@ func (o *OAuth2Client) GetRefreshTokenGrantAccessTokenLifespanOk() (*string, boo // HasRefreshTokenGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasRefreshTokenGrantAccessTokenLifespan() bool { - if o != nil && o.RefreshTokenGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.RefreshTokenGrantAccessTokenLifespan) { return true } @@ -1122,7 +1125,7 @@ func (o *OAuth2Client) SetRefreshTokenGrantAccessTokenLifespan(v string) { // GetRefreshTokenGrantIdTokenLifespan returns the RefreshTokenGrantIdTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetRefreshTokenGrantIdTokenLifespan() string { - if o == nil || o.RefreshTokenGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantIdTokenLifespan) { var ret string return ret } @@ -1132,7 +1135,7 @@ func (o *OAuth2Client) GetRefreshTokenGrantIdTokenLifespan() string { // GetRefreshTokenGrantIdTokenLifespanOk returns a tuple with the RefreshTokenGrantIdTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRefreshTokenGrantIdTokenLifespanOk() (*string, bool) { - if o == nil || o.RefreshTokenGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantIdTokenLifespan) { return nil, false } return o.RefreshTokenGrantIdTokenLifespan, true @@ -1140,7 +1143,7 @@ func (o *OAuth2Client) GetRefreshTokenGrantIdTokenLifespanOk() (*string, bool) { // HasRefreshTokenGrantIdTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasRefreshTokenGrantIdTokenLifespan() bool { - if o != nil && o.RefreshTokenGrantIdTokenLifespan != nil { + if o != nil && !IsNil(o.RefreshTokenGrantIdTokenLifespan) { return true } @@ -1154,7 +1157,7 @@ func (o *OAuth2Client) SetRefreshTokenGrantIdTokenLifespan(v string) { // GetRefreshTokenGrantRefreshTokenLifespan returns the RefreshTokenGrantRefreshTokenLifespan field value if set, zero value otherwise. func (o *OAuth2Client) GetRefreshTokenGrantRefreshTokenLifespan() string { - if o == nil || o.RefreshTokenGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { var ret string return ret } @@ -1164,7 +1167,7 @@ func (o *OAuth2Client) GetRefreshTokenGrantRefreshTokenLifespan() string { // GetRefreshTokenGrantRefreshTokenLifespanOk returns a tuple with the RefreshTokenGrantRefreshTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRefreshTokenGrantRefreshTokenLifespanOk() (*string, bool) { - if o == nil || o.RefreshTokenGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { return nil, false } return o.RefreshTokenGrantRefreshTokenLifespan, true @@ -1172,7 +1175,7 @@ func (o *OAuth2Client) GetRefreshTokenGrantRefreshTokenLifespanOk() (*string, bo // HasRefreshTokenGrantRefreshTokenLifespan returns a boolean if a field has been set. func (o *OAuth2Client) HasRefreshTokenGrantRefreshTokenLifespan() bool { - if o != nil && o.RefreshTokenGrantRefreshTokenLifespan != nil { + if o != nil && !IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { return true } @@ -1186,7 +1189,7 @@ func (o *OAuth2Client) SetRefreshTokenGrantRefreshTokenLifespan(v string) { // GetRegistrationAccessToken returns the RegistrationAccessToken field value if set, zero value otherwise. func (o *OAuth2Client) GetRegistrationAccessToken() string { - if o == nil || o.RegistrationAccessToken == nil { + if o == nil || IsNil(o.RegistrationAccessToken) { var ret string return ret } @@ -1196,7 +1199,7 @@ func (o *OAuth2Client) GetRegistrationAccessToken() string { // GetRegistrationAccessTokenOk returns a tuple with the RegistrationAccessToken field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRegistrationAccessTokenOk() (*string, bool) { - if o == nil || o.RegistrationAccessToken == nil { + if o == nil || IsNil(o.RegistrationAccessToken) { return nil, false } return o.RegistrationAccessToken, true @@ -1204,7 +1207,7 @@ func (o *OAuth2Client) GetRegistrationAccessTokenOk() (*string, bool) { // HasRegistrationAccessToken returns a boolean if a field has been set. func (o *OAuth2Client) HasRegistrationAccessToken() bool { - if o != nil && o.RegistrationAccessToken != nil { + if o != nil && !IsNil(o.RegistrationAccessToken) { return true } @@ -1218,7 +1221,7 @@ func (o *OAuth2Client) SetRegistrationAccessToken(v string) { // GetRegistrationClientUri returns the RegistrationClientUri field value if set, zero value otherwise. func (o *OAuth2Client) GetRegistrationClientUri() string { - if o == nil || o.RegistrationClientUri == nil { + if o == nil || IsNil(o.RegistrationClientUri) { var ret string return ret } @@ -1228,7 +1231,7 @@ func (o *OAuth2Client) GetRegistrationClientUri() string { // GetRegistrationClientUriOk returns a tuple with the RegistrationClientUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRegistrationClientUriOk() (*string, bool) { - if o == nil || o.RegistrationClientUri == nil { + if o == nil || IsNil(o.RegistrationClientUri) { return nil, false } return o.RegistrationClientUri, true @@ -1236,7 +1239,7 @@ func (o *OAuth2Client) GetRegistrationClientUriOk() (*string, bool) { // HasRegistrationClientUri returns a boolean if a field has been set. func (o *OAuth2Client) HasRegistrationClientUri() bool { - if o != nil && o.RegistrationClientUri != nil { + if o != nil && !IsNil(o.RegistrationClientUri) { return true } @@ -1250,7 +1253,7 @@ func (o *OAuth2Client) SetRegistrationClientUri(v string) { // GetRequestObjectSigningAlg returns the RequestObjectSigningAlg field value if set, zero value otherwise. func (o *OAuth2Client) GetRequestObjectSigningAlg() string { - if o == nil || o.RequestObjectSigningAlg == nil { + if o == nil || IsNil(o.RequestObjectSigningAlg) { var ret string return ret } @@ -1260,7 +1263,7 @@ func (o *OAuth2Client) GetRequestObjectSigningAlg() string { // GetRequestObjectSigningAlgOk returns a tuple with the RequestObjectSigningAlg field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRequestObjectSigningAlgOk() (*string, bool) { - if o == nil || o.RequestObjectSigningAlg == nil { + if o == nil || IsNil(o.RequestObjectSigningAlg) { return nil, false } return o.RequestObjectSigningAlg, true @@ -1268,7 +1271,7 @@ func (o *OAuth2Client) GetRequestObjectSigningAlgOk() (*string, bool) { // HasRequestObjectSigningAlg returns a boolean if a field has been set. func (o *OAuth2Client) HasRequestObjectSigningAlg() bool { - if o != nil && o.RequestObjectSigningAlg != nil { + if o != nil && !IsNil(o.RequestObjectSigningAlg) { return true } @@ -1282,7 +1285,7 @@ func (o *OAuth2Client) SetRequestObjectSigningAlg(v string) { // GetRequestUris returns the RequestUris field value if set, zero value otherwise. func (o *OAuth2Client) GetRequestUris() []string { - if o == nil || o.RequestUris == nil { + if o == nil || IsNil(o.RequestUris) { var ret []string return ret } @@ -1292,7 +1295,7 @@ func (o *OAuth2Client) GetRequestUris() []string { // GetRequestUrisOk returns a tuple with the RequestUris field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetRequestUrisOk() ([]string, bool) { - if o == nil || o.RequestUris == nil { + if o == nil || IsNil(o.RequestUris) { return nil, false } return o.RequestUris, true @@ -1300,7 +1303,7 @@ func (o *OAuth2Client) GetRequestUrisOk() ([]string, bool) { // HasRequestUris returns a boolean if a field has been set. func (o *OAuth2Client) HasRequestUris() bool { - if o != nil && o.RequestUris != nil { + if o != nil && !IsNil(o.RequestUris) { return true } @@ -1314,7 +1317,7 @@ func (o *OAuth2Client) SetRequestUris(v []string) { // GetResponseTypes returns the ResponseTypes field value if set, zero value otherwise. func (o *OAuth2Client) GetResponseTypes() []string { - if o == nil || o.ResponseTypes == nil { + if o == nil || IsNil(o.ResponseTypes) { var ret []string return ret } @@ -1324,7 +1327,7 @@ func (o *OAuth2Client) GetResponseTypes() []string { // GetResponseTypesOk returns a tuple with the ResponseTypes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetResponseTypesOk() ([]string, bool) { - if o == nil || o.ResponseTypes == nil { + if o == nil || IsNil(o.ResponseTypes) { return nil, false } return o.ResponseTypes, true @@ -1332,7 +1335,7 @@ func (o *OAuth2Client) GetResponseTypesOk() ([]string, bool) { // HasResponseTypes returns a boolean if a field has been set. func (o *OAuth2Client) HasResponseTypes() bool { - if o != nil && o.ResponseTypes != nil { + if o != nil && !IsNil(o.ResponseTypes) { return true } @@ -1346,7 +1349,7 @@ func (o *OAuth2Client) SetResponseTypes(v []string) { // GetScope returns the Scope field value if set, zero value otherwise. func (o *OAuth2Client) GetScope() string { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { var ret string return ret } @@ -1356,7 +1359,7 @@ func (o *OAuth2Client) 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 *OAuth2Client) GetScopeOk() (*string, bool) { - if o == nil || o.Scope == nil { + if o == nil || IsNil(o.Scope) { return nil, false } return o.Scope, true @@ -1364,7 +1367,7 @@ func (o *OAuth2Client) GetScopeOk() (*string, bool) { // HasScope returns a boolean if a field has been set. func (o *OAuth2Client) HasScope() bool { - if o != nil && o.Scope != nil { + if o != nil && !IsNil(o.Scope) { return true } @@ -1378,7 +1381,7 @@ func (o *OAuth2Client) SetScope(v string) { // GetSectorIdentifierUri returns the SectorIdentifierUri field value if set, zero value otherwise. func (o *OAuth2Client) GetSectorIdentifierUri() string { - if o == nil || o.SectorIdentifierUri == nil { + if o == nil || IsNil(o.SectorIdentifierUri) { var ret string return ret } @@ -1388,7 +1391,7 @@ func (o *OAuth2Client) GetSectorIdentifierUri() string { // GetSectorIdentifierUriOk returns a tuple with the SectorIdentifierUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetSectorIdentifierUriOk() (*string, bool) { - if o == nil || o.SectorIdentifierUri == nil { + if o == nil || IsNil(o.SectorIdentifierUri) { return nil, false } return o.SectorIdentifierUri, true @@ -1396,7 +1399,7 @@ func (o *OAuth2Client) GetSectorIdentifierUriOk() (*string, bool) { // HasSectorIdentifierUri returns a boolean if a field has been set. func (o *OAuth2Client) HasSectorIdentifierUri() bool { - if o != nil && o.SectorIdentifierUri != nil { + if o != nil && !IsNil(o.SectorIdentifierUri) { return true } @@ -1410,7 +1413,7 @@ func (o *OAuth2Client) SetSectorIdentifierUri(v string) { // GetSkipConsent returns the SkipConsent field value if set, zero value otherwise. func (o *OAuth2Client) GetSkipConsent() bool { - if o == nil || o.SkipConsent == nil { + if o == nil || IsNil(o.SkipConsent) { var ret bool return ret } @@ -1420,7 +1423,7 @@ func (o *OAuth2Client) GetSkipConsent() bool { // GetSkipConsentOk returns a tuple with the SkipConsent field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetSkipConsentOk() (*bool, bool) { - if o == nil || o.SkipConsent == nil { + if o == nil || IsNil(o.SkipConsent) { return nil, false } return o.SkipConsent, true @@ -1428,7 +1431,7 @@ func (o *OAuth2Client) GetSkipConsentOk() (*bool, bool) { // HasSkipConsent returns a boolean if a field has been set. func (o *OAuth2Client) HasSkipConsent() bool { - if o != nil && o.SkipConsent != nil { + if o != nil && !IsNil(o.SkipConsent) { return true } @@ -1442,7 +1445,7 @@ func (o *OAuth2Client) SetSkipConsent(v bool) { // GetSubjectType returns the SubjectType field value if set, zero value otherwise. func (o *OAuth2Client) GetSubjectType() string { - if o == nil || o.SubjectType == nil { + if o == nil || IsNil(o.SubjectType) { var ret string return ret } @@ -1452,7 +1455,7 @@ func (o *OAuth2Client) GetSubjectType() string { // GetSubjectTypeOk returns a tuple with the SubjectType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetSubjectTypeOk() (*string, bool) { - if o == nil || o.SubjectType == nil { + if o == nil || IsNil(o.SubjectType) { return nil, false } return o.SubjectType, true @@ -1460,7 +1463,7 @@ func (o *OAuth2Client) GetSubjectTypeOk() (*string, bool) { // HasSubjectType returns a boolean if a field has been set. func (o *OAuth2Client) HasSubjectType() bool { - if o != nil && o.SubjectType != nil { + if o != nil && !IsNil(o.SubjectType) { return true } @@ -1474,7 +1477,7 @@ func (o *OAuth2Client) SetSubjectType(v string) { // GetTokenEndpointAuthMethod returns the TokenEndpointAuthMethod field value if set, zero value otherwise. func (o *OAuth2Client) GetTokenEndpointAuthMethod() string { - if o == nil || o.TokenEndpointAuthMethod == nil { + if o == nil || IsNil(o.TokenEndpointAuthMethod) { var ret string return ret } @@ -1484,7 +1487,7 @@ func (o *OAuth2Client) GetTokenEndpointAuthMethod() string { // GetTokenEndpointAuthMethodOk returns a tuple with the TokenEndpointAuthMethod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetTokenEndpointAuthMethodOk() (*string, bool) { - if o == nil || o.TokenEndpointAuthMethod == nil { + if o == nil || IsNil(o.TokenEndpointAuthMethod) { return nil, false } return o.TokenEndpointAuthMethod, true @@ -1492,7 +1495,7 @@ func (o *OAuth2Client) GetTokenEndpointAuthMethodOk() (*string, bool) { // HasTokenEndpointAuthMethod returns a boolean if a field has been set. func (o *OAuth2Client) HasTokenEndpointAuthMethod() bool { - if o != nil && o.TokenEndpointAuthMethod != nil { + if o != nil && !IsNil(o.TokenEndpointAuthMethod) { return true } @@ -1506,7 +1509,7 @@ func (o *OAuth2Client) SetTokenEndpointAuthMethod(v string) { // GetTokenEndpointAuthSigningAlg returns the TokenEndpointAuthSigningAlg field value if set, zero value otherwise. func (o *OAuth2Client) GetTokenEndpointAuthSigningAlg() string { - if o == nil || o.TokenEndpointAuthSigningAlg == nil { + if o == nil || IsNil(o.TokenEndpointAuthSigningAlg) { var ret string return ret } @@ -1516,7 +1519,7 @@ func (o *OAuth2Client) GetTokenEndpointAuthSigningAlg() string { // GetTokenEndpointAuthSigningAlgOk returns a tuple with the TokenEndpointAuthSigningAlg field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetTokenEndpointAuthSigningAlgOk() (*string, bool) { - if o == nil || o.TokenEndpointAuthSigningAlg == nil { + if o == nil || IsNil(o.TokenEndpointAuthSigningAlg) { return nil, false } return o.TokenEndpointAuthSigningAlg, true @@ -1524,7 +1527,7 @@ func (o *OAuth2Client) GetTokenEndpointAuthSigningAlgOk() (*string, bool) { // HasTokenEndpointAuthSigningAlg returns a boolean if a field has been set. func (o *OAuth2Client) HasTokenEndpointAuthSigningAlg() bool { - if o != nil && o.TokenEndpointAuthSigningAlg != nil { + if o != nil && !IsNil(o.TokenEndpointAuthSigningAlg) { return true } @@ -1538,7 +1541,7 @@ func (o *OAuth2Client) SetTokenEndpointAuthSigningAlg(v string) { // GetTosUri returns the TosUri field value if set, zero value otherwise. func (o *OAuth2Client) GetTosUri() string { - if o == nil || o.TosUri == nil { + if o == nil || IsNil(o.TosUri) { var ret string return ret } @@ -1548,7 +1551,7 @@ func (o *OAuth2Client) GetTosUri() string { // GetTosUriOk returns a tuple with the TosUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetTosUriOk() (*string, bool) { - if o == nil || o.TosUri == nil { + if o == nil || IsNil(o.TosUri) { return nil, false } return o.TosUri, true @@ -1556,7 +1559,7 @@ func (o *OAuth2Client) GetTosUriOk() (*string, bool) { // HasTosUri returns a boolean if a field has been set. func (o *OAuth2Client) HasTosUri() bool { - if o != nil && o.TosUri != nil { + if o != nil && !IsNil(o.TosUri) { return true } @@ -1570,7 +1573,7 @@ func (o *OAuth2Client) SetTosUri(v string) { // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *OAuth2Client) GetUpdatedAt() time.Time { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { var ret time.Time return ret } @@ -1580,7 +1583,7 @@ func (o *OAuth2Client) GetUpdatedAt() time.Time { // 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 *OAuth2Client) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { return nil, false } return o.UpdatedAt, true @@ -1588,7 +1591,7 @@ func (o *OAuth2Client) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *OAuth2Client) HasUpdatedAt() bool { - if o != nil && o.UpdatedAt != nil { + if o != nil && !IsNil(o.UpdatedAt) { return true } @@ -1602,7 +1605,7 @@ func (o *OAuth2Client) SetUpdatedAt(v time.Time) { // GetUserinfoSignedResponseAlg returns the UserinfoSignedResponseAlg field value if set, zero value otherwise. func (o *OAuth2Client) GetUserinfoSignedResponseAlg() string { - if o == nil || o.UserinfoSignedResponseAlg == nil { + if o == nil || IsNil(o.UserinfoSignedResponseAlg) { var ret string return ret } @@ -1612,7 +1615,7 @@ func (o *OAuth2Client) GetUserinfoSignedResponseAlg() string { // GetUserinfoSignedResponseAlgOk returns a tuple with the UserinfoSignedResponseAlg field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2Client) GetUserinfoSignedResponseAlgOk() (*string, bool) { - if o == nil || o.UserinfoSignedResponseAlg == nil { + if o == nil || IsNil(o.UserinfoSignedResponseAlg) { return nil, false } return o.UserinfoSignedResponseAlg, true @@ -1620,7 +1623,7 @@ func (o *OAuth2Client) GetUserinfoSignedResponseAlgOk() (*string, bool) { // HasUserinfoSignedResponseAlg returns a boolean if a field has been set. func (o *OAuth2Client) HasUserinfoSignedResponseAlg() bool { - if o != nil && o.UserinfoSignedResponseAlg != nil { + if o != nil && !IsNil(o.UserinfoSignedResponseAlg) { return true } @@ -1633,149 +1636,157 @@ func (o *OAuth2Client) SetUserinfoSignedResponseAlg(v string) { } func (o OAuth2Client) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2Client) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AccessTokenStrategy != nil { + if !IsNil(o.AccessTokenStrategy) { toSerialize["access_token_strategy"] = o.AccessTokenStrategy } - if o.AllowedCorsOrigins != nil { + if !IsNil(o.AllowedCorsOrigins) { toSerialize["allowed_cors_origins"] = o.AllowedCorsOrigins } - if o.Audience != nil { + if !IsNil(o.Audience) { toSerialize["audience"] = o.Audience } - if o.AuthorizationCodeGrantAccessTokenLifespan != nil { + if !IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { toSerialize["authorization_code_grant_access_token_lifespan"] = o.AuthorizationCodeGrantAccessTokenLifespan } - if o.AuthorizationCodeGrantIdTokenLifespan != nil { + if !IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { toSerialize["authorization_code_grant_id_token_lifespan"] = o.AuthorizationCodeGrantIdTokenLifespan } - if o.AuthorizationCodeGrantRefreshTokenLifespan != nil { + if !IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { toSerialize["authorization_code_grant_refresh_token_lifespan"] = o.AuthorizationCodeGrantRefreshTokenLifespan } - if o.BackchannelLogoutSessionRequired != nil { + if !IsNil(o.BackchannelLogoutSessionRequired) { toSerialize["backchannel_logout_session_required"] = o.BackchannelLogoutSessionRequired } - if o.BackchannelLogoutUri != nil { + if !IsNil(o.BackchannelLogoutUri) { toSerialize["backchannel_logout_uri"] = o.BackchannelLogoutUri } - if o.ClientCredentialsGrantAccessTokenLifespan != nil { + if !IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { toSerialize["client_credentials_grant_access_token_lifespan"] = o.ClientCredentialsGrantAccessTokenLifespan } - if o.ClientId != nil { + if !IsNil(o.ClientId) { toSerialize["client_id"] = o.ClientId } - if o.ClientName != nil { + if !IsNil(o.ClientName) { toSerialize["client_name"] = o.ClientName } - if o.ClientSecret != nil { + if !IsNil(o.ClientSecret) { toSerialize["client_secret"] = o.ClientSecret } - if o.ClientSecretExpiresAt != nil { + if !IsNil(o.ClientSecretExpiresAt) { toSerialize["client_secret_expires_at"] = o.ClientSecretExpiresAt } - if o.ClientUri != nil { + if !IsNil(o.ClientUri) { toSerialize["client_uri"] = o.ClientUri } - if o.Contacts != nil { + if !IsNil(o.Contacts) { toSerialize["contacts"] = o.Contacts } - if o.CreatedAt != nil { + if !IsNil(o.CreatedAt) { toSerialize["created_at"] = o.CreatedAt } - if o.FrontchannelLogoutSessionRequired != nil { + if !IsNil(o.FrontchannelLogoutSessionRequired) { toSerialize["frontchannel_logout_session_required"] = o.FrontchannelLogoutSessionRequired } - if o.FrontchannelLogoutUri != nil { + if !IsNil(o.FrontchannelLogoutUri) { toSerialize["frontchannel_logout_uri"] = o.FrontchannelLogoutUri } - if o.GrantTypes != nil { + if !IsNil(o.GrantTypes) { toSerialize["grant_types"] = o.GrantTypes } - if o.ImplicitGrantAccessTokenLifespan != nil { + if !IsNil(o.ImplicitGrantAccessTokenLifespan) { toSerialize["implicit_grant_access_token_lifespan"] = o.ImplicitGrantAccessTokenLifespan } - if o.ImplicitGrantIdTokenLifespan != nil { + if !IsNil(o.ImplicitGrantIdTokenLifespan) { toSerialize["implicit_grant_id_token_lifespan"] = o.ImplicitGrantIdTokenLifespan } if o.Jwks != nil { toSerialize["jwks"] = o.Jwks } - if o.JwksUri != nil { + if !IsNil(o.JwksUri) { toSerialize["jwks_uri"] = o.JwksUri } - if o.JwtBearerGrantAccessTokenLifespan != nil { + if !IsNil(o.JwtBearerGrantAccessTokenLifespan) { toSerialize["jwt_bearer_grant_access_token_lifespan"] = o.JwtBearerGrantAccessTokenLifespan } - if o.LogoUri != nil { + if !IsNil(o.LogoUri) { toSerialize["logo_uri"] = o.LogoUri } if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - if o.Owner != nil { + if !IsNil(o.Owner) { toSerialize["owner"] = o.Owner } - if o.PolicyUri != nil { + if !IsNil(o.PolicyUri) { toSerialize["policy_uri"] = o.PolicyUri } - if o.PostLogoutRedirectUris != nil { + if !IsNil(o.PostLogoutRedirectUris) { toSerialize["post_logout_redirect_uris"] = o.PostLogoutRedirectUris } - if o.RedirectUris != nil { + if !IsNil(o.RedirectUris) { toSerialize["redirect_uris"] = o.RedirectUris } - if o.RefreshTokenGrantAccessTokenLifespan != nil { + if !IsNil(o.RefreshTokenGrantAccessTokenLifespan) { toSerialize["refresh_token_grant_access_token_lifespan"] = o.RefreshTokenGrantAccessTokenLifespan } - if o.RefreshTokenGrantIdTokenLifespan != nil { + if !IsNil(o.RefreshTokenGrantIdTokenLifespan) { toSerialize["refresh_token_grant_id_token_lifespan"] = o.RefreshTokenGrantIdTokenLifespan } - if o.RefreshTokenGrantRefreshTokenLifespan != nil { + if !IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { toSerialize["refresh_token_grant_refresh_token_lifespan"] = o.RefreshTokenGrantRefreshTokenLifespan } - if o.RegistrationAccessToken != nil { + if !IsNil(o.RegistrationAccessToken) { toSerialize["registration_access_token"] = o.RegistrationAccessToken } - if o.RegistrationClientUri != nil { + if !IsNil(o.RegistrationClientUri) { toSerialize["registration_client_uri"] = o.RegistrationClientUri } - if o.RequestObjectSigningAlg != nil { + if !IsNil(o.RequestObjectSigningAlg) { toSerialize["request_object_signing_alg"] = o.RequestObjectSigningAlg } - if o.RequestUris != nil { + if !IsNil(o.RequestUris) { toSerialize["request_uris"] = o.RequestUris } - if o.ResponseTypes != nil { + if !IsNil(o.ResponseTypes) { toSerialize["response_types"] = o.ResponseTypes } - if o.Scope != nil { + if !IsNil(o.Scope) { toSerialize["scope"] = o.Scope } - if o.SectorIdentifierUri != nil { + if !IsNil(o.SectorIdentifierUri) { toSerialize["sector_identifier_uri"] = o.SectorIdentifierUri } - if o.SkipConsent != nil { + if !IsNil(o.SkipConsent) { toSerialize["skip_consent"] = o.SkipConsent } - if o.SubjectType != nil { + if !IsNil(o.SubjectType) { toSerialize["subject_type"] = o.SubjectType } - if o.TokenEndpointAuthMethod != nil { + if !IsNil(o.TokenEndpointAuthMethod) { toSerialize["token_endpoint_auth_method"] = o.TokenEndpointAuthMethod } - if o.TokenEndpointAuthSigningAlg != nil { + if !IsNil(o.TokenEndpointAuthSigningAlg) { toSerialize["token_endpoint_auth_signing_alg"] = o.TokenEndpointAuthSigningAlg } - if o.TosUri != nil { + if !IsNil(o.TosUri) { toSerialize["tos_uri"] = o.TosUri } - if o.UpdatedAt != nil { + if !IsNil(o.UpdatedAt) { toSerialize["updated_at"] = o.UpdatedAt } - if o.UserinfoSignedResponseAlg != nil { + if !IsNil(o.UserinfoSignedResponseAlg) { toSerialize["userinfo_signed_response_alg"] = o.UserinfoSignedResponseAlg } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOAuth2Client struct { diff --git a/internal/httpclient/model_o_auth2_client_token_lifespans.go b/internal/httpclient/model_o_auth2_client_token_lifespans.go index 27af7508496..2ed10b8508c 100644 --- a/internal/httpclient/model_o_auth2_client_token_lifespans.go +++ b/internal/httpclient/model_o_auth2_client_token_lifespans.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the OAuth2ClientTokenLifespans type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ClientTokenLifespans{} + // OAuth2ClientTokenLifespans Lifespans of different token types issued for this OAuth 2.0 Client. type OAuth2ClientTokenLifespans struct { // Specify a time duration in milliseconds, seconds, minutes, hours. @@ -58,7 +61,7 @@ func NewOAuth2ClientTokenLifespansWithDefaults() *OAuth2ClientTokenLifespans { // GetAuthorizationCodeGrantAccessTokenLifespan returns the AuthorizationCodeGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantAccessTokenLifespan() string { - if o == nil || o.AuthorizationCodeGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { var ret string return ret } @@ -68,7 +71,7 @@ func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantAccessTokenLifespa // GetAuthorizationCodeGrantAccessTokenLifespanOk returns a tuple with the AuthorizationCodeGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.AuthorizationCodeGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { return nil, false } return o.AuthorizationCodeGrantAccessTokenLifespan, true @@ -76,7 +79,7 @@ func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantAccessTokenLifespa // HasAuthorizationCodeGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasAuthorizationCodeGrantAccessTokenLifespan() bool { - if o != nil && o.AuthorizationCodeGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { return true } @@ -90,7 +93,7 @@ func (o *OAuth2ClientTokenLifespans) SetAuthorizationCodeGrantAccessTokenLifespa // GetAuthorizationCodeGrantIdTokenLifespan returns the AuthorizationCodeGrantIdTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantIdTokenLifespan() string { - if o == nil || o.AuthorizationCodeGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { var ret string return ret } @@ -100,7 +103,7 @@ func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantIdTokenLifespan() // GetAuthorizationCodeGrantIdTokenLifespanOk returns a tuple with the AuthorizationCodeGrantIdTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantIdTokenLifespanOk() (*string, bool) { - if o == nil || o.AuthorizationCodeGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { return nil, false } return o.AuthorizationCodeGrantIdTokenLifespan, true @@ -108,7 +111,7 @@ func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantIdTokenLifespanOk( // HasAuthorizationCodeGrantIdTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasAuthorizationCodeGrantIdTokenLifespan() bool { - if o != nil && o.AuthorizationCodeGrantIdTokenLifespan != nil { + if o != nil && !IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { return true } @@ -122,7 +125,7 @@ func (o *OAuth2ClientTokenLifespans) SetAuthorizationCodeGrantIdTokenLifespan(v // GetAuthorizationCodeGrantRefreshTokenLifespan returns the AuthorizationCodeGrantRefreshTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantRefreshTokenLifespan() string { - if o == nil || o.AuthorizationCodeGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { var ret string return ret } @@ -132,7 +135,7 @@ func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantRefreshTokenLifesp // GetAuthorizationCodeGrantRefreshTokenLifespanOk returns a tuple with the AuthorizationCodeGrantRefreshTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantRefreshTokenLifespanOk() (*string, bool) { - if o == nil || o.AuthorizationCodeGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { return nil, false } return o.AuthorizationCodeGrantRefreshTokenLifespan, true @@ -140,7 +143,7 @@ func (o *OAuth2ClientTokenLifespans) GetAuthorizationCodeGrantRefreshTokenLifesp // HasAuthorizationCodeGrantRefreshTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasAuthorizationCodeGrantRefreshTokenLifespan() bool { - if o != nil && o.AuthorizationCodeGrantRefreshTokenLifespan != nil { + if o != nil && !IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { return true } @@ -154,7 +157,7 @@ func (o *OAuth2ClientTokenLifespans) SetAuthorizationCodeGrantRefreshTokenLifesp // GetClientCredentialsGrantAccessTokenLifespan returns the ClientCredentialsGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetClientCredentialsGrantAccessTokenLifespan() string { - if o == nil || o.ClientCredentialsGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { var ret string return ret } @@ -164,7 +167,7 @@ func (o *OAuth2ClientTokenLifespans) GetClientCredentialsGrantAccessTokenLifespa // GetClientCredentialsGrantAccessTokenLifespanOk returns a tuple with the ClientCredentialsGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetClientCredentialsGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.ClientCredentialsGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { return nil, false } return o.ClientCredentialsGrantAccessTokenLifespan, true @@ -172,7 +175,7 @@ func (o *OAuth2ClientTokenLifespans) GetClientCredentialsGrantAccessTokenLifespa // HasClientCredentialsGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasClientCredentialsGrantAccessTokenLifespan() bool { - if o != nil && o.ClientCredentialsGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { return true } @@ -186,7 +189,7 @@ func (o *OAuth2ClientTokenLifespans) SetClientCredentialsGrantAccessTokenLifespa // GetImplicitGrantAccessTokenLifespan returns the ImplicitGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetImplicitGrantAccessTokenLifespan() string { - if o == nil || o.ImplicitGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantAccessTokenLifespan) { var ret string return ret } @@ -196,7 +199,7 @@ func (o *OAuth2ClientTokenLifespans) GetImplicitGrantAccessTokenLifespan() strin // GetImplicitGrantAccessTokenLifespanOk returns a tuple with the ImplicitGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetImplicitGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.ImplicitGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantAccessTokenLifespan) { return nil, false } return o.ImplicitGrantAccessTokenLifespan, true @@ -204,7 +207,7 @@ func (o *OAuth2ClientTokenLifespans) GetImplicitGrantAccessTokenLifespanOk() (*s // HasImplicitGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasImplicitGrantAccessTokenLifespan() bool { - if o != nil && o.ImplicitGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.ImplicitGrantAccessTokenLifespan) { return true } @@ -218,7 +221,7 @@ func (o *OAuth2ClientTokenLifespans) SetImplicitGrantAccessTokenLifespan(v strin // GetImplicitGrantIdTokenLifespan returns the ImplicitGrantIdTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetImplicitGrantIdTokenLifespan() string { - if o == nil || o.ImplicitGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantIdTokenLifespan) { var ret string return ret } @@ -228,7 +231,7 @@ func (o *OAuth2ClientTokenLifespans) GetImplicitGrantIdTokenLifespan() string { // GetImplicitGrantIdTokenLifespanOk returns a tuple with the ImplicitGrantIdTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetImplicitGrantIdTokenLifespanOk() (*string, bool) { - if o == nil || o.ImplicitGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.ImplicitGrantIdTokenLifespan) { return nil, false } return o.ImplicitGrantIdTokenLifespan, true @@ -236,7 +239,7 @@ func (o *OAuth2ClientTokenLifespans) GetImplicitGrantIdTokenLifespanOk() (*strin // HasImplicitGrantIdTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasImplicitGrantIdTokenLifespan() bool { - if o != nil && o.ImplicitGrantIdTokenLifespan != nil { + if o != nil && !IsNil(o.ImplicitGrantIdTokenLifespan) { return true } @@ -250,7 +253,7 @@ func (o *OAuth2ClientTokenLifespans) SetImplicitGrantIdTokenLifespan(v string) { // GetJwtBearerGrantAccessTokenLifespan returns the JwtBearerGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetJwtBearerGrantAccessTokenLifespan() string { - if o == nil || o.JwtBearerGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.JwtBearerGrantAccessTokenLifespan) { var ret string return ret } @@ -260,7 +263,7 @@ func (o *OAuth2ClientTokenLifespans) GetJwtBearerGrantAccessTokenLifespan() stri // GetJwtBearerGrantAccessTokenLifespanOk returns a tuple with the JwtBearerGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetJwtBearerGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.JwtBearerGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.JwtBearerGrantAccessTokenLifespan) { return nil, false } return o.JwtBearerGrantAccessTokenLifespan, true @@ -268,7 +271,7 @@ func (o *OAuth2ClientTokenLifespans) GetJwtBearerGrantAccessTokenLifespanOk() (* // HasJwtBearerGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasJwtBearerGrantAccessTokenLifespan() bool { - if o != nil && o.JwtBearerGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.JwtBearerGrantAccessTokenLifespan) { return true } @@ -282,7 +285,7 @@ func (o *OAuth2ClientTokenLifespans) SetJwtBearerGrantAccessTokenLifespan(v stri // GetRefreshTokenGrantAccessTokenLifespan returns the RefreshTokenGrantAccessTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantAccessTokenLifespan() string { - if o == nil || o.RefreshTokenGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantAccessTokenLifespan) { var ret string return ret } @@ -292,7 +295,7 @@ func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantAccessTokenLifespan() s // GetRefreshTokenGrantAccessTokenLifespanOk returns a tuple with the RefreshTokenGrantAccessTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantAccessTokenLifespanOk() (*string, bool) { - if o == nil || o.RefreshTokenGrantAccessTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantAccessTokenLifespan) { return nil, false } return o.RefreshTokenGrantAccessTokenLifespan, true @@ -300,7 +303,7 @@ func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantAccessTokenLifespanOk() // HasRefreshTokenGrantAccessTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasRefreshTokenGrantAccessTokenLifespan() bool { - if o != nil && o.RefreshTokenGrantAccessTokenLifespan != nil { + if o != nil && !IsNil(o.RefreshTokenGrantAccessTokenLifespan) { return true } @@ -314,7 +317,7 @@ func (o *OAuth2ClientTokenLifespans) SetRefreshTokenGrantAccessTokenLifespan(v s // GetRefreshTokenGrantIdTokenLifespan returns the RefreshTokenGrantIdTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantIdTokenLifespan() string { - if o == nil || o.RefreshTokenGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantIdTokenLifespan) { var ret string return ret } @@ -324,7 +327,7 @@ func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantIdTokenLifespan() strin // GetRefreshTokenGrantIdTokenLifespanOk returns a tuple with the RefreshTokenGrantIdTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantIdTokenLifespanOk() (*string, bool) { - if o == nil || o.RefreshTokenGrantIdTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantIdTokenLifespan) { return nil, false } return o.RefreshTokenGrantIdTokenLifespan, true @@ -332,7 +335,7 @@ func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantIdTokenLifespanOk() (*s // HasRefreshTokenGrantIdTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasRefreshTokenGrantIdTokenLifespan() bool { - if o != nil && o.RefreshTokenGrantIdTokenLifespan != nil { + if o != nil && !IsNil(o.RefreshTokenGrantIdTokenLifespan) { return true } @@ -346,7 +349,7 @@ func (o *OAuth2ClientTokenLifespans) SetRefreshTokenGrantIdTokenLifespan(v strin // GetRefreshTokenGrantRefreshTokenLifespan returns the RefreshTokenGrantRefreshTokenLifespan field value if set, zero value otherwise. func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantRefreshTokenLifespan() string { - if o == nil || o.RefreshTokenGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { var ret string return ret } @@ -356,7 +359,7 @@ func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantRefreshTokenLifespan() // GetRefreshTokenGrantRefreshTokenLifespanOk returns a tuple with the RefreshTokenGrantRefreshTokenLifespan field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantRefreshTokenLifespanOk() (*string, bool) { - if o == nil || o.RefreshTokenGrantRefreshTokenLifespan == nil { + if o == nil || IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { return nil, false } return o.RefreshTokenGrantRefreshTokenLifespan, true @@ -364,7 +367,7 @@ func (o *OAuth2ClientTokenLifespans) GetRefreshTokenGrantRefreshTokenLifespanOk( // HasRefreshTokenGrantRefreshTokenLifespan returns a boolean if a field has been set. func (o *OAuth2ClientTokenLifespans) HasRefreshTokenGrantRefreshTokenLifespan() bool { - if o != nil && o.RefreshTokenGrantRefreshTokenLifespan != nil { + if o != nil && !IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { return true } @@ -377,38 +380,46 @@ func (o *OAuth2ClientTokenLifespans) SetRefreshTokenGrantRefreshTokenLifespan(v } func (o OAuth2ClientTokenLifespans) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ClientTokenLifespans) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AuthorizationCodeGrantAccessTokenLifespan != nil { + if !IsNil(o.AuthorizationCodeGrantAccessTokenLifespan) { toSerialize["authorization_code_grant_access_token_lifespan"] = o.AuthorizationCodeGrantAccessTokenLifespan } - if o.AuthorizationCodeGrantIdTokenLifespan != nil { + if !IsNil(o.AuthorizationCodeGrantIdTokenLifespan) { toSerialize["authorization_code_grant_id_token_lifespan"] = o.AuthorizationCodeGrantIdTokenLifespan } - if o.AuthorizationCodeGrantRefreshTokenLifespan != nil { + if !IsNil(o.AuthorizationCodeGrantRefreshTokenLifespan) { toSerialize["authorization_code_grant_refresh_token_lifespan"] = o.AuthorizationCodeGrantRefreshTokenLifespan } - if o.ClientCredentialsGrantAccessTokenLifespan != nil { + if !IsNil(o.ClientCredentialsGrantAccessTokenLifespan) { toSerialize["client_credentials_grant_access_token_lifespan"] = o.ClientCredentialsGrantAccessTokenLifespan } - if o.ImplicitGrantAccessTokenLifespan != nil { + if !IsNil(o.ImplicitGrantAccessTokenLifespan) { toSerialize["implicit_grant_access_token_lifespan"] = o.ImplicitGrantAccessTokenLifespan } - if o.ImplicitGrantIdTokenLifespan != nil { + if !IsNil(o.ImplicitGrantIdTokenLifespan) { toSerialize["implicit_grant_id_token_lifespan"] = o.ImplicitGrantIdTokenLifespan } - if o.JwtBearerGrantAccessTokenLifespan != nil { + if !IsNil(o.JwtBearerGrantAccessTokenLifespan) { toSerialize["jwt_bearer_grant_access_token_lifespan"] = o.JwtBearerGrantAccessTokenLifespan } - if o.RefreshTokenGrantAccessTokenLifespan != nil { + if !IsNil(o.RefreshTokenGrantAccessTokenLifespan) { toSerialize["refresh_token_grant_access_token_lifespan"] = o.RefreshTokenGrantAccessTokenLifespan } - if o.RefreshTokenGrantIdTokenLifespan != nil { + if !IsNil(o.RefreshTokenGrantIdTokenLifespan) { toSerialize["refresh_token_grant_id_token_lifespan"] = o.RefreshTokenGrantIdTokenLifespan } - if o.RefreshTokenGrantRefreshTokenLifespan != nil { + if !IsNil(o.RefreshTokenGrantRefreshTokenLifespan) { toSerialize["refresh_token_grant_refresh_token_lifespan"] = o.RefreshTokenGrantRefreshTokenLifespan } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOAuth2ClientTokenLifespans struct { diff --git a/internal/httpclient/model_o_auth2_consent_request.go b/internal/httpclient/model_o_auth2_consent_request.go index a61e14d016e..78be5c543fa 100644 --- a/internal/httpclient/model_o_auth2_consent_request.go +++ b/internal/httpclient/model_o_auth2_consent_request.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" ) +// checks if the OAuth2ConsentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ConsentRequest{} + // OAuth2ConsentRequest struct for OAuth2ConsentRequest type OAuth2ConsentRequest struct { // 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. @@ -39,6 +44,8 @@ type OAuth2ConsentRequest struct { Subject *string `json:"subject,omitempty"` } +type _OAuth2ConsentRequest OAuth2ConsentRequest + // NewOAuth2ConsentRequest instantiates a new OAuth2ConsentRequest object // 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 @@ -59,7 +66,7 @@ func NewOAuth2ConsentRequestWithDefaults() *OAuth2ConsentRequest { // GetAcr returns the Acr field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetAcr() string { - if o == nil || o.Acr == nil { + if o == nil || IsNil(o.Acr) { var ret string return ret } @@ -69,7 +76,7 @@ func (o *OAuth2ConsentRequest) GetAcr() string { // GetAcrOk returns a tuple with the Acr field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequest) GetAcrOk() (*string, bool) { - if o == nil || o.Acr == nil { + if o == nil || IsNil(o.Acr) { return nil, false } return o.Acr, true @@ -77,7 +84,7 @@ func (o *OAuth2ConsentRequest) GetAcrOk() (*string, bool) { // HasAcr returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasAcr() bool { - if o != nil && o.Acr != nil { + if o != nil && !IsNil(o.Acr) { return true } @@ -91,7 +98,7 @@ func (o *OAuth2ConsentRequest) SetAcr(v string) { // GetAmr returns the Amr field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetAmr() []string { - if o == nil || o.Amr == nil { + if o == nil || IsNil(o.Amr) { var ret []string return ret } @@ -101,7 +108,7 @@ func (o *OAuth2ConsentRequest) GetAmr() []string { // GetAmrOk returns a tuple with the Amr field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequest) GetAmrOk() ([]string, bool) { - if o == nil || o.Amr == nil { + if o == nil || IsNil(o.Amr) { return nil, false } return o.Amr, true @@ -109,7 +116,7 @@ func (o *OAuth2ConsentRequest) GetAmrOk() ([]string, bool) { // HasAmr returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasAmr() bool { - if o != nil && o.Amr != nil { + if o != nil && !IsNil(o.Amr) { return true } @@ -147,7 +154,7 @@ func (o *OAuth2ConsentRequest) SetChallenge(v string) { // GetClient returns the Client field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetClient() OAuth2Client { - if o == nil || o.Client == nil { + if o == nil || IsNil(o.Client) { var ret OAuth2Client return ret } @@ -157,7 +164,7 @@ func (o *OAuth2ConsentRequest) 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 *OAuth2ConsentRequest) GetClientOk() (*OAuth2Client, bool) { - if o == nil || o.Client == nil { + if o == nil || IsNil(o.Client) { return nil, false } return o.Client, true @@ -165,7 +172,7 @@ func (o *OAuth2ConsentRequest) GetClientOk() (*OAuth2Client, bool) { // HasClient returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasClient() bool { - if o != nil && o.Client != nil { + if o != nil && !IsNil(o.Client) { return true } @@ -190,7 +197,7 @@ func (o *OAuth2ConsentRequest) GetContext() interface{} { // 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 *OAuth2ConsentRequest) GetContextOk() (*interface{}, bool) { - if o == nil || o.Context == nil { + if o == nil || IsNil(o.Context) { return nil, false } return &o.Context, true @@ -198,7 +205,7 @@ func (o *OAuth2ConsentRequest) GetContextOk() (*interface{}, bool) { // HasContext returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasContext() bool { - if o != nil && o.Context != nil { + if o != nil && IsNil(o.Context) { return true } @@ -212,7 +219,7 @@ func (o *OAuth2ConsentRequest) SetContext(v interface{}) { // GetLoginChallenge returns the LoginChallenge field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetLoginChallenge() string { - if o == nil || o.LoginChallenge == nil { + if o == nil || IsNil(o.LoginChallenge) { var ret string return ret } @@ -222,7 +229,7 @@ func (o *OAuth2ConsentRequest) GetLoginChallenge() string { // GetLoginChallengeOk returns a tuple with the LoginChallenge field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequest) GetLoginChallengeOk() (*string, bool) { - if o == nil || o.LoginChallenge == nil { + if o == nil || IsNil(o.LoginChallenge) { return nil, false } return o.LoginChallenge, true @@ -230,7 +237,7 @@ func (o *OAuth2ConsentRequest) GetLoginChallengeOk() (*string, bool) { // HasLoginChallenge returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasLoginChallenge() bool { - if o != nil && o.LoginChallenge != nil { + if o != nil && !IsNil(o.LoginChallenge) { return true } @@ -244,7 +251,7 @@ func (o *OAuth2ConsentRequest) SetLoginChallenge(v string) { // GetLoginSessionId returns the LoginSessionId field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetLoginSessionId() string { - if o == nil || o.LoginSessionId == nil { + if o == nil || IsNil(o.LoginSessionId) { var ret string return ret } @@ -254,7 +261,7 @@ func (o *OAuth2ConsentRequest) GetLoginSessionId() string { // GetLoginSessionIdOk returns a tuple with the LoginSessionId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequest) GetLoginSessionIdOk() (*string, bool) { - if o == nil || o.LoginSessionId == nil { + if o == nil || IsNil(o.LoginSessionId) { return nil, false } return o.LoginSessionId, true @@ -262,7 +269,7 @@ func (o *OAuth2ConsentRequest) GetLoginSessionIdOk() (*string, bool) { // HasLoginSessionId returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasLoginSessionId() bool { - if o != nil && o.LoginSessionId != nil { + if o != nil && !IsNil(o.LoginSessionId) { return true } @@ -276,7 +283,7 @@ func (o *OAuth2ConsentRequest) SetLoginSessionId(v string) { // GetOidcContext returns the OidcContext field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetOidcContext() OAuth2ConsentRequestOpenIDConnectContext { - if o == nil || o.OidcContext == nil { + if o == nil || IsNil(o.OidcContext) { var ret OAuth2ConsentRequestOpenIDConnectContext return ret } @@ -286,7 +293,7 @@ func (o *OAuth2ConsentRequest) GetOidcContext() OAuth2ConsentRequestOpenIDConnec // 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 *OAuth2ConsentRequest) GetOidcContextOk() (*OAuth2ConsentRequestOpenIDConnectContext, bool) { - if o == nil || o.OidcContext == nil { + if o == nil || IsNil(o.OidcContext) { return nil, false } return o.OidcContext, true @@ -294,7 +301,7 @@ func (o *OAuth2ConsentRequest) GetOidcContextOk() (*OAuth2ConsentRequestOpenIDCo // HasOidcContext returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasOidcContext() bool { - if o != nil && o.OidcContext != nil { + if o != nil && !IsNil(o.OidcContext) { return true } @@ -308,7 +315,7 @@ func (o *OAuth2ConsentRequest) SetOidcContext(v OAuth2ConsentRequestOpenIDConnec // GetRequestUrl returns the RequestUrl field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetRequestUrl() string { - if o == nil || o.RequestUrl == nil { + if o == nil || IsNil(o.RequestUrl) { var ret string return ret } @@ -318,7 +325,7 @@ func (o *OAuth2ConsentRequest) 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 *OAuth2ConsentRequest) GetRequestUrlOk() (*string, bool) { - if o == nil || o.RequestUrl == nil { + if o == nil || IsNil(o.RequestUrl) { return nil, false } return o.RequestUrl, true @@ -326,7 +333,7 @@ func (o *OAuth2ConsentRequest) GetRequestUrlOk() (*string, bool) { // HasRequestUrl returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasRequestUrl() bool { - if o != nil && o.RequestUrl != nil { + if o != nil && !IsNil(o.RequestUrl) { return true } @@ -340,7 +347,7 @@ func (o *OAuth2ConsentRequest) SetRequestUrl(v string) { // GetRequestedAccessTokenAudience returns the RequestedAccessTokenAudience field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetRequestedAccessTokenAudience() []string { - if o == nil || o.RequestedAccessTokenAudience == nil { + if o == nil || IsNil(o.RequestedAccessTokenAudience) { var ret []string return ret } @@ -350,7 +357,7 @@ func (o *OAuth2ConsentRequest) GetRequestedAccessTokenAudience() []string { // 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 *OAuth2ConsentRequest) GetRequestedAccessTokenAudienceOk() ([]string, bool) { - if o == nil || o.RequestedAccessTokenAudience == nil { + if o == nil || IsNil(o.RequestedAccessTokenAudience) { return nil, false } return o.RequestedAccessTokenAudience, true @@ -358,7 +365,7 @@ func (o *OAuth2ConsentRequest) GetRequestedAccessTokenAudienceOk() ([]string, bo // HasRequestedAccessTokenAudience returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasRequestedAccessTokenAudience() bool { - if o != nil && o.RequestedAccessTokenAudience != nil { + if o != nil && !IsNil(o.RequestedAccessTokenAudience) { return true } @@ -372,7 +379,7 @@ func (o *OAuth2ConsentRequest) SetRequestedAccessTokenAudience(v []string) { // GetRequestedScope returns the RequestedScope field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetRequestedScope() []string { - if o == nil || o.RequestedScope == nil { + if o == nil || IsNil(o.RequestedScope) { var ret []string return ret } @@ -382,7 +389,7 @@ func (o *OAuth2ConsentRequest) GetRequestedScope() []string { // 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 *OAuth2ConsentRequest) GetRequestedScopeOk() ([]string, bool) { - if o == nil || o.RequestedScope == nil { + if o == nil || IsNil(o.RequestedScope) { return nil, false } return o.RequestedScope, true @@ -390,7 +397,7 @@ func (o *OAuth2ConsentRequest) GetRequestedScopeOk() ([]string, bool) { // HasRequestedScope returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasRequestedScope() bool { - if o != nil && o.RequestedScope != nil { + if o != nil && !IsNil(o.RequestedScope) { return true } @@ -404,7 +411,7 @@ func (o *OAuth2ConsentRequest) SetRequestedScope(v []string) { // GetSkip returns the Skip field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetSkip() bool { - if o == nil || o.Skip == nil { + if o == nil || IsNil(o.Skip) { var ret bool return ret } @@ -414,7 +421,7 @@ func (o *OAuth2ConsentRequest) GetSkip() bool { // GetSkipOk returns a tuple with the Skip field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OAuth2ConsentRequest) GetSkipOk() (*bool, bool) { - if o == nil || o.Skip == nil { + if o == nil || IsNil(o.Skip) { return nil, false } return o.Skip, true @@ -422,7 +429,7 @@ func (o *OAuth2ConsentRequest) GetSkipOk() (*bool, bool) { // HasSkip returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasSkip() bool { - if o != nil && o.Skip != nil { + if o != nil && !IsNil(o.Skip) { return true } @@ -436,7 +443,7 @@ func (o *OAuth2ConsentRequest) SetSkip(v bool) { // GetSubject returns the Subject field value if set, zero value otherwise. func (o *OAuth2ConsentRequest) GetSubject() string { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { var ret string return ret } @@ -446,7 +453,7 @@ func (o *OAuth2ConsentRequest) 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 *OAuth2ConsentRequest) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { + if o == nil || IsNil(o.Subject) { return nil, false } return o.Subject, true @@ -454,7 +461,7 @@ func (o *OAuth2ConsentRequest) GetSubjectOk() (*string, bool) { // HasSubject returns a boolean if a field has been set. func (o *OAuth2ConsentRequest) HasSubject() bool { - if o != nil && o.Subject != nil { + if o != nil && !IsNil(o.Subject) { return true } @@ -467,47 +474,90 @@ func (o *OAuth2ConsentRequest) SetSubject(v string) { } func (o OAuth2ConsentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ConsentRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Acr != nil { + if !IsNil(o.Acr) { toSerialize["acr"] = o.Acr } - if o.Amr != nil { + if !IsNil(o.Amr) { toSerialize["amr"] = o.Amr } - if true { - toSerialize["challenge"] = o.Challenge - } - if o.Client != nil { + toSerialize["challenge"] = o.Challenge + if !IsNil(o.Client) { toSerialize["client"] = o.Client } if o.Context != nil { toSerialize["context"] = o.Context } - if o.LoginChallenge != nil { + if !IsNil(o.LoginChallenge) { toSerialize["login_challenge"] = o.LoginChallenge } - if o.LoginSessionId != nil { + if !IsNil(o.LoginSessionId) { toSerialize["login_session_id"] = o.LoginSessionId } - if o.OidcContext != nil { + if !IsNil(o.OidcContext) { toSerialize["oidc_context"] = o.OidcContext } - if o.RequestUrl != nil { + if !IsNil(o.RequestUrl) { toSerialize["request_url"] = o.RequestUrl } - if o.RequestedAccessTokenAudience != nil { + if !IsNil(o.RequestedAccessTokenAudience) { toSerialize["requested_access_token_audience"] = o.RequestedAccessTokenAudience } - if o.RequestedScope != nil { + if !IsNil(o.RequestedScope) { toSerialize["requested_scope"] = o.RequestedScope } - if o.Skip != nil { + if !IsNil(o.Skip) { toSerialize["skip"] = o.Skip } - if o.Subject != nil { + if !IsNil(o.Subject) { toSerialize["subject"] = o.Subject } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *OAuth2ConsentRequest) UnmarshalJSON(data []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", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &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) + } + } + + varOAuth2ConsentRequest := _OAuth2ConsentRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOAuth2ConsentRequest) + + if err != nil { + return err + } + + *o = OAuth2ConsentRequest(varOAuth2ConsentRequest) + + return err } type NullableOAuth2ConsentRequest struct { diff --git a/internal/httpclient/model_o_auth2_consent_request_open_id_connect_context.go b/internal/httpclient/model_o_auth2_consent_request_open_id_connect_context.go index 8bc15fafe33..962ab736c66 100644 --- a/internal/httpclient/model_o_auth2_consent_request_open_id_connect_context.go +++ b/internal/httpclient/model_o_auth2_consent_request_open_id_connect_context.go @@ -15,6 +15,9 @@ import ( "encoding/json" ) +// checks if the OAuth2ConsentRequestOpenIDConnectContext type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ConsentRequestOpenIDConnectContext{} + // OAuth2ConsentRequestOpenIDConnectContext struct for OAuth2ConsentRequestOpenIDConnectContext type OAuth2ConsentRequestOpenIDConnectContext struct { // 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. @@ -48,7 +51,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 } @@ -58,7 +61,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 @@ -66,7 +69,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 } @@ -80,7 +83,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 } @@ -90,7 +93,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 @@ -98,7 +101,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 } @@ -112,7 +115,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 } @@ -122,15 +125,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 } @@ -144,7 +147,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 } @@ -154,7 +157,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 @@ -162,7 +165,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 } @@ -176,7 +179,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 } @@ -186,7 +189,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 @@ -194,7 +197,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 } @@ -207,23 +210,31 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOAuth2ConsentRequestOpenIDConnectContext struct { diff --git a/internal/httpclient/model_o_auth2_consent_session.go b/internal/httpclient/model_o_auth2_consent_session.go index 10d5e797cc5..f2e6c5c13ae 100644 --- a/internal/httpclient/model_o_auth2_consent_session.go +++ b/internal/httpclient/model_o_auth2_consent_session.go @@ -16,6 +16,9 @@ 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"` @@ -49,7 +52,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 } @@ -59,7 +62,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 @@ -67,7 +70,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 } @@ -81,7 +84,7 @@ func (o *OAuth2ConsentSession) SetConsentRequest(v OAuth2ConsentRequest) { // 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 } @@ -91,7 +94,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 @@ -99,7 +102,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 } @@ -113,7 +116,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 } @@ -123,7 +126,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 @@ -131,7 +134,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 } @@ -145,7 +148,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 } @@ -155,7 +158,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 @@ -163,7 +166,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 } @@ -177,7 +180,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 } @@ -187,7 +190,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 @@ -195,7 +198,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 } @@ -209,7 +212,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 } @@ -219,7 +222,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 @@ -227,7 +230,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 } @@ -241,7 +244,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 } @@ -251,7 +254,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 @@ -259,7 +262,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 } @@ -273,7 +276,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 } @@ -283,7 +286,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 @@ -291,7 +294,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 } @@ -304,32 +307,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 !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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOAuth2ConsentSession struct { diff --git a/internal/httpclient/model_o_auth2_consent_session_expires_at.go b/internal/httpclient/model_o_auth2_consent_session_expires_at.go index a0a752b99bb..20be47a9a88 100644 --- a/internal/httpclient/model_o_auth2_consent_session_expires_at.go +++ b/internal/httpclient/model_o_auth2_consent_session_expires_at.go @@ -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"` @@ -44,7 +47,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 } @@ -54,7 +57,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 @@ -62,7 +65,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 } @@ -76,7 +79,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 } @@ -86,7 +89,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 @@ -94,7 +97,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 } @@ -108,7 +111,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 } @@ -118,7 +121,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 @@ -126,7 +129,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 } @@ -140,7 +143,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 } @@ -150,7 +153,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 @@ -158,7 +161,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 } @@ -172,7 +175,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 } @@ -182,7 +185,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 @@ -190,7 +193,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 } @@ -203,23 +206,31 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOAuth2ConsentSessionExpiresAt struct { diff --git a/internal/httpclient/model_o_auth2_login_request.go b/internal/httpclient/model_o_auth2_login_request.go index 1dc9e475d29..2ddac3113c8 100644 --- a/internal/httpclient/model_o_auth2_login_request.go +++ b/internal/httpclient/model_o_auth2_login_request.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "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. @@ -33,6 +38,8 @@ type OAuth2LoginRequest struct { Subject string `json:"subject"` } +type _OAuth2LoginRequest OAuth2LoginRequest + // NewOAuth2LoginRequest instantiates a new OAuth2LoginRequest object // 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 @@ -105,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 } @@ -115,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 @@ -123,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 } @@ -161,7 +168,7 @@ func (o *OAuth2LoginRequest) SetRequestUrl(v string) { // GetRequestedAccessTokenAudience returns the RequestedAccessTokenAudience field value if set, zero value otherwise. func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudience() []string { - if o == nil || o.RequestedAccessTokenAudience == nil { + if o == nil || IsNil(o.RequestedAccessTokenAudience) { var ret []string return ret } @@ -171,7 +178,7 @@ func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudience() []string { // 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 || o.RequestedAccessTokenAudience == nil { + if o == nil || IsNil(o.RequestedAccessTokenAudience) { return nil, false } return o.RequestedAccessTokenAudience, true @@ -179,7 +186,7 @@ func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudienceOk() ([]string, bool // HasRequestedAccessTokenAudience returns a boolean if a field has been set. func (o *OAuth2LoginRequest) HasRequestedAccessTokenAudience() bool { - if o != nil && o.RequestedAccessTokenAudience != nil { + if o != nil && !IsNil(o.RequestedAccessTokenAudience) { return true } @@ -193,7 +200,7 @@ func (o *OAuth2LoginRequest) SetRequestedAccessTokenAudience(v []string) { // GetRequestedScope returns the RequestedScope field value if set, zero value otherwise. func (o *OAuth2LoginRequest) GetRequestedScope() []string { - if o == nil || o.RequestedScope == nil { + if o == nil || IsNil(o.RequestedScope) { var ret []string return ret } @@ -203,7 +210,7 @@ func (o *OAuth2LoginRequest) GetRequestedScope() []string { // 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 || o.RequestedScope == nil { + if o == nil || IsNil(o.RequestedScope) { return nil, false } return o.RequestedScope, true @@ -211,7 +218,7 @@ func (o *OAuth2LoginRequest) GetRequestedScopeOk() ([]string, bool) { // HasRequestedScope returns a boolean if a field has been set. func (o *OAuth2LoginRequest) HasRequestedScope() bool { - if o != nil && o.RequestedScope != nil { + if o != nil && !IsNil(o.RequestedScope) { return true } @@ -225,7 +232,7 @@ func (o *OAuth2LoginRequest) SetRequestedScope(v []string) { // 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 } @@ -235,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 @@ -243,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 } @@ -304,35 +311,74 @@ 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 o.RequestedAccessTokenAudience != nil { + toSerialize["request_url"] = o.RequestUrl + if !IsNil(o.RequestedAccessTokenAudience) { toSerialize["requested_access_token_audience"] = o.RequestedAccessTokenAudience } - if o.RequestedScope != nil { + 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 + toSerialize["skip"] = o.Skip + toSerialize["subject"] = o.Subject + return toSerialize, nil +} + +func (o *OAuth2LoginRequest) UnmarshalJSON(data []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", } - if true { - toSerialize["subject"] = o.Subject + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuth2LoginRequest := _OAuth2LoginRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOAuth2LoginRequest) + + if err != nil { + return err + } + + *o = OAuth2LoginRequest(varOAuth2LoginRequest) + + return err } type NullableOAuth2LoginRequest struct { diff --git a/internal/httpclient/model_o_auth2_logout_request.go b/internal/httpclient/model_o_auth2_logout_request.go index 4a2ef7c0bc7..517ed65cf56 100644 --- a/internal/httpclient/model_o_auth2_logout_request.go +++ b/internal/httpclient/model_o_auth2_logout_request.go @@ -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. @@ -49,7 +52,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 } @@ -59,7 +62,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 @@ -67,7 +70,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 } @@ -81,7 +84,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 } @@ -91,7 +94,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 @@ -99,7 +102,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 } @@ -113,7 +116,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 } @@ -123,7 +126,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 @@ -131,7 +134,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 } @@ -145,7 +148,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 } @@ -155,7 +158,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 @@ -163,7 +166,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 } @@ -177,7 +180,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 } @@ -187,7 +190,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 @@ -195,7 +198,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 } @@ -209,7 +212,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 } @@ -219,7 +222,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 @@ -227,7 +230,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 } @@ -240,26 +243,34 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOAuth2LogoutRequest struct { diff --git a/internal/httpclient/model_o_auth2_redirect_to.go b/internal/httpclient/model_o_auth2_redirect_to.go index 5abf9d4f250..e2ff2035357 100644 --- a/internal/httpclient/model_o_auth2_redirect_to.go +++ b/internal/httpclient/model_o_auth2_redirect_to.go @@ -12,15 +12,22 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "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. RedirectTo string `json:"redirect_to"` } +type _OAuth2RedirectTo OAuth2RedirectTo + // NewOAuth2RedirectTo instantiates a new OAuth2RedirectTo object // 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 @@ -64,13 +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 + return toSerialize, nil +} + +func (o *OAuth2RedirectTo) UnmarshalJSON(data []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(data, &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{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOAuth2RedirectTo) + + if err != nil { + return err + } + + *o = OAuth2RedirectTo(varOAuth2RedirectTo) + + return err +} + type NullableOAuth2RedirectTo struct { value *OAuth2RedirectTo isSet bool diff --git a/internal/httpclient/model_o_auth2_token_exchange.go b/internal/httpclient/model_o_auth2_token_exchange.go index ec15969bc6f..f2997682d5d 100644 --- a/internal/httpclient/model_o_auth2_token_exchange.go +++ b/internal/httpclient/model_o_auth2_token_exchange.go @@ -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. @@ -50,7 +53,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 } @@ -60,7 +63,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 @@ -68,7 +71,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 } @@ -82,7 +85,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 } @@ -92,7 +95,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 @@ -100,7 +103,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 } @@ -114,7 +117,7 @@ func (o *OAuth2TokenExchange) SetExpiresIn(v int64) { // GetIdToken returns the IdToken field value if set, zero value otherwise. func (o *OAuth2TokenExchange) GetIdToken() string { - if o == nil || o.IdToken == nil { + if o == nil || IsNil(o.IdToken) { var ret string return ret } @@ -124,7 +127,7 @@ func (o *OAuth2TokenExchange) GetIdToken() string { // 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() (*string, bool) { - if o == nil || o.IdToken == nil { + if o == nil || IsNil(o.IdToken) { return nil, false } return o.IdToken, true @@ -132,7 +135,7 @@ func (o *OAuth2TokenExchange) GetIdTokenOk() (*string, 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 } @@ -146,7 +149,7 @@ func (o *OAuth2TokenExchange) SetIdToken(v string) { // 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 } @@ -156,7 +159,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 @@ -164,7 +167,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 } @@ -178,7 +181,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 } @@ -188,7 +191,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 @@ -196,7 +199,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 } @@ -210,7 +213,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 } @@ -220,7 +223,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 @@ -228,7 +231,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 } @@ -241,26 +244,34 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOAuth2TokenExchange struct { diff --git a/internal/httpclient/model_oidc_configuration.go b/internal/httpclient/model_oidc_configuration.go index 08a0e7cd90a..240e40b307f 100644 --- a/internal/httpclient/model_oidc_configuration.go +++ b/internal/httpclient/model_oidc_configuration.go @@ -12,9 +12,14 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "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 @@ -81,6 +86,8 @@ type OidcConfiguration struct { UserinfoSigningAlgValuesSupported []string `json:"userinfo_signing_alg_values_supported,omitempty"` } +type _OidcConfiguration OidcConfiguration + // NewOidcConfiguration instantiates a new OidcConfiguration object // 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 @@ -133,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 } @@ -143,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 @@ -151,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 } @@ -165,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 } @@ -175,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 @@ -183,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 } @@ -197,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 } @@ -207,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 @@ -215,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 } @@ -229,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 } @@ -239,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 @@ -247,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 } @@ -261,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 } @@ -271,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 @@ -279,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 } @@ -293,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 } @@ -303,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 @@ -311,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 } @@ -325,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 } @@ -335,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 @@ -343,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 } @@ -357,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 } @@ -367,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 @@ -375,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 } @@ -389,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 } @@ -399,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 @@ -407,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 } @@ -421,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 } @@ -431,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 @@ -439,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 } @@ -453,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 } @@ -463,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 @@ -471,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 } @@ -581,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 } @@ -591,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 @@ -599,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 } @@ -613,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 } @@ -623,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 @@ -631,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 } @@ -645,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 } @@ -655,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 @@ -663,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 } @@ -677,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 } @@ -687,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 @@ -695,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 } @@ -709,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 } @@ -719,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 @@ -727,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 } @@ -741,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 } @@ -751,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 @@ -759,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 } @@ -797,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 } @@ -807,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 @@ -815,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 } @@ -829,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 } @@ -839,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 @@ -847,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 } @@ -909,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 } @@ -919,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 @@ -927,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 } @@ -941,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 } @@ -951,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 @@ -959,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 } @@ -997,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 } @@ -1007,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 @@ -1015,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 } @@ -1028,101 +1035,136 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *OidcConfiguration) UnmarshalJSON(data []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(data, &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{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOidcConfiguration) + + if err != nil { + return err + } + + *o = OidcConfiguration(varOidcConfiguration) + + return err } type NullableOidcConfiguration struct { diff --git a/internal/httpclient/model_oidc_user_info.go b/internal/httpclient/model_oidc_user_info.go index f1b942a7b6e..d6a08aedfe8 100644 --- a/internal/httpclient/model_oidc_user_info.go +++ b/internal/httpclient/model_oidc_user_info.go @@ -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. @@ -76,7 +79,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 } @@ -86,7 +89,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 @@ -94,7 +97,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 } @@ -108,7 +111,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 } @@ -118,7 +121,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 @@ -126,7 +129,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 } @@ -140,7 +143,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 } @@ -150,7 +153,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 @@ -158,7 +161,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 } @@ -172,7 +175,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 } @@ -182,7 +185,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 @@ -190,7 +193,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 } @@ -204,7 +207,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 } @@ -214,7 +217,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 @@ -222,7 +225,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 } @@ -236,7 +239,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 } @@ -246,7 +249,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 @@ -254,7 +257,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 } @@ -268,7 +271,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 } @@ -278,7 +281,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 @@ -286,7 +289,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 } @@ -300,7 +303,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 } @@ -310,7 +313,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 @@ -318,7 +321,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 } @@ -332,7 +335,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 } @@ -342,7 +345,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 @@ -350,7 +353,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 } @@ -364,7 +367,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 } @@ -374,7 +377,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 @@ -382,7 +385,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 } @@ -396,7 +399,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 } @@ -406,7 +409,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 @@ -414,7 +417,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 } @@ -428,7 +431,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 } @@ -438,7 +441,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 @@ -446,7 +449,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 } @@ -460,7 +463,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 } @@ -470,7 +473,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 @@ -478,7 +481,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 } @@ -492,7 +495,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 } @@ -502,7 +505,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 @@ -510,7 +513,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 } @@ -524,7 +527,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 } @@ -534,7 +537,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 @@ -542,7 +545,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 } @@ -556,7 +559,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 } @@ -566,7 +569,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 @@ -574,7 +577,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 } @@ -588,7 +591,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 } @@ -598,7 +601,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 @@ -606,7 +609,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 } @@ -620,7 +623,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 } @@ -630,7 +633,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 @@ -638,7 +641,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 } @@ -652,7 +655,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 } @@ -662,7 +665,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 @@ -670,7 +673,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 } @@ -683,65 +686,73 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOidcUserInfo struct { diff --git a/internal/httpclient/model_pagination.go b/internal/httpclient/model_pagination.go index 66402865828..3c8fb123987 100644 --- a/internal/httpclient/model_pagination.go +++ b/internal/httpclient/model_pagination.go @@ -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). @@ -50,7 +53,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 } @@ -60,7 +63,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 @@ -68,7 +71,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 } @@ -82,7 +85,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 } @@ -92,7 +95,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 @@ -100,7 +103,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 } @@ -113,14 +116,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullablePagination struct { diff --git a/internal/httpclient/model_pagination_headers.go b/internal/httpclient/model_pagination_headers.go index 803a8119b4e..acb56f21978 100644 --- a/internal/httpclient/model_pagination_headers.go +++ b/internal/httpclient/model_pagination_headers.go @@ -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 @@ -42,7 +45,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 } @@ -52,7 +55,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 @@ -60,7 +63,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 } @@ -74,7 +77,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 } @@ -84,7 +87,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 @@ -92,7 +95,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 } @@ -105,14 +108,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullablePaginationHeaders struct { diff --git a/internal/httpclient/model_reject_o_auth2_request.go b/internal/httpclient/model_reject_o_auth2_request.go index 4b6817491a5..8d0a178a3fb 100644 --- a/internal/httpclient/model_reject_o_auth2_request.go +++ b/internal/httpclient/model_reject_o_auth2_request.go @@ -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`. @@ -48,7 +51,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 } @@ -58,7 +61,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 @@ -66,7 +69,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 } @@ -80,7 +83,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 } @@ -90,7 +93,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 @@ -98,7 +101,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 } @@ -112,7 +115,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 } @@ -122,7 +125,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 @@ -130,7 +133,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 } @@ -144,7 +147,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 } @@ -154,7 +157,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 @@ -162,7 +165,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 } @@ -176,7 +179,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 } @@ -186,7 +189,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 @@ -194,7 +197,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 } @@ -207,23 +210,31 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableRejectOAuth2Request struct { diff --git a/internal/httpclient/model_rfc6749_error_json.go b/internal/httpclient/model_rfc6749_error_json.go index cf9ffb36916..d33a2b91e08 100644 --- a/internal/httpclient/model_rfc6749_error_json.go +++ b/internal/httpclient/model_rfc6749_error_json.go @@ -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"` @@ -43,7 +46,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 } @@ -53,7 +56,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 @@ -61,7 +64,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 } @@ -75,7 +78,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 } @@ -85,7 +88,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 @@ -93,7 +96,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 } @@ -107,7 +110,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 } @@ -117,7 +120,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 @@ -125,7 +128,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 } @@ -139,7 +142,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 } @@ -149,7 +152,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 @@ -157,7 +160,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 } @@ -171,7 +174,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 } @@ -181,7 +184,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 @@ -189,7 +192,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 } @@ -202,23 +205,31 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableRFC6749ErrorJson struct { diff --git a/internal/httpclient/model_token_pagination.go b/internal/httpclient/model_token_pagination.go index 7d96f47f2be..d9457ccd9e8 100644 --- a/internal/httpclient/model_token_pagination.go +++ b/internal/httpclient/model_token_pagination.go @@ -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). @@ -50,7 +53,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 } @@ -60,7 +63,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 @@ -68,7 +71,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 } @@ -82,7 +85,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 } @@ -92,7 +95,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 @@ -100,7 +103,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 } @@ -113,14 +116,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTokenPagination struct { diff --git a/internal/httpclient/model_token_pagination_headers.go b/internal/httpclient/model_token_pagination_headers.go index 7c4c657c968..537d5e59bdd 100644 --- a/internal/httpclient/model_token_pagination_headers.go +++ b/internal/httpclient/model_token_pagination_headers.go @@ -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 @@ -42,7 +45,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 } @@ -52,7 +55,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 @@ -60,7 +63,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 } @@ -74,7 +77,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 } @@ -84,7 +87,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 @@ -92,7 +95,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 } @@ -105,14 +108,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTokenPaginationHeaders struct { diff --git a/internal/httpclient/model_token_pagination_request_parameters.go b/internal/httpclient/model_token_pagination_request_parameters.go index 40ef780d684..e18c491d8fe 100644 --- a/internal/httpclient/model_token_pagination_request_parameters.go +++ b/internal/httpclient/model_token_pagination_request_parameters.go @@ -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). @@ -50,7 +53,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 } @@ -60,7 +63,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 @@ -68,7 +71,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 } @@ -82,7 +85,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 } @@ -92,7 +95,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 @@ -100,7 +103,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 } @@ -113,14 +116,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTokenPaginationRequestParameters struct { diff --git a/internal/httpclient/model_token_pagination_response_headers.go b/internal/httpclient/model_token_pagination_response_headers.go index 26722925de6..bddbcd203ea 100644 --- a/internal/httpclient/model_token_pagination_response_headers.go +++ b/internal/httpclient/model_token_pagination_response_headers.go @@ -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\" @@ -42,7 +45,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 } @@ -52,7 +55,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 @@ -60,7 +63,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 } @@ -74,7 +77,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 } @@ -84,7 +87,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 @@ -92,7 +95,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 } @@ -105,14 +108,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTokenPaginationResponseHeaders struct { diff --git a/internal/httpclient/model_trust_o_auth2_jwt_grant_issuer.go b/internal/httpclient/model_trust_o_auth2_jwt_grant_issuer.go index 15f8d9575f4..5803dcffbfb 100644 --- a/internal/httpclient/model_trust_o_auth2_jwt_grant_issuer.go +++ b/internal/httpclient/model_trust_o_auth2_jwt_grant_issuer.go @@ -12,10 +12,15 @@ Contact: hi@ory.sh package openapi import ( + "bytes" "encoding/json" + "fmt" "time" ) +// 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. @@ -31,6 +36,8 @@ type TrustOAuth2JwtGrantIssuer struct { Subject *string `json:"subject,omitempty"` } +type _TrustOAuth2JwtGrantIssuer TrustOAuth2JwtGrantIssuer + // NewTrustOAuth2JwtGrantIssuer instantiates a new TrustOAuth2JwtGrantIssuer object // 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 @@ -54,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 } @@ -64,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 @@ -72,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 } @@ -182,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 } @@ -192,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 @@ -200,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 } @@ -213,26 +220,66 @@ 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 + 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 } - if true { - toSerialize["issuer"] = o.Issuer + return toSerialize, nil +} + +func (o *TrustOAuth2JwtGrantIssuer) UnmarshalJSON(data []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", } - if true { - toSerialize["jwk"] = o.Jwk + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err } - if true { - toSerialize["scope"] = o.Scope + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if o.Subject != nil { - toSerialize["subject"] = o.Subject + + varTrustOAuth2JwtGrantIssuer := _TrustOAuth2JwtGrantIssuer{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTrustOAuth2JwtGrantIssuer) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = TrustOAuth2JwtGrantIssuer(varTrustOAuth2JwtGrantIssuer) + + return err } type NullableTrustOAuth2JwtGrantIssuer struct { diff --git a/internal/httpclient/model_trusted_o_auth2_jwt_grant_issuer.go b/internal/httpclient/model_trusted_o_auth2_jwt_grant_issuer.go index 80fba647b44..7b0c1fcbca9 100644 --- a/internal/httpclient/model_trusted_o_auth2_jwt_grant_issuer.go +++ b/internal/httpclient/model_trusted_o_auth2_jwt_grant_issuer.go @@ -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. @@ -53,7 +56,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 } @@ -63,7 +66,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 @@ -71,7 +74,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 } @@ -85,7 +88,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 } @@ -95,7 +98,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 @@ -103,7 +106,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 } @@ -117,7 +120,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 } @@ -127,7 +130,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 @@ -135,7 +138,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 } @@ -149,7 +152,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 } @@ -159,7 +162,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 @@ -167,7 +170,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 } @@ -181,7 +184,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 } @@ -191,7 +194,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 @@ -199,7 +202,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 } @@ -213,7 +216,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 } @@ -223,7 +226,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 @@ -231,7 +234,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 } @@ -245,7 +248,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 } @@ -255,7 +258,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 @@ -263,7 +266,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 } @@ -277,7 +280,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 } @@ -287,7 +290,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 @@ -295,7 +298,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 } @@ -308,32 +311,40 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTrustedOAuth2JwtGrantIssuer struct { diff --git a/internal/httpclient/model_trusted_o_auth2_jwt_grant_json_web_key.go b/internal/httpclient/model_trusted_o_auth2_jwt_grant_json_web_key.go index 7b358805c77..2752cb5eeea 100644 --- a/internal/httpclient/model_trusted_o_auth2_jwt_grant_json_web_key.go +++ b/internal/httpclient/model_trusted_o_auth2_jwt_grant_json_web_key.go @@ -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). @@ -42,7 +45,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 } @@ -52,7 +55,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 @@ -60,7 +63,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 } @@ -74,7 +77,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 } @@ -84,7 +87,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 @@ -92,7 +95,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 } @@ -105,14 +108,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTrustedOAuth2JwtGrantJsonWebKey struct { diff --git a/internal/httpclient/model_verifiable_credential_priming_response.go b/internal/httpclient/model_verifiable_credential_priming_response.go index 0744fd0704d..f0bdf3309b7 100644 --- a/internal/httpclient/model_verifiable_credential_priming_response.go +++ b/internal/httpclient/model_verifiable_credential_priming_response.go @@ -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"` @@ -46,7 +49,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 } @@ -56,7 +59,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 @@ -64,7 +67,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 } @@ -78,7 +81,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 } @@ -88,7 +91,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 @@ -96,7 +99,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 } @@ -110,7 +113,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 } @@ -120,7 +123,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 @@ -128,7 +131,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 } @@ -142,7 +145,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 } @@ -152,7 +155,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 @@ -160,7 +163,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 } @@ -174,7 +177,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 } @@ -184,7 +187,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 @@ -192,7 +195,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 } @@ -206,7 +209,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 } @@ -216,7 +219,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 @@ -224,7 +227,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 } @@ -238,7 +241,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 } @@ -248,7 +251,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 @@ -256,7 +259,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 } @@ -270,7 +273,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 } @@ -280,7 +283,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 @@ -288,7 +291,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 } @@ -301,32 +304,40 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableVerifiableCredentialPrimingResponse struct { diff --git a/internal/httpclient/model_verifiable_credential_proof.go b/internal/httpclient/model_verifiable_credential_proof.go index 0e9bdf78a52..28eedafdb9e 100644 --- a/internal/httpclient/model_verifiable_credential_proof.go +++ b/internal/httpclient/model_verifiable_credential_proof.go @@ -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"` @@ -40,7 +43,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 } @@ -50,7 +53,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 @@ -58,7 +61,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 } @@ -72,7 +75,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 } @@ -82,7 +85,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 @@ -90,7 +93,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 } @@ -103,14 +106,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableVerifiableCredentialProof struct { diff --git a/internal/httpclient/model_verifiable_credential_response.go b/internal/httpclient/model_verifiable_credential_response.go index a1296ee5bc6..4c24842e668 100644 --- a/internal/httpclient/model_verifiable_credential_response.go +++ b/internal/httpclient/model_verifiable_credential_response.go @@ -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"` @@ -40,7 +43,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 } @@ -50,7 +53,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 @@ -58,7 +61,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 } @@ -72,7 +75,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 } @@ -82,7 +85,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 @@ -90,7 +93,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 } @@ -103,14 +106,22 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableVerifiableCredentialResponse struct { diff --git a/internal/httpclient/model_version.go b/internal/httpclient/model_version.go index 4e307b565e1..852862bcf07 100644 --- a/internal/httpclient/model_version.go +++ b/internal/httpclient/model_version.go @@ -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. @@ -40,7 +43,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 } @@ -50,7 +53,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 @@ -58,7 +61,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 } @@ -71,11 +74,19 @@ 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 } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableVersion struct { diff --git a/internal/httpclient/utils.go b/internal/httpclient/utils.go index 79275ec55ec..e56504bad62 100644 --- a/internal/httpclient/utils.go +++ b/internal/httpclient/utils.go @@ -13,6 +13,7 @@ package openapi 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) +} diff --git a/jwk/sdk_test.go b/jwk/sdk_test.go index 46d1cc81448..91c3d2bf14f 100644 --- a/jwk/sdk_test.go +++ b/jwk/sdk_test.go @@ -9,18 +9,15 @@ import ( "net/http/httptest" "testing" - "github.com/ory/hydra/v2/driver/config" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" hydra "github.com/ory/hydra-client-go/v2" - + "github.com/ory/hydra/v2/driver/config" "github.com/ory/hydra/v2/internal" + . "github.com/ory/hydra/v2/jwk" "github.com/ory/hydra/v2/x" "github.com/ory/x/contextx" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - . "github.com/ory/hydra/v2/jwk" ) func TestJWKSDK(t *testing.T) { @@ -100,6 +97,7 @@ func TestJWKSDK(t *testing.T) { resultKeys, _, err := sdk.JwkApi.CreateJsonWebKeySet(ctx, "set-foo2").CreateJsonWebKeySet(hydra.CreateJsonWebKeySet{ Alg: "RS256", Kid: "key-bar", + Use: "sig", }).Execute() require.NoError(t, err) require.Len(t, resultKeys.Keys, 1) diff --git a/openapitools.json b/openapitools.json index 54d00804a3d..64f2cbb5416 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "6.0.1" + "version": "7.2.0" } } diff --git a/package-lock.json b/package-lock.json index 374d7799f89..d43d3097448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "@oryd/hydra", "version": "0.0.0", "dependencies": { - "@openapitools/openapi-generator-cli": "^2.6.0", + "@openapitools/openapi-generator-cli": "^2.7.0", "conventional-changelog-cli": "~2.2.2", "doctoc": "^2.2.1" }, @@ -288,12 +288,12 @@ } }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.6.0.tgz", - "integrity": "sha512-M/aOpR7G+Y1nMf+ofuar8pGszajgfhs1aSPSijkcr2tHTxKAI3sA3YYcOGbszxaNRKFyvOcDq+KP9pcJvKoCHg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.7.0.tgz", + "integrity": "sha512-ieEpHTA/KsDz7ANw03lLPYyjdedDEXYEyYoGBRWdduqXWSX65CJtttjqa8ZaB1mNmIjMtchUHwAYQmTLVQ8HYg==", "hasInstallScript": true, "dependencies": { - "@nestjs/axios": "0.0.8", + "@nestjs/axios": "0.1.0", "@nestjs/common": "9.3.11", "@nestjs/core": "9.3.11", "@nuxtjs/opencollective": "0.3.2", @@ -322,14 +322,14 @@ } }, "node_modules/@openapitools/openapi-generator-cli/node_modules/@nestjs/axios": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-0.0.8.tgz", - "integrity": "sha512-oJyfR9/h9tVk776il0829xyj3b2e81yTu6HjPraxynwNtMNGqZBHHmAQL24yMB3tVbBM0RvG3eUXH8+pRCGwlg==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-0.1.0.tgz", + "integrity": "sha512-b2TT2X6BFbnNoeteiaxCIiHaFcSbVW+S5yygYqiIq5i6H77yIU3IVuLdpQkHq8/EqOWFwMopLN8jdkUT71Am9w==", "dependencies": { "axios": "0.27.2" }, "peerDependencies": { - "@nestjs/common": "^7.0.0 || ^8.0.0", + "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0", "reflect-metadata": "^0.1.12", "rxjs": "^6.0.0 || ^7.0.0" } @@ -3218,9 +3218,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "funding": [ { "type": "individual", @@ -4188,9 +4188,9 @@ } }, "node_modules/joi": { - "version": "17.9.2", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.9.2.tgz", - "integrity": "sha512-Itk/r+V4Dx0V3c7RLFdRh12IOjySm2/WGPMubBT92cQvRfYZhPM2W0hZlctjj72iES8jsRCwp7S/cRmWBnJ4nw==", + "version": "17.11.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", + "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", "dev": true, "dependencies": { "@hapi/hoek": "^9.0.0", @@ -7323,16 +7323,16 @@ } }, "node_modules/wait-on": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", - "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.2.0.tgz", + "integrity": "sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ==", "dev": true, "dependencies": { - "axios": "^0.27.2", - "joi": "^17.7.0", + "axios": "^1.6.1", + "joi": "^17.11.0", "lodash": "^4.17.21", - "minimist": "^1.2.7", - "rxjs": "^7.8.0" + "minimist": "^1.2.8", + "rxjs": "^7.8.1" }, "bin": { "wait-on": "bin/wait-on" @@ -7341,6 +7341,37 @@ "node": ">=12.0.0" } }, + "node_modules/wait-on/node_modules/axios": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", + "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/wait-on/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/wait-on/node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/wait-on/node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -7749,11 +7780,11 @@ } }, "@openapitools/openapi-generator-cli": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.6.0.tgz", - "integrity": "sha512-M/aOpR7G+Y1nMf+ofuar8pGszajgfhs1aSPSijkcr2tHTxKAI3sA3YYcOGbszxaNRKFyvOcDq+KP9pcJvKoCHg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.7.0.tgz", + "integrity": "sha512-ieEpHTA/KsDz7ANw03lLPYyjdedDEXYEyYoGBRWdduqXWSX65CJtttjqa8ZaB1mNmIjMtchUHwAYQmTLVQ8HYg==", "requires": { - "@nestjs/axios": "0.0.8", + "@nestjs/axios": "0.1.0", "@nestjs/common": "9.3.11", "@nestjs/core": "9.3.11", "@nuxtjs/opencollective": "0.3.2", @@ -7772,9 +7803,9 @@ }, "dependencies": { "@nestjs/axios": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-0.0.8.tgz", - "integrity": "sha512-oJyfR9/h9tVk776il0829xyj3b2e81yTu6HjPraxynwNtMNGqZBHHmAQL24yMB3tVbBM0RvG3eUXH8+pRCGwlg==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-0.1.0.tgz", + "integrity": "sha512-b2TT2X6BFbnNoeteiaxCIiHaFcSbVW+S5yygYqiIq5i6H77yIU3IVuLdpQkHq8/EqOWFwMopLN8jdkUT71Am9w==", "requires": { "axios": "0.27.2" } @@ -10001,9 +10032,9 @@ } }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==" }, "forever-agent": { "version": "0.6.1", @@ -10692,9 +10723,9 @@ "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==" }, "joi": { - "version": "17.9.2", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.9.2.tgz", - "integrity": "sha512-Itk/r+V4Dx0V3c7RLFdRh12IOjySm2/WGPMubBT92cQvRfYZhPM2W0hZlctjj72iES8jsRCwp7S/cRmWBnJ4nw==", + "version": "17.11.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", + "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", "dev": true, "requires": { "@hapi/hoek": "^9.0.0", @@ -13066,18 +13097,46 @@ } }, "wait-on": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", - "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.2.0.tgz", + "integrity": "sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ==", "dev": true, "requires": { - "axios": "^0.27.2", - "joi": "^17.7.0", + "axios": "^1.6.1", + "joi": "^17.11.0", "lodash": "^4.17.21", - "minimist": "^1.2.7", - "rxjs": "^7.8.0" + "minimist": "^1.2.8", + "rxjs": "^7.8.1" }, "dependencies": { + "axios": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", + "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", + "dev": true, + "requires": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", diff --git a/package.json b/package.json index 271ff39d7dd..d28c212ce57 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "prettier": "ory-prettier-styles", "dependencies": { - "@openapitools/openapi-generator-cli": "^2.6.0", + "@openapitools/openapi-generator-cli": "^2.7.0", "conventional-changelog-cli": "~2.2.2", "doctoc": "^2.2.1" },