diff --git a/composer.json b/composer.json index 90087215b2f..bdcfd087c69 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,6 @@ "ext-mbstring": "*" }, "autoload": { - "psr-4": { "Hydra\\SDK\\" : "sdk/php/swagger/" } + "psr-4": { "Hydra\\SDK\\" : "sdk/php/swagger/lib/" } } -} \ No newline at end of file +} diff --git a/docs/sdk/php.md b/docs/sdk/php.md new file mode 100644 index 00000000000..906773d269a --- /dev/null +++ b/docs/sdk/php.md @@ -0,0 +1,81 @@ +## PHP SDK + +### Installation + +Installation is best done using [composer](https://getcomposer.org/) + +``` +composer require ory/hydra-sdk +``` + +If your project doesn't already make use of composer, you will need to include the resulting `vendor/autoload.php` file. + +### Configuration + +#### OAuth2 configuration + +We need OAuth2 capabilities in order to make authorized API calls. You can either write your own OAuth2 mechanism or +use an existing one that has been preconfigured for use with Hydra. Here we use a modified version of the league OAuth2 +client that has had this work done for us. + +```sh +composer require tulip/oauth2-hydra +``` + +```php +// Get an access token using your account credentials. +// Note that if you are using the Hydra inside docker as per the getting started docs, the domain will be hydra:4444 from +// within another container. +$provider = new \Hydra\OAuth2\Provider\OAuth2([ + 'clientId' => 'admin', + 'clientSecret' => 'demo-password', + 'domain' => 'http://localhost:4444', +]); + +try { + // Get an access token using the client credentials grant. + // Note that you must separate multiple scopes with a plus (+) + $accessToken = $provider->getAccessToken( + 'client_credentials', ['scope' => 'hydra.clients'] + ); +} catch (\Hydra\Oauth2\Provider\Exception\ConnectionException $e) { + die("Connection to hydra failed: " . $e->getMessage()); +} catch (\Hydra\Oauth2\Provider\Exception\IdentityProviderException $e) { + die("Failed to get an access token: " . $e->getMessage()); +} + +``` + +#### SDK configuration + +Using `$accessToken` from the above steps, you may now use the Hydra SDK: + +```php +$config = new \Hydra\SDK\Configuration(); +$config->setHost('http://localhost:4444'); +// Use true in production! +$config->setSSLVerification(false); +$config->setAccessToken($accessToken); + +// Pass the config into an ApiClient. You will need this client in the next ste. +$hydraApiClient = new \Hydra\SDK\ApiClient($config); +``` + +### API Usage + +There are several APIs made available, see [../../sdk/php/swagger/README.md](The full API docs) for a list of clients and methods. + +For this example, lets use the OAuth2Api to get a list of clients and use the `$hydraApiClient` from above: + +```php +$hydraOAuth2Api = new \Hydra\SDK\Api\OAuth2Api($hydraApiClient); + +try { + $clients = $hydraOAuthSDK->listOAuth2Clients(); +} catch ( \Hydra\SDK\ApiException $e) { + if ($e->getCode() == 400) { + die("Permission denied to get clients. Check the scopes on your access token!"); + } + die("Failed to get clients: ".$e->getMessage()); +} +``` diff --git a/scripts/run-gensdk.sh b/scripts/run-gensdk.sh index 23ba8ac078b..47f9a567530 100755 --- a/scripts/run-gensdk.sh +++ b/scripts/run-gensdk.sh @@ -8,11 +8,14 @@ scripts/run-genswag.sh rm -rf ./sdk/go/hydra/swagger rm -rf ./sdk/js/swagger +rm -rf ./sdk/php/swagger # curl -O scripts/swagger-codegen-cli-2.2.3.jar http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar java -jar scripts/swagger-codegen-cli-2.2.3.jar generate -i ./docs/api.swagger.json -l go -o ./sdk/go/hydra/swagger java -jar scripts/swagger-codegen-cli-2.2.3.jar generate -i ./docs/api.swagger.json -l javascript -o ./sdk/js/swagger +java -jar scripts/swagger-codegen-cli-2.2.3.jar generate -i ./docs/api.swagger.json -l php -o sdk/php/ \ + --invoker-package Hydra\\SDK --git-repo-id swagger --git-user-id ory --additional-properties "packagePath=swagger,description=Client for Hydra" scripts/run-format.sh @@ -20,5 +23,7 @@ git checkout HEAD -- sdk/go/hydra/swagger/configuration.go git checkout HEAD -- sdk/go/hydra/swagger/api_client.go rm -f ./sdk/js/swagger/package.json rm -rf ./sdk/js/swagger/test +rm -f ./sdk/php/swagger/composer.json ./sdk/php/swagger/phpunit.xml.dist +rm -rf ./sdk/php/swagger/test npm run prettier diff --git a/sdk/php/.swagger-codegen-ignore b/sdk/php/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/sdk/php/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/sdk/php/.swagger-codegen/VERSION b/sdk/php/.swagger-codegen/VERSION new file mode 100644 index 00000000000..717311e32e3 --- /dev/null +++ b/sdk/php/.swagger-codegen/VERSION @@ -0,0 +1 @@ +unset \ No newline at end of file diff --git a/sdk/php/swagger/.php_cs b/sdk/php/swagger/.php_cs new file mode 100644 index 00000000000..6b8e23c818a --- /dev/null +++ b/sdk/php/swagger/.php_cs @@ -0,0 +1,18 @@ +level(Symfony\CS\FixerInterface::PSR2_LEVEL) + ->setUsingCache(true) + ->fixers( + [ + 'ordered_use', + 'phpdoc_order', + 'short_array_syntax', + 'strict', + 'strict_param' + ] + ) + ->finder( + Symfony\CS\Finder\DefaultFinder::create() + ->in(__DIR__) + ); diff --git a/sdk/php/swagger/.travis.yml b/sdk/php/swagger/.travis.yml new file mode 100644 index 00000000000..d77f3825f6f --- /dev/null +++ b/sdk/php/swagger/.travis.yml @@ -0,0 +1,10 @@ +language: php +sudo: false +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/sdk/php/swagger/README.md b/sdk/php/swagger/README.md new file mode 100644 index 00000000000..b0ff24d3a12 --- /dev/null +++ b/sdk/php/swagger/README.md @@ -0,0 +1,210 @@ +# swagger +Please refer to the user guide for in-depth documentation: https://ory.gitbooks.io/hydra/content/ Hydra offers OAuth 2.0 and OpenID Connect Core 1.0 capabilities as a service. Hydra is different, because it works with any existing authentication infrastructure, not just LDAP or SAML. By implementing a consent app (works with any programming language) you build a bridge between Hydra and your authentication infrastructure. Hydra is able to securely manage JSON Web Keys, and has a sophisticated policy-based access control you can use if you want to. Hydra is suitable for green- (new) and brownfield (existing) projects. If you are not familiar with OAuth 2.0 and are working on a greenfield project, we recommend evaluating if OAuth 2.0 really serves your purpose. Knowledge of OAuth 2.0 is imperative in understanding what Hydra does and how it works. The official repository is located at https://github.com/ory/hydra ### Important REST API Documentation Notes The swagger generator used to create this documentation does currently not support example responses. To see request and response payloads click on **\"Show JSON schema\"**: ![Enable JSON Schema on Apiary](https://storage.googleapis.com/ory.am/hydra/json-schema.png) The API documentation always refers to the latest tagged version of ORY Hydra. For previous API documentations, please refer to https://github.com/ory/hydra/blob//docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + +This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: Latest +- Build package: io.swagger.codegen.languages.PhpClientCodegen +For more information, please visit [https://www.ory.am](https://www.ory.am) + +## Requirements + +PHP 5.4.0 and later + +## Installation & Usage +### Composer + +To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: + +``` +{ + "repositories": [ + { + "type": "git", + "url": "https://github.com/ory/swagger.git" + } + ], + "require": { + "ory/swagger": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php + require_once('/path/to/swagger/autoload.php'); +``` + +## Tests + +To run the unit tests: + +``` +composer install +./vendor/bin/phpunit +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\HealthApi(); + +try { + $api_instance->getInstanceMetrics(); +} catch (Exception $e) { + echo 'Exception when calling HealthApi->getInstanceMetrics: ', $e->getMessage(), PHP_EOL; +} + +?> +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*HealthApi* | [**getInstanceMetrics**](docs/Api/HealthApi.md#getinstancemetrics) | **GET** /health/metrics | Show instance metrics (experimental) +*HealthApi* | [**getInstanceStatus**](docs/Api/HealthApi.md#getinstancestatus) | **GET** /health/status | Check health status of this instance +*JsonWebKeyApi* | [**createJsonWebKeySet**](docs/Api/JsonWebKeyApi.md#createjsonwebkeyset) | **POST** /keys/{set} | Generate a new JSON Web Key +*JsonWebKeyApi* | [**deleteJsonWebKey**](docs/Api/JsonWebKeyApi.md#deletejsonwebkey) | **DELETE** /keys/{set}/{kid} | Delete a JSON Web Key +*JsonWebKeyApi* | [**deleteJsonWebKeySet**](docs/Api/JsonWebKeyApi.md#deletejsonwebkeyset) | **DELETE** /keys/{set} | Delete a JSON Web Key +*JsonWebKeyApi* | [**getJsonWebKey**](docs/Api/JsonWebKeyApi.md#getjsonwebkey) | **GET** /keys/{set}/{kid} | Retrieve a JSON Web Key +*JsonWebKeyApi* | [**getJsonWebKeySet**](docs/Api/JsonWebKeyApi.md#getjsonwebkeyset) | **GET** /keys/{set} | Retrieve a JSON Web Key Set +*JsonWebKeyApi* | [**updateJsonWebKey**](docs/Api/JsonWebKeyApi.md#updatejsonwebkey) | **PUT** /keys/{set}/{kid} | Update a JSON Web Key +*JsonWebKeyApi* | [**updateJsonWebKeySet**](docs/Api/JsonWebKeyApi.md#updatejsonwebkeyset) | **PUT** /keys/{set} | Update a JSON Web Key Set +*OAuth2Api* | [**acceptOAuth2ConsentRequest**](docs/Api/OAuth2Api.md#acceptoauth2consentrequest) | **PATCH** /oauth2/consent/requests/{id}/accept | Accept a consent request +*OAuth2Api* | [**createOAuth2Client**](docs/Api/OAuth2Api.md#createoauth2client) | **POST** /clients | Create an OAuth 2.0 client +*OAuth2Api* | [**deleteOAuth2Client**](docs/Api/OAuth2Api.md#deleteoauth2client) | **DELETE** /clients/{id} | Deletes an OAuth 2.0 Client +*OAuth2Api* | [**getOAuth2Client**](docs/Api/OAuth2Api.md#getoauth2client) | **GET** /clients/{id} | Retrieve an OAuth 2.0 Client. +*OAuth2Api* | [**getOAuth2ConsentRequest**](docs/Api/OAuth2Api.md#getoauth2consentrequest) | **GET** /oauth2/consent/requests/{id} | Receive consent request information +*OAuth2Api* | [**getWellKnown**](docs/Api/OAuth2Api.md#getwellknown) | **GET** /.well-known/openid-configuration | Server well known configuration +*OAuth2Api* | [**introspectOAuth2Token**](docs/Api/OAuth2Api.md#introspectoauth2token) | **POST** /oauth2/introspect | Introspect OAuth2 tokens +*OAuth2Api* | [**listOAuth2Clients**](docs/Api/OAuth2Api.md#listoauth2clients) | **GET** /clients | List OAuth 2.0 Clients +*OAuth2Api* | [**oauthAuth**](docs/Api/OAuth2Api.md#oauthauth) | **GET** /oauth2/auth | The OAuth 2.0 authorize endpoint +*OAuth2Api* | [**oauthToken**](docs/Api/OAuth2Api.md#oauthtoken) | **POST** /oauth2/token | The OAuth 2.0 token endpoint +*OAuth2Api* | [**rejectOAuth2ConsentRequest**](docs/Api/OAuth2Api.md#rejectoauth2consentrequest) | **PATCH** /oauth2/consent/requests/{id}/reject | Reject a consent request +*OAuth2Api* | [**revokeOAuth2Token**](docs/Api/OAuth2Api.md#revokeoauth2token) | **POST** /oauth2/revoke | Revoke OAuth2 tokens +*OAuth2Api* | [**updateOAuth2Client**](docs/Api/OAuth2Api.md#updateoauth2client) | **PUT** /clients/{id} | Update an OAuth 2.0 Client +*OAuth2Api* | [**userinfo**](docs/Api/OAuth2Api.md#userinfo) | **POST** /userinfo | OpenID Connect Userinfo +*OAuth2Api* | [**wellKnown**](docs/Api/OAuth2Api.md#wellknown) | **GET** /.well-known/jwks.json | Get list of well known JSON Web Keys +*PolicyApi* | [**createPolicy**](docs/Api/PolicyApi.md#createpolicy) | **POST** /policies | Create an Access Control Policy +*PolicyApi* | [**deletePolicy**](docs/Api/PolicyApi.md#deletepolicy) | **DELETE** /policies/{id} | Delete an Access Control Policy +*PolicyApi* | [**getPolicy**](docs/Api/PolicyApi.md#getpolicy) | **GET** /policies/{id} | Get an Access Control Policy +*PolicyApi* | [**listPolicies**](docs/Api/PolicyApi.md#listpolicies) | **GET** /policies | List Access Control Policies +*PolicyApi* | [**updatePolicy**](docs/Api/PolicyApi.md#updatepolicy) | **PUT** /policies/{id} | Update an Access Control Polic +*WardenApi* | [**addMembersToGroup**](docs/Api/WardenApi.md#addmemberstogroup) | **POST** /warden/groups/{id}/members | Add members to a group +*WardenApi* | [**createGroup**](docs/Api/WardenApi.md#creategroup) | **POST** /warden/groups | Create a group +*WardenApi* | [**deleteGroup**](docs/Api/WardenApi.md#deletegroup) | **DELETE** /warden/groups/{id} | Delete a group by id +*WardenApi* | [**doesWardenAllowAccessRequest**](docs/Api/WardenApi.md#doeswardenallowaccessrequest) | **POST** /warden/allowed | Check if an access request is valid (without providing an access token) +*WardenApi* | [**doesWardenAllowTokenAccessRequest**](docs/Api/WardenApi.md#doeswardenallowtokenaccessrequest) | **POST** /warden/token/allowed | Check if an access request is valid (providing an access token) +*WardenApi* | [**getGroup**](docs/Api/WardenApi.md#getgroup) | **GET** /warden/groups/{id} | Get a group by id +*WardenApi* | [**listGroups**](docs/Api/WardenApi.md#listgroups) | **GET** /warden/groups | List groups +*WardenApi* | [**removeMembersFromGroup**](docs/Api/WardenApi.md#removemembersfromgroup) | **DELETE** /warden/groups/{id}/members | Remove members from a group + + +## Documentation For Models + + - [ConsentRequest](docs/Model/ConsentRequest.md) + - [ConsentRequestAcceptance](docs/Model/ConsentRequestAcceptance.md) + - [ConsentRequestManager](docs/Model/ConsentRequestManager.md) + - [ConsentRequestRejection](docs/Model/ConsentRequestRejection.md) + - [Context](docs/Model/Context.md) + - [Firewall](docs/Model/Firewall.md) + - [Group](docs/Model/Group.md) + - [GroupMembers](docs/Model/GroupMembers.md) + - [Handler](docs/Model/Handler.md) + - [InlineResponse200](docs/Model/InlineResponse200.md) + - [InlineResponse2001](docs/Model/InlineResponse2001.md) + - [InlineResponse401](docs/Model/InlineResponse401.md) + - [JoseWebKeySetRequest](docs/Model/JoseWebKeySetRequest.md) + - [JsonWebKey](docs/Model/JsonWebKey.md) + - [JsonWebKeySet](docs/Model/JsonWebKeySet.md) + - [JsonWebKeySetGeneratorRequest](docs/Model/JsonWebKeySetGeneratorRequest.md) + - [KeyGenerator](docs/Model/KeyGenerator.md) + - [Manager](docs/Model/Manager.md) + - [OAuth2Client](docs/Model/OAuth2Client.md) + - [OAuth2ConsentRequest](docs/Model/OAuth2ConsentRequest.md) + - [OAuth2TokenIntrospection](docs/Model/OAuth2TokenIntrospection.md) + - [Policy](docs/Model/Policy.md) + - [PolicyConditions](docs/Model/PolicyConditions.md) + - [RawMessage](docs/Model/RawMessage.md) + - [SwaggerAcceptConsentRequest](docs/Model/SwaggerAcceptConsentRequest.md) + - [SwaggerCreatePolicyParameters](docs/Model/SwaggerCreatePolicyParameters.md) + - [SwaggerDoesWardenAllowAccessRequestParameters](docs/Model/SwaggerDoesWardenAllowAccessRequestParameters.md) + - [SwaggerDoesWardenAllowTokenAccessRequestParameters](docs/Model/SwaggerDoesWardenAllowTokenAccessRequestParameters.md) + - [SwaggerGetPolicyParameters](docs/Model/SwaggerGetPolicyParameters.md) + - [SwaggerJsonWebKeyQuery](docs/Model/SwaggerJsonWebKeyQuery.md) + - [SwaggerJwkCreateSet](docs/Model/SwaggerJwkCreateSet.md) + - [SwaggerJwkSetQuery](docs/Model/SwaggerJwkSetQuery.md) + - [SwaggerJwkUpdateSet](docs/Model/SwaggerJwkUpdateSet.md) + - [SwaggerJwkUpdateSetKey](docs/Model/SwaggerJwkUpdateSetKey.md) + - [SwaggerListPolicyParameters](docs/Model/SwaggerListPolicyParameters.md) + - [SwaggerListPolicyResponse](docs/Model/SwaggerListPolicyResponse.md) + - [SwaggerOAuthConsentRequest](docs/Model/SwaggerOAuthConsentRequest.md) + - [SwaggerOAuthConsentRequestPayload](docs/Model/SwaggerOAuthConsentRequestPayload.md) + - [SwaggerOAuthIntrospectionRequest](docs/Model/SwaggerOAuthIntrospectionRequest.md) + - [SwaggerOAuthIntrospectionResponse](docs/Model/SwaggerOAuthIntrospectionResponse.md) + - [SwaggerOAuthTokenResponse](docs/Model/SwaggerOAuthTokenResponse.md) + - [SwaggerOAuthTokenResponseBody](docs/Model/SwaggerOAuthTokenResponseBody.md) + - [SwaggerRejectConsentRequest](docs/Model/SwaggerRejectConsentRequest.md) + - [SwaggerRevokeOAuth2TokenParameters](docs/Model/SwaggerRevokeOAuth2TokenParameters.md) + - [SwaggerUpdatePolicyParameters](docs/Model/SwaggerUpdatePolicyParameters.md) + - [SwaggerWardenAccessRequestResponseParameters](docs/Model/SwaggerWardenAccessRequestResponseParameters.md) + - [SwaggerWardenTokenAccessRequestResponse](docs/Model/SwaggerWardenTokenAccessRequestResponse.md) + - [SwaggeruserinfoResponse](docs/Model/SwaggeruserinfoResponse.md) + - [SwaggeruserinfoResponsePayload](docs/Model/SwaggeruserinfoResponsePayload.md) + - [TokenAllowedRequest](docs/Model/TokenAllowedRequest.md) + - [WardenAccessRequest](docs/Model/WardenAccessRequest.md) + - [WardenAccessRequestResponse](docs/Model/WardenAccessRequestResponse.md) + - [WardenTokenAccessRequest](docs/Model/WardenTokenAccessRequest.md) + - [WardenTokenAccessRequestResponse](docs/Model/WardenTokenAccessRequestResponse.md) + - [WellKnown](docs/Model/WellKnown.md) + - [Writer](docs/Model/Writer.md) + + +## Documentation For Authorization + + +## basic + +- **Type**: HTTP basic authentication + +## oauth2 + +- **Type**: OAuth +- **Flow**: accessCode +- **Authorization URL**: https://your-hydra-instance.com/oauth2/auth +- **Scopes**: + - **hydra.clients**: A scope required to manage OAuth 2.0 Clients + - **hydra.consent**: A scope required to fetch and modify consent requests + - **hydra.health**: A scope required to get health information + - **hydra.keys.create**: A scope required to create JSON Web Keys + - **hydra.keys.delete**: A scope required to delete JSON Web Keys + - **hydra.keys.get**: A scope required to fetch JSON Web Keys + - **hydra.keys.update**: A scope required to get JSON Web Keys + - **hydra.policies**: A scope required to manage access control policies + - **hydra.warden**: A scope required to make access control inquiries + - **hydra.warden.groups**: A scope required to manage warden groups + - **offline**: A scope required when requesting refresh tokens + - **openid**: Request an OpenID Connect ID Token + + +## Author + +hi@ory.am + + diff --git a/sdk/php/swagger/autoload.php b/sdk/php/swagger/autoload.php new file mode 100644 index 00000000000..0bb582b4018 --- /dev/null +++ b/sdk/php/swagger/autoload.php @@ -0,0 +1,54 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * An example of a project-specific implementation. + * + * After registering this autoload function with SPL, the following line + * would cause the function to attempt to load the \Hydra\SDK\Baz\Qux class + * from /path/to/project/lib/Baz/Qux.php: + * + * new \Hydra\SDK\Baz\Qux; + * + * @param string $class The fully-qualified class name. + * + * @return void + */ +spl_autoload_register(function ($class) { + + // project-specific namespace prefix + $prefix = 'Hydra\\SDK\\'; + + // base directory for the namespace prefix + $base_dir = __DIR__ . '/lib/'; + + // does the class use the namespace prefix? + $len = strlen($prefix); + if (strncmp($prefix, $class, $len) !== 0) { + // no, move to the next registered autoloader + return; + } + + // get the relative class name + $relative_class = substr($class, $len); + + // replace the namespace prefix with the base directory, replace namespace + // separators with directory separators in the relative class name, append + // with .php + $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; + + // if the file exists, require it + if (file_exists($file)) { + require $file; + } +}); diff --git a/sdk/php/swagger/docs/Api/HealthApi.md b/sdk/php/swagger/docs/Api/HealthApi.md new file mode 100644 index 00000000000..a4b2c9119a2 --- /dev/null +++ b/sdk/php/swagger/docs/Api/HealthApi.md @@ -0,0 +1,95 @@ +# Hydra\SDK\HealthApi +Client for Hydra + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getInstanceMetrics**](HealthApi.md#getInstanceMetrics) | **GET** /health/metrics | Show instance metrics (experimental) +[**getInstanceStatus**](HealthApi.md#getInstanceStatus) | **GET** /health/status | Check health status of this instance + + +# **getInstanceMetrics** +> getInstanceMetrics() + +Show instance metrics (experimental) + +This endpoint returns an instance's metrics, such as average response time, status code distribution, hits per second and so on. The return values are currently not documented as this endpoint is still experimental. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:health:stats\"], \"actions\": [\"get\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\HealthApi(); + +try { + $api_instance->getInstanceMetrics(); +} catch (Exception $e) { + echo 'Exception when calling HealthApi->getInstanceMetrics: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getInstanceStatus** +> \Hydra\SDK\Model\InlineResponse200 getInstanceStatus() + +Check health status of this instance + +This endpoint returns `{ \"status\": \"ok\" }`. This status let's you know that the HTTP server is up and running. This status does currently not include checks whether the database connection is up and running. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is 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. + +### Example +```php +getInstanceStatus(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HealthApi->getInstanceStatus: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Hydra\SDK\Model\InlineResponse200**](../Model/InlineResponse200.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/sdk/php/swagger/docs/Api/JsonWebKeyApi.md b/sdk/php/swagger/docs/Api/JsonWebKeyApi.md new file mode 100644 index 00000000000..144de7f1a02 --- /dev/null +++ b/sdk/php/swagger/docs/Api/JsonWebKeyApi.md @@ -0,0 +1,362 @@ +# Hydra\SDK\JsonWebKeyApi +Client for Hydra + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createJsonWebKeySet**](JsonWebKeyApi.md#createJsonWebKeySet) | **POST** /keys/{set} | Generate a new JSON Web Key +[**deleteJsonWebKey**](JsonWebKeyApi.md#deleteJsonWebKey) | **DELETE** /keys/{set}/{kid} | Delete a JSON Web Key +[**deleteJsonWebKeySet**](JsonWebKeyApi.md#deleteJsonWebKeySet) | **DELETE** /keys/{set} | Delete a JSON Web Key +[**getJsonWebKey**](JsonWebKeyApi.md#getJsonWebKey) | **GET** /keys/{set}/{kid} | Retrieve a JSON Web Key +[**getJsonWebKeySet**](JsonWebKeyApi.md#getJsonWebKeySet) | **GET** /keys/{set} | Retrieve a JSON Web Key Set +[**updateJsonWebKey**](JsonWebKeyApi.md#updateJsonWebKey) | **PUT** /keys/{set}/{kid} | Update a JSON Web Key +[**updateJsonWebKeySet**](JsonWebKeyApi.md#updateJsonWebKeySet) | **PUT** /keys/{set} | Update a JSON Web Key Set + + +# **createJsonWebKeySet** +> \Hydra\SDK\Model\JsonWebKeySet createJsonWebKeySet($set, $body) + +Generate a new JSON Web Key + +This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys (RS256, ECDSA). If the specified JSON Web Key Set does not exist, it will be created. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys::\"], \"actions\": [\"create\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\JsonWebKeyApi(); +$set = "set_example"; // string | The set +$body = new \Hydra\SDK\Model\JsonWebKeySetGeneratorRequest(); // \Hydra\SDK\Model\JsonWebKeySetGeneratorRequest | + +try { + $result = $api_instance->createJsonWebKeySet($set, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JsonWebKeyApi->createJsonWebKeySet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **set** | **string**| The set | + **body** | [**\Hydra\SDK\Model\JsonWebKeySetGeneratorRequest**](../Model/JsonWebKeySetGeneratorRequest.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\JsonWebKeySet**](../Model/JsonWebKeySet.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteJsonWebKey** +> deleteJsonWebKey($kid, $set) + +Delete a JSON Web Key + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys::\"], \"actions\": [\"delete\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\JsonWebKeyApi(); +$kid = "kid_example"; // string | The kid of the desired key +$set = "set_example"; // string | The set + +try { + $api_instance->deleteJsonWebKey($kid, $set); +} catch (Exception $e) { + echo 'Exception when calling JsonWebKeyApi->deleteJsonWebKey: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **kid** | **string**| The kid of the desired key | + **set** | **string**| The set | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteJsonWebKeySet** +> deleteJsonWebKeySet($set) + +Delete a JSON Web Key + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys:\"], \"actions\": [\"delete\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\JsonWebKeyApi(); +$set = "set_example"; // string | The set + +try { + $api_instance->deleteJsonWebKeySet($set); +} catch (Exception $e) { + echo 'Exception when calling JsonWebKeyApi->deleteJsonWebKeySet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **set** | **string**| The set | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getJsonWebKey** +> \Hydra\SDK\Model\JsonWebKeySet getJsonWebKey($kid, $set) + +Retrieve a JSON Web Key + +This endpoint can be used to retrieve JWKs stored in ORY Hydra. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys::\"], \"actions\": [\"get\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\JsonWebKeyApi(); +$kid = "kid_example"; // string | The kid of the desired key +$set = "set_example"; // string | The set + +try { + $result = $api_instance->getJsonWebKey($kid, $set); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JsonWebKeyApi->getJsonWebKey: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **kid** | **string**| The kid of the desired key | + **set** | **string**| The set | + +### Return type + +[**\Hydra\SDK\Model\JsonWebKeySet**](../Model/JsonWebKeySet.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getJsonWebKeySet** +> \Hydra\SDK\Model\JsonWebKeySet getJsonWebKeySet($set) + +Retrieve a JSON Web Key Set + +This endpoint can be used to retrieve JWK Sets stored in ORY Hydra. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys::\"], \"actions\": [\"get\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\JsonWebKeyApi(); +$set = "set_example"; // string | The set + +try { + $result = $api_instance->getJsonWebKeySet($set); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JsonWebKeyApi->getJsonWebKeySet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **set** | **string**| The set | + +### Return type + +[**\Hydra\SDK\Model\JsonWebKeySet**](../Model/JsonWebKeySet.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateJsonWebKey** +> \Hydra\SDK\Model\JsonWebKey updateJsonWebKey($kid, $set, $body) + +Update a JSON Web Key + +Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys::\"], \"actions\": [\"update\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\JsonWebKeyApi(); +$kid = "kid_example"; // string | The kid of the desired key +$set = "set_example"; // string | The set +$body = new \Hydra\SDK\Model\JsonWebKey(); // \Hydra\SDK\Model\JsonWebKey | + +try { + $result = $api_instance->updateJsonWebKey($kid, $set, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JsonWebKeyApi->updateJsonWebKey: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **kid** | **string**| The kid of the desired key | + **set** | **string**| The set | + **body** | [**\Hydra\SDK\Model\JsonWebKey**](../Model/JsonWebKey.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\JsonWebKey**](../Model/JsonWebKey.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateJsonWebKeySet** +> \Hydra\SDK\Model\JsonWebKeySet updateJsonWebKeySet($set, $body) + +Update a JSON Web Key Set + +Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys:\"], \"actions\": [\"update\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\JsonWebKeyApi(); +$set = "set_example"; // string | The set +$body = new \Hydra\SDK\Model\JsonWebKeySet(); // \Hydra\SDK\Model\JsonWebKeySet | + +try { + $result = $api_instance->updateJsonWebKeySet($set, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JsonWebKeyApi->updateJsonWebKeySet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **set** | **string**| The set | + **body** | [**\Hydra\SDK\Model\JsonWebKeySet**](../Model/JsonWebKeySet.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\JsonWebKeySet**](../Model/JsonWebKeySet.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/sdk/php/swagger/docs/Api/OAuth2Api.md b/sdk/php/swagger/docs/Api/OAuth2Api.md new file mode 100644 index 00000000000..0772a8dd68c --- /dev/null +++ b/sdk/php/swagger/docs/Api/OAuth2Api.md @@ -0,0 +1,724 @@ +# Hydra\SDK\OAuth2Api +Client for Hydra + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**acceptOAuth2ConsentRequest**](OAuth2Api.md#acceptOAuth2ConsentRequest) | **PATCH** /oauth2/consent/requests/{id}/accept | Accept a consent request +[**createOAuth2Client**](OAuth2Api.md#createOAuth2Client) | **POST** /clients | Create an OAuth 2.0 client +[**deleteOAuth2Client**](OAuth2Api.md#deleteOAuth2Client) | **DELETE** /clients/{id} | Deletes an OAuth 2.0 Client +[**getOAuth2Client**](OAuth2Api.md#getOAuth2Client) | **GET** /clients/{id} | Retrieve an OAuth 2.0 Client. +[**getOAuth2ConsentRequest**](OAuth2Api.md#getOAuth2ConsentRequest) | **GET** /oauth2/consent/requests/{id} | Receive consent request information +[**getWellKnown**](OAuth2Api.md#getWellKnown) | **GET** /.well-known/openid-configuration | Server well known configuration +[**introspectOAuth2Token**](OAuth2Api.md#introspectOAuth2Token) | **POST** /oauth2/introspect | Introspect OAuth2 tokens +[**listOAuth2Clients**](OAuth2Api.md#listOAuth2Clients) | **GET** /clients | List OAuth 2.0 Clients +[**oauthAuth**](OAuth2Api.md#oauthAuth) | **GET** /oauth2/auth | The OAuth 2.0 authorize endpoint +[**oauthToken**](OAuth2Api.md#oauthToken) | **POST** /oauth2/token | The OAuth 2.0 token endpoint +[**rejectOAuth2ConsentRequest**](OAuth2Api.md#rejectOAuth2ConsentRequest) | **PATCH** /oauth2/consent/requests/{id}/reject | Reject a consent request +[**revokeOAuth2Token**](OAuth2Api.md#revokeOAuth2Token) | **POST** /oauth2/revoke | Revoke OAuth2 tokens +[**updateOAuth2Client**](OAuth2Api.md#updateOAuth2Client) | **PUT** /clients/{id} | Update an OAuth 2.0 Client +[**userinfo**](OAuth2Api.md#userinfo) | **POST** /userinfo | OpenID Connect Userinfo +[**wellKnown**](OAuth2Api.md#wellKnown) | **GET** /.well-known/jwks.json | Get list of well known JSON Web Keys + + +# **acceptOAuth2ConsentRequest** +> acceptOAuth2ConsentRequest($id, $body) + +Accept a consent request + +Call this endpoint to accept a consent request. This usually happens when a user agrees to give access rights to an application. The consent request id is usually transmitted via the URL query `consent`. For example: `http://consent-app.mydomain.com/?consent=1234abcd` The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:oauth2:consent:requests:\"], \"actions\": [\"accept\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$id = "id_example"; // string | +$body = new \Hydra\SDK\Model\ConsentRequestAcceptance(); // \Hydra\SDK\Model\ConsentRequestAcceptance | + +try { + $api_instance->acceptOAuth2ConsentRequest($id, $body); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->acceptOAuth2ConsentRequest: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| | + **body** | [**\Hydra\SDK\Model\ConsentRequestAcceptance**](../Model/ConsentRequestAcceptance.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **createOAuth2Client** +> \Hydra\SDK\Model\OAuth2Client createOAuth2Client($body) + +Create an OAuth 2.0 client + +If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:clients\"], \"actions\": [\"create\"], \"effect\": \"allow\" } ``` Additionally, the context key \"owner\" is set to the owner of the client, allowing policies such as: ``` { \"resources\": [\"rn:hydra:clients\"], \"actions\": [\"create\"], \"effect\": \"allow\", \"conditions\": { \"owner\": { \"type\": \"EqualsSubjectCondition\" } } } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$body = new \Hydra\SDK\Model\OAuth2Client(); // \Hydra\SDK\Model\OAuth2Client | + +try { + $result = $api_instance->createOAuth2Client($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->createOAuth2Client: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Hydra\SDK\Model\OAuth2Client**](../Model/OAuth2Client.md)| | + +### Return type + +[**\Hydra\SDK\Model\OAuth2Client**](../Model/OAuth2Client.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteOAuth2Client** +> deleteOAuth2Client($id) + +Deletes an OAuth 2.0 Client + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:clients:\"], \"actions\": [\"delete\"], \"effect\": \"allow\" } ``` Additionally, the context key \"owner\" is set to the owner of the client, allowing policies such as: ``` { \"resources\": [\"rn:hydra:clients:\"], \"actions\": [\"delete\"], \"effect\": \"allow\", \"conditions\": { \"owner\": { \"type\": \"EqualsSubjectCondition\" } } } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$id = "id_example"; // string | The id of the OAuth 2.0 Client. + +try { + $api_instance->deleteOAuth2Client($id); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->deleteOAuth2Client: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the OAuth 2.0 Client. | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getOAuth2Client** +> \Hydra\SDK\Model\OAuth2Client getOAuth2Client($id) + +Retrieve an OAuth 2.0 Client. + +This endpoint never returns passwords. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:clients:\"], \"actions\": [\"get\"], \"effect\": \"allow\" } ``` Additionally, the context key \"owner\" is set to the owner of the client, allowing policies such as: ``` { \"resources\": [\"rn:hydra:clients:\"], \"actions\": [\"get\"], \"effect\": \"allow\", \"conditions\": { \"owner\": { \"type\": \"EqualsSubjectCondition\" } } } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$id = "id_example"; // string | The id of the OAuth 2.0 Client. + +try { + $result = $api_instance->getOAuth2Client($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->getOAuth2Client: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the OAuth 2.0 Client. | + +### Return type + +[**\Hydra\SDK\Model\OAuth2Client**](../Model/OAuth2Client.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getOAuth2ConsentRequest** +> \Hydra\SDK\Model\OAuth2ConsentRequest getOAuth2ConsentRequest($id) + +Receive consent request information + +Call this endpoint to receive information on consent requests. The consent request id is usually transmitted via the URL query `consent`. For example: `http://consent-app.mydomain.com/?consent=1234abcd` The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:oauth2:consent:requests:\"], \"actions\": [\"get\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$id = "id_example"; // string | The id of the OAuth 2.0 Consent Request. + +try { + $result = $api_instance->getOAuth2ConsentRequest($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->getOAuth2ConsentRequest: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the OAuth 2.0 Consent Request. | + +### Return type + +[**\Hydra\SDK\Model\OAuth2ConsentRequest**](../Model/OAuth2ConsentRequest.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getWellKnown** +> \Hydra\SDK\Model\WellKnown getWellKnown() + +Server well known configuration + +The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage you to not roll your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn more on this flow at https://openid.net/specs/openid-connect-discovery-1_0.html + +### Example +```php +getWellKnown(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->getWellKnown: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Hydra\SDK\Model\WellKnown**](../Model/WellKnown.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **introspectOAuth2Token** +> \Hydra\SDK\Model\OAuth2TokenIntrospection introspectOAuth2Token($token, $scope) + +Introspect OAuth2 tokens + +The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. You can set additional data for a token by setting `accessTokenExtra` during the consent flow. ``` { \"resources\": [\"rn:hydra:oauth2:tokens\"], \"actions\": [\"introspect\"], \"effect\": \"allow\" } ``` + +### Example +```php +setUsername('YOUR_USERNAME'); +Hydra\SDK\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD'); +// Configure OAuth2 access token for authorization: oauth2 +Hydra\SDK\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$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 [RFC6749], Section 5.1. This endpoint DOES NOT accept refresh tokens for validation. +$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. + +try { + $result = $api_instance->introspectOAuth2Token($token, $scope); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->introspectOAuth2Token: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **token** | **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 [RFC6749], Section 5.1. This endpoint DOES NOT accept refresh tokens for validation. | + **scope** | **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] + +### Return type + +[**\Hydra\SDK\Model\OAuth2TokenIntrospection**](../Model/OAuth2TokenIntrospection.md) + +### Authorization + +[basic](../../README.md#basic), [oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **listOAuth2Clients** +> \Hydra\SDK\Model\OAuth2Client[] listOAuth2Clients() + +List OAuth 2.0 Clients + +This endpoint never returns passwords. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:clients\"], \"actions\": [\"get\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); + +try { + $result = $api_instance->listOAuth2Clients(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->listOAuth2Clients: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Hydra\SDK\Model\OAuth2Client[]**](../Model/OAuth2Client.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **oauthAuth** +> oauthAuth() + +The OAuth 2.0 authorize endpoint + +This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. OAuth2 is a very popular protocol and a library for your programming language will exists. To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749 + +### Example +```php +oauthAuth(); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->oauthAuth: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **oauthToken** +> \Hydra\SDK\Model\InlineResponse2001 oauthToken() + +The OAuth 2.0 token endpoint + +This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. OAuth2 is a very popular protocol and a library for your programming language will exists. To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749 + +### Example +```php +setUsername('YOUR_USERNAME'); +Hydra\SDK\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD'); +// Configure OAuth2 access token for authorization: oauth2 +Hydra\SDK\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); + +try { + $result = $api_instance->oauthToken(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->oauthToken: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Hydra\SDK\Model\InlineResponse2001**](../Model/InlineResponse2001.md) + +### Authorization + +[basic](../../README.md#basic), [oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **rejectOAuth2ConsentRequest** +> rejectOAuth2ConsentRequest($id, $body) + +Reject a consent request + +Call this endpoint to reject a consent request. This usually happens when a user denies access rights to an application. The consent request id is usually transmitted via the URL query `consent`. For example: `http://consent-app.mydomain.com/?consent=1234abcd` The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:oauth2:consent:requests:\"], \"actions\": [\"reject\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$id = "id_example"; // string | +$body = new \Hydra\SDK\Model\ConsentRequestRejection(); // \Hydra\SDK\Model\ConsentRequestRejection | + +try { + $api_instance->rejectOAuth2ConsentRequest($id, $body); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->rejectOAuth2ConsentRequest: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| | + **body** | [**\Hydra\SDK\Model\ConsentRequestRejection**](../Model/ConsentRequestRejection.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **revokeOAuth2Token** +> revokeOAuth2Token($token) + +Revoke OAuth2 tokens + +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. + +### Example +```php +setUsername('YOUR_USERNAME'); +Hydra\SDK\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$token = "token_example"; // string | + +try { + $api_instance->revokeOAuth2Token($token); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->revokeOAuth2Token: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **token** | **string**| | + +### Return type + +void (empty response body) + +### Authorization + +[basic](../../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updateOAuth2Client** +> \Hydra\SDK\Model\OAuth2Client updateOAuth2Client($id, $body) + +Update an OAuth 2.0 Client + +If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:clients\"], \"actions\": [\"update\"], \"effect\": \"allow\" } ``` Additionally, the context key \"owner\" is set to the owner of the client, allowing policies such as: ``` { \"resources\": [\"rn:hydra:clients\"], \"actions\": [\"update\"], \"effect\": \"allow\", \"conditions\": { \"owner\": { \"type\": \"EqualsSubjectCondition\" } } } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); +$id = "id_example"; // string | +$body = new \Hydra\SDK\Model\OAuth2Client(); // \Hydra\SDK\Model\OAuth2Client | + +try { + $result = $api_instance->updateOAuth2Client($id, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->updateOAuth2Client: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| | + **body** | [**\Hydra\SDK\Model\OAuth2Client**](../Model/OAuth2Client.md)| | + +### Return type + +[**\Hydra\SDK\Model\OAuth2Client**](../Model/OAuth2Client.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **userinfo** +> \Hydra\SDK\Model\SwaggeruserinfoResponsePayload userinfo() + +OpenID Connect Userinfo + +This endpoint returns the payload of the ID Token, including the idTokenExtra values, of the provided OAuth 2.0 access token. The endpoint implements http://openid.net/specs/openid-connect-core-1_0.html#UserInfo . + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); + +try { + $result = $api_instance->userinfo(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->userinfo: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Hydra\SDK\Model\SwaggeruserinfoResponsePayload**](../Model/SwaggeruserinfoResponsePayload.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **wellKnown** +> \Hydra\SDK\Model\JsonWebKeySet wellKnown() + +Get list of well known JSON Web Keys + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:keys:hydra.openid.id-token:public\"], \"actions\": [\"GET\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\OAuth2Api(); + +try { + $result = $api_instance->wellKnown(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OAuth2Api->wellKnown: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Hydra\SDK\Model\JsonWebKeySet**](../Model/JsonWebKeySet.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/sdk/php/swagger/docs/Api/PolicyApi.md b/sdk/php/swagger/docs/Api/PolicyApi.md new file mode 100644 index 00000000000..2ca336c2d48 --- /dev/null +++ b/sdk/php/swagger/docs/Api/PolicyApi.md @@ -0,0 +1,257 @@ +# Hydra\SDK\PolicyApi +Client for Hydra + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createPolicy**](PolicyApi.md#createPolicy) | **POST** /policies | Create an Access Control Policy +[**deletePolicy**](PolicyApi.md#deletePolicy) | **DELETE** /policies/{id} | Delete an Access Control Policy +[**getPolicy**](PolicyApi.md#getPolicy) | **GET** /policies/{id} | Get an Access Control Policy +[**listPolicies**](PolicyApi.md#listPolicies) | **GET** /policies | List Access Control Policies +[**updatePolicy**](PolicyApi.md#updatePolicy) | **PUT** /policies/{id} | Update an Access Control Polic + + +# **createPolicy** +> \Hydra\SDK\Model\Policy createPolicy($body) + +Create an Access Control Policy + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:policies\"], \"actions\": [\"create\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\PolicyApi(); +$body = new \Hydra\SDK\Model\Policy(); // \Hydra\SDK\Model\Policy | + +try { + $result = $api_instance->createPolicy($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PolicyApi->createPolicy: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Hydra\SDK\Model\Policy**](../Model/Policy.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\Policy**](../Model/Policy.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deletePolicy** +> deletePolicy($id) + +Delete an Access Control Policy + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:policies:\"], \"actions\": [\"delete\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\PolicyApi(); +$id = "id_example"; // string | The id of the policy. + +try { + $api_instance->deletePolicy($id); +} catch (Exception $e) { + echo 'Exception when calling PolicyApi->deletePolicy: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the policy. | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getPolicy** +> \Hydra\SDK\Model\Policy getPolicy($id) + +Get an Access Control Policy + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:policies:\"], \"actions\": [\"get\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\PolicyApi(); +$id = "id_example"; // string | The id of the policy. + +try { + $result = $api_instance->getPolicy($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PolicyApi->getPolicy: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the policy. | + +### Return type + +[**\Hydra\SDK\Model\Policy**](../Model/Policy.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **listPolicies** +> \Hydra\SDK\Model\Policy[] listPolicies($offset, $limit) + +List Access Control Policies + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:policies\"], \"actions\": [\"list\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\PolicyApi(); +$offset = 789; // int | The offset from where to start looking. +$limit = 789; // int | The maximum amount of policies returned. + +try { + $result = $api_instance->listPolicies($offset, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PolicyApi->listPolicies: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **int**| The offset from where to start looking. | [optional] + **limit** | **int**| The maximum amount of policies returned. | [optional] + +### Return type + +[**\Hydra\SDK\Model\Policy[]**](../Model/Policy.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **updatePolicy** +> \Hydra\SDK\Model\Policy updatePolicy($id, $body) + +Update an Access Control Polic + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:policies\"], \"actions\": [\"update\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\PolicyApi(); +$id = "id_example"; // string | The id of the policy. +$body = new \Hydra\SDK\Model\Policy(); // \Hydra\SDK\Model\Policy | + +try { + $result = $api_instance->updatePolicy($id, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PolicyApi->updatePolicy: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the policy. | + **body** | [**\Hydra\SDK\Model\Policy**](../Model/Policy.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\Policy**](../Model/Policy.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/sdk/php/swagger/docs/Api/WardenApi.md b/sdk/php/swagger/docs/Api/WardenApi.md new file mode 100644 index 00000000000..8e968fc5dc2 --- /dev/null +++ b/sdk/php/swagger/docs/Api/WardenApi.md @@ -0,0 +1,406 @@ +# Hydra\SDK\WardenApi +Client for Hydra + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addMembersToGroup**](WardenApi.md#addMembersToGroup) | **POST** /warden/groups/{id}/members | Add members to a group +[**createGroup**](WardenApi.md#createGroup) | **POST** /warden/groups | Create a group +[**deleteGroup**](WardenApi.md#deleteGroup) | **DELETE** /warden/groups/{id} | Delete a group by id +[**doesWardenAllowAccessRequest**](WardenApi.md#doesWardenAllowAccessRequest) | **POST** /warden/allowed | Check if an access request is valid (without providing an access token) +[**doesWardenAllowTokenAccessRequest**](WardenApi.md#doesWardenAllowTokenAccessRequest) | **POST** /warden/token/allowed | Check if an access request is valid (providing an access token) +[**getGroup**](WardenApi.md#getGroup) | **GET** /warden/groups/{id} | Get a group by id +[**listGroups**](WardenApi.md#listGroups) | **GET** /warden/groups | List groups +[**removeMembersFromGroup**](WardenApi.md#removeMembersFromGroup) | **DELETE** /warden/groups/{id}/members | Remove members from a group + + +# **addMembersToGroup** +> addMembersToGroup($id, $body) + +Add members to a group + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:groups:\"], \"actions\": [\"members.add\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$id = "id_example"; // string | The id of the group to modify. +$body = new \Hydra\SDK\Model\GroupMembers(); // \Hydra\SDK\Model\GroupMembers | + +try { + $api_instance->addMembersToGroup($id, $body); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->addMembersToGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the group to modify. | + **body** | [**\Hydra\SDK\Model\GroupMembers**](../Model/GroupMembers.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **createGroup** +> \Hydra\SDK\Model\Group createGroup($body) + +Create a group + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:groups\"], \"actions\": [\"create\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$body = new \Hydra\SDK\Model\Group(); // \Hydra\SDK\Model\Group | + +try { + $result = $api_instance->createGroup($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->createGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Hydra\SDK\Model\Group**](../Model/Group.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\Group**](../Model/Group.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **deleteGroup** +> deleteGroup($id) + +Delete a group by id + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:groups:\"], \"actions\": [\"delete\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$id = "id_example"; // string | The id of the group to look up. + +try { + $api_instance->deleteGroup($id); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->deleteGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the group to look up. | + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **doesWardenAllowAccessRequest** +> \Hydra\SDK\Model\WardenAccessRequestResponse doesWardenAllowAccessRequest($body) + +Check if an access request is valid (without providing an access token) + +Checks if a subject (typically a user or a service) is allowed to perform an action on a resource. This endpoint requires a subject, a resource name, an action name and a context. If the subject is not allowed to perform the action on the resource, this endpoint returns a 200 response with `{ \"allowed\": false}`, otherwise `{ \"allowed\": true }` is returned. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:allowed\"], \"actions\": [\"decide\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$body = new \Hydra\SDK\Model\WardenAccessRequest(); // \Hydra\SDK\Model\WardenAccessRequest | + +try { + $result = $api_instance->doesWardenAllowAccessRequest($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->doesWardenAllowAccessRequest: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Hydra\SDK\Model\WardenAccessRequest**](../Model/WardenAccessRequest.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\WardenAccessRequestResponse**](../Model/WardenAccessRequestResponse.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **doesWardenAllowTokenAccessRequest** +> \Hydra\SDK\Model\WardenTokenAccessRequestResponse doesWardenAllowTokenAccessRequest($body) + +Check if an access request is valid (providing an access token) + +Checks if a token is valid and if the token subject is allowed to perform an action on a resource. This endpoint requires a token, a scope, a resource name, an action name and a context. If a token is expired/invalid, has not been granted the requested scope or the subject is not allowed to perform the action on the resource, this endpoint returns a 200 response with `{ \"allowed\": false}`. Extra data set through the `accessTokenExtra` field in the consent flow will be included in the response. The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:token:allowed\"], \"actions\": [\"decide\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$body = new \Hydra\SDK\Model\WardenTokenAccessRequest(); // \Hydra\SDK\Model\WardenTokenAccessRequest | + +try { + $result = $api_instance->doesWardenAllowTokenAccessRequest($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->doesWardenAllowTokenAccessRequest: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Hydra\SDK\Model\WardenTokenAccessRequest**](../Model/WardenTokenAccessRequest.md)| | [optional] + +### Return type + +[**\Hydra\SDK\Model\WardenTokenAccessRequestResponse**](../Model/WardenTokenAccessRequestResponse.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **getGroup** +> \Hydra\SDK\Model\Group getGroup($id) + +Get a group by id + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:groups:\"], \"actions\": [\"create\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$id = "id_example"; // string | The id of the group to look up. + +try { + $result = $api_instance->getGroup($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->getGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the group to look up. | + +### Return type + +[**\Hydra\SDK\Model\Group**](../Model/Group.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **listGroups** +> \Hydra\SDK\Model\Group[] listGroups($member, $limit, $offset) + +List groups + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:groups\"], \"actions\": [\"list\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$member = "member_example"; // string | The id of the member to look up. +$limit = 789; // int | The maximum amount of policies returned. +$offset = 789; // int | The offset from where to start looking. + +try { + $result = $api_instance->listGroups($member, $limit, $offset); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->listGroups: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **member** | **string**| The id of the member to look up. | [optional] + **limit** | **int**| The maximum amount of policies returned. | [optional] + **offset** | **int**| The offset from where to start looking. | [optional] + +### Return type + +[**\Hydra\SDK\Model\Group[]**](../Model/Group.md) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **removeMembersFromGroup** +> removeMembersFromGroup($id, $body) + +Remove members from a group + +The subject making the request needs to be assigned to a policy containing: ``` { \"resources\": [\"rn:hydra:warden:groups:\"], \"actions\": [\"members.remove\"], \"effect\": \"allow\" } ``` + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$api_instance = new Hydra\SDK\Api\WardenApi(); +$id = "id_example"; // string | The id of the group to modify. +$body = new \Hydra\SDK\Model\GroupMembers(); // \Hydra\SDK\Model\GroupMembers | + +try { + $api_instance->removeMembersFromGroup($id, $body); +} catch (Exception $e) { + echo 'Exception when calling WardenApi->removeMembersFromGroup: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The id of the group to modify. | + **body** | [**\Hydra\SDK\Model\GroupMembers**](../Model/GroupMembers.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[oauth2](../../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/sdk/php/swagger/docs/Model/ConsentRequest.md b/sdk/php/swagger/docs/Model/ConsentRequest.md new file mode 100644 index 00000000000..99da11f4c62 --- /dev/null +++ b/sdk/php/swagger/docs/Model/ConsentRequest.md @@ -0,0 +1,14 @@ +# ConsentRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | **string** | ClientID is the client id that initiated the OAuth2 request. | [optional] +**expires_at** | [**\DateTime**](\DateTime.md) | ExpiresAt is the time where the access request will expire. | [optional] +**id** | **string** | ID is the id of this consent request. | [optional] +**redirect_url** | **string** | Redirect URL is the URL where the user agent should be redirected to after the consent has been accepted or rejected. | [optional] +**requested_scopes** | **string[]** | RequestedScopes represents a list of scopes that have been requested by the OAuth2 request initiator. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/ConsentRequestAcceptance.md b/sdk/php/swagger/docs/Model/ConsentRequestAcceptance.md new file mode 100644 index 00000000000..4e388ea57a0 --- /dev/null +++ b/sdk/php/swagger/docs/Model/ConsentRequestAcceptance.md @@ -0,0 +1,13 @@ +# ConsentRequestAcceptance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token_extra** | **map[string,object]** | AccessTokenExtra represents arbitrary data that will be added to the access token and that will be returned on introspection and warden requests. | [optional] +**grant_scopes** | **string[]** | A list of scopes that the user agreed to grant. It should be a subset of requestedScopes from the consent request. | [optional] +**id_token_extra** | **map[string,object]** | IDTokenExtra represents arbitrary data that will be added to the ID token. The ID token will only be issued if the user agrees to it and if the client requested an ID token. | [optional] +**subject** | **string** | Subject represents a unique identifier of the user (or service, or legal entity, ...) that accepted the OAuth2 request. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/ConsentRequestManager.md b/sdk/php/swagger/docs/Model/ConsentRequestManager.md new file mode 100644 index 00000000000..26f451f4d3a --- /dev/null +++ b/sdk/php/swagger/docs/Model/ConsentRequestManager.md @@ -0,0 +1,9 @@ +# ConsentRequestManager + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/ConsentRequestRejection.md b/sdk/php/swagger/docs/Model/ConsentRequestRejection.md new file mode 100644 index 00000000000..8aadad6825d --- /dev/null +++ b/sdk/php/swagger/docs/Model/ConsentRequestRejection.md @@ -0,0 +1,10 @@ +# ConsentRequestRejection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reason** | **string** | Reason represents the reason why the user rejected the consent request. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/Context.md b/sdk/php/swagger/docs/Model/Context.md new file mode 100644 index 00000000000..5f41d29bd7a --- /dev/null +++ b/sdk/php/swagger/docs/Model/Context.md @@ -0,0 +1,16 @@ +# Context + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token_extra** | **map[string,object]** | Extra represents arbitrary session data. | [optional] +**client_id** | **string** | ClientID is id of the client the token was issued for.. | [optional] +**expires_at** | [**\DateTime**](\DateTime.md) | ExpiresAt is the expiry timestamp. | [optional] +**granted_scopes** | **string[]** | GrantedScopes is a list of scopes that the subject authorized when asked for consent. | [optional] +**issued_at** | [**\DateTime**](\DateTime.md) | IssuedAt is the token creation time stamp. | [optional] +**issuer** | **string** | Issuer is the id of the issuer, typically an hydra instance. | [optional] +**subject** | **string** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/Firewall.md b/sdk/php/swagger/docs/Model/Firewall.md new file mode 100644 index 00000000000..134131c8cd3 --- /dev/null +++ b/sdk/php/swagger/docs/Model/Firewall.md @@ -0,0 +1,9 @@ +# Firewall + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/Group.md b/sdk/php/swagger/docs/Model/Group.md new file mode 100644 index 00000000000..5275e7714dd --- /dev/null +++ b/sdk/php/swagger/docs/Model/Group.md @@ -0,0 +1,11 @@ +# Group + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | ID is the groups id. | [optional] +**members** | **string[]** | Members is who belongs to the group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/GroupMembers.md b/sdk/php/swagger/docs/Model/GroupMembers.md new file mode 100644 index 00000000000..0d3cdb62307 --- /dev/null +++ b/sdk/php/swagger/docs/Model/GroupMembers.md @@ -0,0 +1,10 @@ +# GroupMembers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**members** | **string[]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/Handler.md b/sdk/php/swagger/docs/Model/Handler.md new file mode 100644 index 00000000000..2d07b7c5076 --- /dev/null +++ b/sdk/php/swagger/docs/Model/Handler.md @@ -0,0 +1,14 @@ +# Handler + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**generators** | [**map[string,\Hydra\SDK\Model\KeyGenerator]**](KeyGenerator.md) | | [optional] +**h** | [**\Hydra\SDK\Model\Writer**](Writer.md) | | [optional] +**manager** | [**\Hydra\SDK\Model\Manager**](Manager.md) | | [optional] +**resource_prefix** | **string** | | [optional] +**w** | [**\Hydra\SDK\Model\Firewall**](Firewall.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/InlineResponse200.md b/sdk/php/swagger/docs/Model/InlineResponse200.md new file mode 100644 index 00000000000..f93d0f824e6 --- /dev/null +++ b/sdk/php/swagger/docs/Model/InlineResponse200.md @@ -0,0 +1,10 @@ +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Status always contains \"ok\" | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/InlineResponse2001.md b/sdk/php/swagger/docs/Model/InlineResponse2001.md new file mode 100644 index 00000000000..754a2a7e2b7 --- /dev/null +++ b/sdk/php/swagger/docs/Model/InlineResponse2001.md @@ -0,0 +1,15 @@ +# InlineResponse2001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token** | **string** | The access token issued by the authorization server. | [optional] +**expires_in** | **int** | 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. | [optional] +**id_token** | **int** | To retrieve a refresh token request the id_token scope. | [optional] +**refresh_token** | **string** | The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request. | [optional] +**scope** | **int** | The scope of the access token | [optional] +**token_type** | **string** | The type of the token issued | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/InlineResponse401.md b/sdk/php/swagger/docs/Model/InlineResponse401.md new file mode 100644 index 00000000000..9505aca203c --- /dev/null +++ b/sdk/php/swagger/docs/Model/InlineResponse401.md @@ -0,0 +1,15 @@ +# InlineResponse401 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**details** | [**map[string,object][]**](map.md) | | [optional] +**message** | **string** | | [optional] +**reason** | **string** | | [optional] +**request** | **string** | | [optional] +**status** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/JoseWebKeySetRequest.md b/sdk/php/swagger/docs/Model/JoseWebKeySetRequest.md new file mode 100644 index 00000000000..ea1dbece493 --- /dev/null +++ b/sdk/php/swagger/docs/Model/JoseWebKeySetRequest.md @@ -0,0 +1,10 @@ +# JoseWebKeySetRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**keys** | [**\Hydra\SDK\Model\RawMessage[]**](RawMessage.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/JsonWebKey.md b/sdk/php/swagger/docs/Model/JsonWebKey.md new file mode 100644 index 00000000000..36119ee9415 --- /dev/null +++ b/sdk/php/swagger/docs/Model/JsonWebKey.md @@ -0,0 +1,26 @@ +# JsonWebKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alg** | **string** | 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. | [optional] +**crv** | **string** | | [optional] +**d** | **string** | | [optional] +**dp** | **string** | | [optional] +**dq** | **string** | | [optional] +**e** | **string** | | [optional] +**k** | **string** | | [optional] +**kid** | **string** | 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. | [optional] +**kty** | **string** | 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. | [optional] +**n** | **string** | | [optional] +**p** | **string** | | [optional] +**q** | **string** | | [optional] +**qi** | **string** | | [optional] +**use** | **string** | The \"use\" (public key use) parameter identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly \"sig\" (signature) or \"enc\" (encryption). | [optional] +**x** | **string** | | [optional] +**x5c** | **string[]** | 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. | [optional] +**y** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/JsonWebKeySet.md b/sdk/php/swagger/docs/Model/JsonWebKeySet.md new file mode 100644 index 00000000000..41cebd564ed --- /dev/null +++ b/sdk/php/swagger/docs/Model/JsonWebKeySet.md @@ -0,0 +1,10 @@ +# JsonWebKeySet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**keys** | [**\Hydra\SDK\Model\JsonWebKey[]**](JsonWebKey.md) | The value of the \"keys\" parameter is an array of 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. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/JsonWebKeySetGeneratorRequest.md b/sdk/php/swagger/docs/Model/JsonWebKeySetGeneratorRequest.md new file mode 100644 index 00000000000..0fa0398c3e0 --- /dev/null +++ b/sdk/php/swagger/docs/Model/JsonWebKeySetGeneratorRequest.md @@ -0,0 +1,11 @@ +# JsonWebKeySetGeneratorRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alg** | **string** | The algorithm to be used for creating the key. Supports \"RS256\", \"ES512\", \"HS512\", and \"HS256\" | +**kid** | **string** | The kid of the key to be created | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/KeyGenerator.md b/sdk/php/swagger/docs/Model/KeyGenerator.md new file mode 100644 index 00000000000..d2d7e1c15e9 --- /dev/null +++ b/sdk/php/swagger/docs/Model/KeyGenerator.md @@ -0,0 +1,9 @@ +# KeyGenerator + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/Manager.md b/sdk/php/swagger/docs/Model/Manager.md new file mode 100644 index 00000000000..485b366835d --- /dev/null +++ b/sdk/php/swagger/docs/Model/Manager.md @@ -0,0 +1,9 @@ +# Manager + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/OAuth2Client.md b/sdk/php/swagger/docs/Model/OAuth2Client.md new file mode 100644 index 00000000000..eaa64abf7ea --- /dev/null +++ b/sdk/php/swagger/docs/Model/OAuth2Client.md @@ -0,0 +1,23 @@ +# OAuth2Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_name** | **string** | Name is the human-readable string name of the client to be presented to the end-user during authorization. | [optional] +**client_secret** | **string** | Secret is the client's secret. The secret will be included in the create request as cleartext, and then never again. The secret is stored using BCrypt so it is impossible to recover it. Tell your users that they need to write the secret down as it will not be made available again. | [optional] +**client_uri** | **string** | ClientURI is an 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. | [optional] +**contacts** | **string[]** | Contacts is a array of strings representing ways to contact people responsible for this client, typically email addresses. | [optional] +**grant_types** | **string[]** | GrantTypes is an array of grant types the client is allowed to use. | [optional] +**id** | **string** | ID is the id for this client. | [optional] +**logo_uri** | **string** | LogoURI is an URL string that references a logo for the client. | [optional] +**owner** | **string** | Owner is a string identifying the owner of the OAuth 2.0 Client. | [optional] +**policy_uri** | **string** | 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. | [optional] +**public** | **bool** | Public is a boolean that identifies this client as public, meaning that it does not have a secret. It will disable the client_credentials grant type for this client if set. | [optional] +**redirect_uris** | **string[]** | RedirectURIs is an array of allowed redirect urls for the client, for example http://mydomain/oauth/callback . | [optional] +**response_types** | **string[]** | ResponseTypes is an array of the OAuth 2.0 response type strings that the client can use at the authorization endpoint. | [optional] +**scope** | **string** | 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. | [optional] +**tos_uri** | **string** | TermsOfServiceURI is a URL string that points to a human-readable terms of service document for the client that describes a contractual relationship between the end-user and the client that the end-user accepts when authorizing the client. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/OAuth2ConsentRequest.md b/sdk/php/swagger/docs/Model/OAuth2ConsentRequest.md new file mode 100644 index 00000000000..ab17a4ee958 --- /dev/null +++ b/sdk/php/swagger/docs/Model/OAuth2ConsentRequest.md @@ -0,0 +1,14 @@ +# OAuth2ConsentRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | **string** | ClientID is the client id that initiated the OAuth2 request. | [optional] +**expires_at** | **string** | ExpiresAt is the time where the access request will expire. | [optional] +**id** | **string** | ID is the id of this consent request. | [optional] +**redirect_url** | **string** | Redirect URL is the URL where the user agent should be redirected to after the consent has been accepted or rejected. | [optional] +**requested_scopes** | **string[]** | RequestedScopes represents a list of scopes that have been requested by the OAuth2 request initiator. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/OAuth2TokenIntrospection.md b/sdk/php/swagger/docs/Model/OAuth2TokenIntrospection.md new file mode 100644 index 00000000000..8bd286914e1 --- /dev/null +++ b/sdk/php/swagger/docs/Model/OAuth2TokenIntrospection.md @@ -0,0 +1,20 @@ +# OAuth2TokenIntrospection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | 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). | [optional] +**aud** | **string** | ClientID is a service-specific string identifier or list of string identifiers representing the intended audience for this token. | [optional] +**client_id** | **string** | ClientID is aclient identifier for the OAuth 2.0 client that requested this token. | [optional] +**exp** | **int** | Expires at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire. | [optional] +**ext** | **map[string,object]** | Extra is arbitrary data set by the session. | [optional] +**iat** | **int** | Issued at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued. | [optional] +**iss** | **string** | Issuer is a string representing the issuer of this token | [optional] +**nbf** | **int** | 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. | [optional] +**scope** | **string** | Scope is a JSON string containing a space-separated list of scopes associated with this token. | [optional] +**sub** | **string** | Subject of the token, as defined in JWT [RFC7519]. Usually a machine-readable identifier of the resource owner who authorized this token. | [optional] +**username** | **string** | Username is a human-readable identifier for the resource owner who authorized this token. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/Policy.md b/sdk/php/swagger/docs/Model/Policy.md new file mode 100644 index 00000000000..604ab071fbc --- /dev/null +++ b/sdk/php/swagger/docs/Model/Policy.md @@ -0,0 +1,16 @@ +# Policy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**actions** | **string[]** | Actions impacted by the policy. | [optional] +**conditions** | [**map[string,\Hydra\SDK\Model\PolicyConditions]**](PolicyConditions.md) | Conditions under which the policy is active. | [optional] +**description** | **string** | Description of the policy. | [optional] +**effect** | **string** | Effect of the policy | [optional] +**id** | **string** | ID of the policy. | [optional] +**resources** | **string[]** | Resources impacted by the policy. | [optional] +**subjects** | **string[]** | Subjects impacted by the policy. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/PolicyConditions.md b/sdk/php/swagger/docs/Model/PolicyConditions.md new file mode 100644 index 00000000000..58de79f38f1 --- /dev/null +++ b/sdk/php/swagger/docs/Model/PolicyConditions.md @@ -0,0 +1,11 @@ +# PolicyConditions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**options** | **map[string,object]** | | [optional] +**type** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/RawMessage.md b/sdk/php/swagger/docs/Model/RawMessage.md new file mode 100644 index 00000000000..f8710fd2edc --- /dev/null +++ b/sdk/php/swagger/docs/Model/RawMessage.md @@ -0,0 +1,9 @@ +# RawMessage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerAcceptConsentRequest.md b/sdk/php/swagger/docs/Model/SwaggerAcceptConsentRequest.md new file mode 100644 index 00000000000..270615bf31a --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerAcceptConsentRequest.md @@ -0,0 +1,11 @@ +# SwaggerAcceptConsentRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\ConsentRequestAcceptance**](ConsentRequestAcceptance.md) | | +**id** | **string** | in: path | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerCreatePolicyParameters.md b/sdk/php/swagger/docs/Model/SwaggerCreatePolicyParameters.md new file mode 100644 index 00000000000..45db8d49094 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerCreatePolicyParameters.md @@ -0,0 +1,10 @@ +# SwaggerCreatePolicyParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\Policy**](Policy.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerDoesWardenAllowAccessRequestParameters.md b/sdk/php/swagger/docs/Model/SwaggerDoesWardenAllowAccessRequestParameters.md new file mode 100644 index 00000000000..5d2572cc1db --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerDoesWardenAllowAccessRequestParameters.md @@ -0,0 +1,10 @@ +# SwaggerDoesWardenAllowAccessRequestParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\WardenAccessRequest**](WardenAccessRequest.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerDoesWardenAllowTokenAccessRequestParameters.md b/sdk/php/swagger/docs/Model/SwaggerDoesWardenAllowTokenAccessRequestParameters.md new file mode 100644 index 00000000000..af83ec5797c --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerDoesWardenAllowTokenAccessRequestParameters.md @@ -0,0 +1,10 @@ +# SwaggerDoesWardenAllowTokenAccessRequestParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\WardenTokenAccessRequest**](WardenTokenAccessRequest.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerGetPolicyParameters.md b/sdk/php/swagger/docs/Model/SwaggerGetPolicyParameters.md new file mode 100644 index 00000000000..768327cb770 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerGetPolicyParameters.md @@ -0,0 +1,10 @@ +# SwaggerGetPolicyParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The id of the policy. in: path | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerJsonWebKeyQuery.md b/sdk/php/swagger/docs/Model/SwaggerJsonWebKeyQuery.md new file mode 100644 index 00000000000..0bad6a32568 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerJsonWebKeyQuery.md @@ -0,0 +1,11 @@ +# SwaggerJsonWebKeyQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kid** | **string** | The kid of the desired key in: path | +**set** | **string** | The set in: path | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerJwkCreateSet.md b/sdk/php/swagger/docs/Model/SwaggerJwkCreateSet.md new file mode 100644 index 00000000000..75e10ac5243 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerJwkCreateSet.md @@ -0,0 +1,11 @@ +# SwaggerJwkCreateSet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\JsonWebKeySetGeneratorRequest**](JsonWebKeySetGeneratorRequest.md) | | [optional] +**set** | **string** | The set in: path | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerJwkSetQuery.md b/sdk/php/swagger/docs/Model/SwaggerJwkSetQuery.md new file mode 100644 index 00000000000..af96a25f28a --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerJwkSetQuery.md @@ -0,0 +1,10 @@ +# SwaggerJwkSetQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**set** | **string** | The set in: path | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerJwkUpdateSet.md b/sdk/php/swagger/docs/Model/SwaggerJwkUpdateSet.md new file mode 100644 index 00000000000..01b8b3cd688 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerJwkUpdateSet.md @@ -0,0 +1,11 @@ +# SwaggerJwkUpdateSet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\JsonWebKeySet**](JsonWebKeySet.md) | | [optional] +**set** | **string** | The set in: path | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerJwkUpdateSetKey.md b/sdk/php/swagger/docs/Model/SwaggerJwkUpdateSetKey.md new file mode 100644 index 00000000000..be4481870fb --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerJwkUpdateSetKey.md @@ -0,0 +1,12 @@ +# SwaggerJwkUpdateSetKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\JsonWebKey**](JsonWebKey.md) | | [optional] +**kid** | **string** | The kid of the desired key in: path | +**set** | **string** | The set in: path | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerListPolicyParameters.md b/sdk/php/swagger/docs/Model/SwaggerListPolicyParameters.md new file mode 100644 index 00000000000..b81cd9de8a4 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerListPolicyParameters.md @@ -0,0 +1,11 @@ +# SwaggerListPolicyParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**limit** | **int** | The maximum amount of policies returned. in: query | [optional] +**offset** | **int** | The offset from where to start looking. in: query | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerListPolicyResponse.md b/sdk/php/swagger/docs/Model/SwaggerListPolicyResponse.md new file mode 100644 index 00000000000..46088e81be8 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerListPolicyResponse.md @@ -0,0 +1,10 @@ +# SwaggerListPolicyResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\Policy[]**](Policy.md) | in: body type: array | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerOAuthConsentRequest.md b/sdk/php/swagger/docs/Model/SwaggerOAuthConsentRequest.md new file mode 100644 index 00000000000..8ebe3246cbd --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerOAuthConsentRequest.md @@ -0,0 +1,10 @@ +# SwaggerOAuthConsentRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\OAuth2ConsentRequest**](OAuth2ConsentRequest.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerOAuthConsentRequestPayload.md b/sdk/php/swagger/docs/Model/SwaggerOAuthConsentRequestPayload.md new file mode 100644 index 00000000000..099a825c9fc --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerOAuthConsentRequestPayload.md @@ -0,0 +1,10 @@ +# SwaggerOAuthConsentRequestPayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The id of the OAuth 2.0 Consent Request. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerOAuthIntrospectionRequest.md b/sdk/php/swagger/docs/Model/SwaggerOAuthIntrospectionRequest.md new file mode 100644 index 00000000000..2f2c73126e6 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerOAuthIntrospectionRequest.md @@ -0,0 +1,11 @@ +# SwaggerOAuthIntrospectionRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scope** | **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. in: formData | [optional] +**token** | **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 [RFC6749], Section 5.1. This endpoint DOES NOT accept refresh tokens for validation. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerOAuthIntrospectionResponse.md b/sdk/php/swagger/docs/Model/SwaggerOAuthIntrospectionResponse.md new file mode 100644 index 00000000000..75fd94d77c2 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerOAuthIntrospectionResponse.md @@ -0,0 +1,10 @@ +# SwaggerOAuthIntrospectionResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\OAuth2TokenIntrospection**](OAuth2TokenIntrospection.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerOAuthTokenResponse.md b/sdk/php/swagger/docs/Model/SwaggerOAuthTokenResponse.md new file mode 100644 index 00000000000..cda3edf99e0 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerOAuthTokenResponse.md @@ -0,0 +1,10 @@ +# SwaggerOAuthTokenResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\SwaggerOAuthTokenResponseBody**](SwaggerOAuthTokenResponseBody.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerOAuthTokenResponseBody.md b/sdk/php/swagger/docs/Model/SwaggerOAuthTokenResponseBody.md new file mode 100644 index 00000000000..87616e36a8c --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerOAuthTokenResponseBody.md @@ -0,0 +1,15 @@ +# SwaggerOAuthTokenResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token** | **string** | The access token issued by the authorization server. | [optional] +**expires_in** | **int** | 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. | [optional] +**id_token** | **int** | To retrieve a refresh token request the id_token scope. | [optional] +**refresh_token** | **string** | The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request. | [optional] +**scope** | **int** | The scope of the access token | [optional] +**token_type** | **string** | The type of the token issued | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerRejectConsentRequest.md b/sdk/php/swagger/docs/Model/SwaggerRejectConsentRequest.md new file mode 100644 index 00000000000..7a6a91c1878 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerRejectConsentRequest.md @@ -0,0 +1,11 @@ +# SwaggerRejectConsentRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\ConsentRequestRejection**](ConsentRequestRejection.md) | | +**id** | **string** | in: path | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerRevokeOAuth2TokenParameters.md b/sdk/php/swagger/docs/Model/SwaggerRevokeOAuth2TokenParameters.md new file mode 100644 index 00000000000..050656ee48f --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerRevokeOAuth2TokenParameters.md @@ -0,0 +1,10 @@ +# SwaggerRevokeOAuth2TokenParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **string** | in: formData | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerUpdatePolicyParameters.md b/sdk/php/swagger/docs/Model/SwaggerUpdatePolicyParameters.md new file mode 100644 index 00000000000..1fd925a6b8d --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerUpdatePolicyParameters.md @@ -0,0 +1,11 @@ +# SwaggerUpdatePolicyParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\Policy**](Policy.md) | | [optional] +**id** | **string** | The id of the policy. in: path | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerWardenAccessRequestResponseParameters.md b/sdk/php/swagger/docs/Model/SwaggerWardenAccessRequestResponseParameters.md new file mode 100644 index 00000000000..9fad5c6935e --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerWardenAccessRequestResponseParameters.md @@ -0,0 +1,10 @@ +# SwaggerWardenAccessRequestResponseParameters + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\WardenAccessRequestResponse**](WardenAccessRequestResponse.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggerWardenTokenAccessRequestResponse.md b/sdk/php/swagger/docs/Model/SwaggerWardenTokenAccessRequestResponse.md new file mode 100644 index 00000000000..6850bebe8c4 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggerWardenTokenAccessRequestResponse.md @@ -0,0 +1,10 @@ +# SwaggerWardenTokenAccessRequestResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\WardenTokenAccessRequestResponse**](WardenTokenAccessRequestResponse.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggeruserinfoResponse.md b/sdk/php/swagger/docs/Model/SwaggeruserinfoResponse.md new file mode 100644 index 00000000000..d720e6b47f9 --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggeruserinfoResponse.md @@ -0,0 +1,10 @@ +# SwaggeruserinfoResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**\Hydra\SDK\Model\SwaggeruserinfoResponsePayload**](SwaggeruserinfoResponsePayload.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/SwaggeruserinfoResponsePayload.md b/sdk/php/swagger/docs/Model/SwaggeruserinfoResponsePayload.md new file mode 100644 index 00000000000..75bcb7920ec --- /dev/null +++ b/sdk/php/swagger/docs/Model/SwaggeruserinfoResponsePayload.md @@ -0,0 +1,28 @@ +# SwaggeruserinfoResponsePayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**birthdate** | **string** | 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. | [optional] +**email** | **string** | End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7. | [optional] +**email_verified** | **bool** | True if the End-User's e-mail address has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this e-mail address was controlled by the End-User at the time the verification was performed. The means by which an e-mail address is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. | [optional] +**family_name** | **string** | Surname(s) or last name(s) of the End-User. Note that in some cultures, people can have multiple family names or no family name; all can be present, with the names being separated by space characters. | [optional] +**gender** | **string** | End-User's gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable. | [optional] +**given_name** | **string** | Given name(s) or first name(s) of the End-User. Note that in some cultures, people can have multiple given names; all can be present, with the names being separated by space characters. | [optional] +**locale** | **string** | End-User's locale, represented as a BCP47 [RFC5646] language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. For example, en-US or fr-CA. As a compatibility note, some implementations have used an underscore as the separator rather than a dash, for example, en_US; Relying Parties MAY choose to accept this locale syntax as well. | [optional] +**middle_name** | **string** | Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used. | [optional] +**name** | **string** | End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences. | [optional] +**nickname** | **string** | Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael. | [optional] +**phone_number** | **string** | End-User's preferred telephone number. E.164 [E.164] is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400. If the phone number contains an extension, it is RECOMMENDED that the extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678. | [optional] +**phone_number_verified** | **bool** | True if the End-User's phone number has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this phone number was controlled by the End-User at the time the verification was performed. The means by which a phone number is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. When true, the phone_number Claim MUST be in E.164 format and any extensions MUST be represented in RFC 3966 format. | [optional] +**picture** | **string** | URL of the End-User's profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image. Note that this URL SHOULD specifically reference a profile photo of the End-User suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User. | [optional] +**preferred_username** | **string** | Non-unique shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe. This value MAY be any valid JSON string including special characters such as @, /, or whitespace. | [optional] +**profile** | **string** | URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User. | [optional] +**sub** | **string** | Subject - Identifier for the End-User at the Issuer. | [optional] +**updated_at** | **int** | Time the End-User's information was last updated. Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time. | [optional] +**website** | **string** | URL of the End-User's Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with. | [optional] +**zoneinfo** | **string** | String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone. For example, Europe/Paris or America/Los_Angeles. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/TokenAllowedRequest.md b/sdk/php/swagger/docs/Model/TokenAllowedRequest.md new file mode 100644 index 00000000000..07a202d64a6 --- /dev/null +++ b/sdk/php/swagger/docs/Model/TokenAllowedRequest.md @@ -0,0 +1,12 @@ +# TokenAllowedRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | Action is the action that is requested on the resource. | [optional] +**context** | **map[string,object]** | Context is the request's environmental context. | [optional] +**resource** | **string** | Resource is the resource that access is requested to. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/WardenAccessRequest.md b/sdk/php/swagger/docs/Model/WardenAccessRequest.md new file mode 100644 index 00000000000..3c4db82e452 --- /dev/null +++ b/sdk/php/swagger/docs/Model/WardenAccessRequest.md @@ -0,0 +1,13 @@ +# WardenAccessRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | Action is the action that is requested on the resource. | [optional] +**context** | **map[string,object]** | Context is the request's environmental context. | [optional] +**resource** | **string** | Resource is the resource that access is requested to. | [optional] +**subject** | **string** | Subejct is the subject that is requesting access. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/WardenAccessRequestResponse.md b/sdk/php/swagger/docs/Model/WardenAccessRequestResponse.md new file mode 100644 index 00000000000..e47098e4728 --- /dev/null +++ b/sdk/php/swagger/docs/Model/WardenAccessRequestResponse.md @@ -0,0 +1,10 @@ +# WardenAccessRequestResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowed** | **bool** | Allowed is true if the request is allowed and false otherwise. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/WardenTokenAccessRequest.md b/sdk/php/swagger/docs/Model/WardenTokenAccessRequest.md new file mode 100644 index 00000000000..d47a6950a60 --- /dev/null +++ b/sdk/php/swagger/docs/Model/WardenTokenAccessRequest.md @@ -0,0 +1,14 @@ +# WardenTokenAccessRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | Action is the action that is requested on the resource. | [optional] +**context** | **map[string,object]** | Context is the request's environmental context. | [optional] +**resource** | **string** | Resource is the resource that access is requested to. | [optional] +**scopes** | **string[]** | Scopes is an array of scopes that are requried. | [optional] +**token** | **string** | Token is the token to introspect. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/WardenTokenAccessRequestResponse.md b/sdk/php/swagger/docs/Model/WardenTokenAccessRequestResponse.md new file mode 100644 index 00000000000..a1f90275c42 --- /dev/null +++ b/sdk/php/swagger/docs/Model/WardenTokenAccessRequestResponse.md @@ -0,0 +1,17 @@ +# WardenTokenAccessRequestResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token_extra** | **map[string,object]** | Extra represents arbitrary session data. | [optional] +**allowed** | **bool** | Allowed is true if the request is allowed and false otherwise. | [optional] +**client_id** | **string** | ClientID is the id of the OAuth2 client that requested the token. | [optional] +**expires_at** | **string** | ExpiresAt is the expiry timestamp. | [optional] +**granted_scopes** | **string[]** | GrantedScopes is a list of scopes that the subject authorized when asked for consent. | [optional] +**issued_at** | **string** | IssuedAt is the token creation time stamp. | [optional] +**issuer** | **string** | Issuer is the id of the issuer, typically an hydra instance. | [optional] +**subject** | **string** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/WellKnown.md b/sdk/php/swagger/docs/Model/WellKnown.md new file mode 100644 index 00000000000..f492f1ebd50 --- /dev/null +++ b/sdk/php/swagger/docs/Model/WellKnown.md @@ -0,0 +1,20 @@ +# WellKnown + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authorization_endpoint** | **string** | URL of the OP's OAuth 2.0 Authorization Endpoint | +**claims_supported** | **string[]** | 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. | [optional] +**id_token_signing_alg_values_supported** | **string[]** | JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for the ID Token to encode the Claims in a JWT. | +**issuer** | **string** | URL using the https scheme with no query or fragment component that the OP asserts as its Issuer Identifier. If Issuer 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 Issuer. | +**jwks_uri** | **string** | 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. | +**response_types_supported** | **string[]** | 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. | +**scopes_supported** | **string[]** | SON 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 | [optional] +**subject_types_supported** | **string[]** | JSON array containing a list of the Subject Identifier types that this OP supports. Valid types include pairwise and public. | +**token_endpoint** | **string** | URL of the OP's OAuth 2.0 Token Endpoint | +**token_endpoint_auth_methods_supported** | **string[]** | 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 | [optional] +**userinfo_endpoint** | **string** | URL of the OP's UserInfo Endpoint. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/Writer.md b/sdk/php/swagger/docs/Model/Writer.md new file mode 100644 index 00000000000..530fd0f80e3 --- /dev/null +++ b/sdk/php/swagger/docs/Model/Writer.md @@ -0,0 +1,9 @@ +# Writer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/git_push.sh b/sdk/php/swagger/git_push.sh new file mode 100644 index 00000000000..228df0fd025 --- /dev/null +++ b/sdk/php/swagger/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="ory" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="swagger" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/sdk/php/swagger/lib/Api/HealthApi.php b/sdk/php/swagger/lib/Api/HealthApi.php new file mode 100644 index 00000000000..612d840e8da --- /dev/null +++ b/sdk/php/swagger/lib/Api/HealthApi.php @@ -0,0 +1,249 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Api; + +use \Hydra\SDK\ApiClient; +use \Hydra\SDK\ApiException; +use \Hydra\SDK\Configuration; +use \Hydra\SDK\ObjectSerializer; + +/** + * HealthApi Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class HealthApi +{ + /** + * API Client + * + * @var \Hydra\SDK\ApiClient instance of the ApiClient + */ + protected $apiClient; + + /** + * Constructor + * + * @param \Hydra\SDK\ApiClient|null $apiClient The api client to use + */ + public function __construct(\Hydra\SDK\ApiClient $apiClient = null) + { + if ($apiClient === null) { + $apiClient = new ApiClient(); + } + + $this->apiClient = $apiClient; + } + + /** + * Get API client + * + * @return \Hydra\SDK\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * + * @param \Hydra\SDK\ApiClient $apiClient set the API client + * + * @return HealthApi + */ + public function setApiClient(\Hydra\SDK\ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * Operation getInstanceMetrics + * + * Show instance metrics (experimental) + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function getInstanceMetrics() + { + list($response) = $this->getInstanceMetricsWithHttpInfo(); + return $response; + } + + /** + * Operation getInstanceMetricsWithHttpInfo + * + * Show instance metrics (experimental) + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getInstanceMetricsWithHttpInfo() + { + // parse inputs + $resourcePath = "/health/metrics"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/health/metrics' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getInstanceStatus + * + * Check health status of this instance + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\InlineResponse200 + */ + public function getInstanceStatus() + { + list($response) = $this->getInstanceStatusWithHttpInfo(); + return $response; + } + + /** + * Operation getInstanceStatusWithHttpInfo + * + * Check health status of this instance + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getInstanceStatusWithHttpInfo() + { + // parse inputs + $resourcePath = "/health/status"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/x-www-form-urlencoded']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\InlineResponse200', + '/health/status' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse200', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } +} diff --git a/sdk/php/swagger/lib/Api/JsonWebKeyApi.php b/sdk/php/swagger/lib/Api/JsonWebKeyApi.php new file mode 100644 index 00000000000..1a169734c7a --- /dev/null +++ b/sdk/php/swagger/lib/Api/JsonWebKeyApi.php @@ -0,0 +1,858 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Api; + +use \Hydra\SDK\ApiClient; +use \Hydra\SDK\ApiException; +use \Hydra\SDK\Configuration; +use \Hydra\SDK\ObjectSerializer; + +/** + * JsonWebKeyApi Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class JsonWebKeyApi +{ + /** + * API Client + * + * @var \Hydra\SDK\ApiClient instance of the ApiClient + */ + protected $apiClient; + + /** + * Constructor + * + * @param \Hydra\SDK\ApiClient|null $apiClient The api client to use + */ + public function __construct(\Hydra\SDK\ApiClient $apiClient = null) + { + if ($apiClient === null) { + $apiClient = new ApiClient(); + } + + $this->apiClient = $apiClient; + } + + /** + * Get API client + * + * @return \Hydra\SDK\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * + * @param \Hydra\SDK\ApiClient $apiClient set the API client + * + * @return JsonWebKeyApi + */ + public function setApiClient(\Hydra\SDK\ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * Operation createJsonWebKeySet + * + * Generate a new JSON Web Key + * + * Client for Hydra + * + * @param string $set The set (required) + * @param \Hydra\SDK\Model\JsonWebKeySetGeneratorRequest $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\JsonWebKeySet + */ + public function createJsonWebKeySet($set, $body = null) + { + list($response) = $this->createJsonWebKeySetWithHttpInfo($set, $body); + return $response; + } + + /** + * Operation createJsonWebKeySetWithHttpInfo + * + * Generate a new JSON Web Key + * + * Client for Hydra + * + * @param string $set The set (required) + * @param \Hydra\SDK\Model\JsonWebKeySetGeneratorRequest $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\JsonWebKeySet, HTTP status code, HTTP response headers (array of strings) + */ + public function createJsonWebKeySetWithHttpInfo($set, $body = null) + { + // verify the required parameter 'set' is set + if ($set === null) { + throw new \InvalidArgumentException('Missing the required parameter $set when calling createJsonWebKeySet'); + } + // parse inputs + $resourcePath = "/keys/{set}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($set !== null) { + $resourcePath = str_replace( + "{" . "set" . "}", + $this->apiClient->getSerializer()->toPathValue($set), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\JsonWebKeySet', + '/keys/{set}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\JsonWebKeySet', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\JsonWebKeySet', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation deleteJsonWebKey + * + * Delete a JSON Web Key + * + * Client for Hydra + * + * @param string $kid The kid of the desired key (required) + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function deleteJsonWebKey($kid, $set) + { + list($response) = $this->deleteJsonWebKeyWithHttpInfo($kid, $set); + return $response; + } + + /** + * Operation deleteJsonWebKeyWithHttpInfo + * + * Delete a JSON Web Key + * + * Client for Hydra + * + * @param string $kid The kid of the desired key (required) + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteJsonWebKeyWithHttpInfo($kid, $set) + { + // verify the required parameter 'kid' is set + if ($kid === null) { + throw new \InvalidArgumentException('Missing the required parameter $kid when calling deleteJsonWebKey'); + } + // verify the required parameter 'set' is set + if ($set === null) { + throw new \InvalidArgumentException('Missing the required parameter $set when calling deleteJsonWebKey'); + } + // parse inputs + $resourcePath = "/keys/{set}/{kid}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($kid !== null) { + $resourcePath = str_replace( + "{" . "kid" . "}", + $this->apiClient->getSerializer()->toPathValue($kid), + $resourcePath + ); + } + // path params + if ($set !== null) { + $resourcePath = str_replace( + "{" . "set" . "}", + $this->apiClient->getSerializer()->toPathValue($set), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, + $headerParams, + null, + '/keys/{set}/{kid}' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation deleteJsonWebKeySet + * + * Delete a JSON Web Key + * + * Client for Hydra + * + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function deleteJsonWebKeySet($set) + { + list($response) = $this->deleteJsonWebKeySetWithHttpInfo($set); + return $response; + } + + /** + * Operation deleteJsonWebKeySetWithHttpInfo + * + * Delete a JSON Web Key + * + * Client for Hydra + * + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteJsonWebKeySetWithHttpInfo($set) + { + // verify the required parameter 'set' is set + if ($set === null) { + throw new \InvalidArgumentException('Missing the required parameter $set when calling deleteJsonWebKeySet'); + } + // parse inputs + $resourcePath = "/keys/{set}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($set !== null) { + $resourcePath = str_replace( + "{" . "set" . "}", + $this->apiClient->getSerializer()->toPathValue($set), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, + $headerParams, + null, + '/keys/{set}' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getJsonWebKey + * + * Retrieve a JSON Web Key + * + * Client for Hydra + * + * @param string $kid The kid of the desired key (required) + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\JsonWebKeySet + */ + public function getJsonWebKey($kid, $set) + { + list($response) = $this->getJsonWebKeyWithHttpInfo($kid, $set); + return $response; + } + + /** + * Operation getJsonWebKeyWithHttpInfo + * + * Retrieve a JSON Web Key + * + * Client for Hydra + * + * @param string $kid The kid of the desired key (required) + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\JsonWebKeySet, HTTP status code, HTTP response headers (array of strings) + */ + public function getJsonWebKeyWithHttpInfo($kid, $set) + { + // verify the required parameter 'kid' is set + if ($kid === null) { + throw new \InvalidArgumentException('Missing the required parameter $kid when calling getJsonWebKey'); + } + // verify the required parameter 'set' is set + if ($set === null) { + throw new \InvalidArgumentException('Missing the required parameter $set when calling getJsonWebKey'); + } + // parse inputs + $resourcePath = "/keys/{set}/{kid}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($kid !== null) { + $resourcePath = str_replace( + "{" . "kid" . "}", + $this->apiClient->getSerializer()->toPathValue($kid), + $resourcePath + ); + } + // path params + if ($set !== null) { + $resourcePath = str_replace( + "{" . "set" . "}", + $this->apiClient->getSerializer()->toPathValue($set), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\JsonWebKeySet', + '/keys/{set}/{kid}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\JsonWebKeySet', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\JsonWebKeySet', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getJsonWebKeySet + * + * Retrieve a JSON Web Key Set + * + * Client for Hydra + * + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\JsonWebKeySet + */ + public function getJsonWebKeySet($set) + { + list($response) = $this->getJsonWebKeySetWithHttpInfo($set); + return $response; + } + + /** + * Operation getJsonWebKeySetWithHttpInfo + * + * Retrieve a JSON Web Key Set + * + * Client for Hydra + * + * @param string $set The set (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\JsonWebKeySet, HTTP status code, HTTP response headers (array of strings) + */ + public function getJsonWebKeySetWithHttpInfo($set) + { + // verify the required parameter 'set' is set + if ($set === null) { + throw new \InvalidArgumentException('Missing the required parameter $set when calling getJsonWebKeySet'); + } + // parse inputs + $resourcePath = "/keys/{set}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($set !== null) { + $resourcePath = str_replace( + "{" . "set" . "}", + $this->apiClient->getSerializer()->toPathValue($set), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\JsonWebKeySet', + '/keys/{set}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\JsonWebKeySet', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\JsonWebKeySet', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation updateJsonWebKey + * + * Update a JSON Web Key + * + * Client for Hydra + * + * @param string $kid The kid of the desired key (required) + * @param string $set The set (required) + * @param \Hydra\SDK\Model\JsonWebKey $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\JsonWebKey + */ + public function updateJsonWebKey($kid, $set, $body = null) + { + list($response) = $this->updateJsonWebKeyWithHttpInfo($kid, $set, $body); + return $response; + } + + /** + * Operation updateJsonWebKeyWithHttpInfo + * + * Update a JSON Web Key + * + * Client for Hydra + * + * @param string $kid The kid of the desired key (required) + * @param string $set The set (required) + * @param \Hydra\SDK\Model\JsonWebKey $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\JsonWebKey, HTTP status code, HTTP response headers (array of strings) + */ + public function updateJsonWebKeyWithHttpInfo($kid, $set, $body = null) + { + // verify the required parameter 'kid' is set + if ($kid === null) { + throw new \InvalidArgumentException('Missing the required parameter $kid when calling updateJsonWebKey'); + } + // verify the required parameter 'set' is set + if ($set === null) { + throw new \InvalidArgumentException('Missing the required parameter $set when calling updateJsonWebKey'); + } + // parse inputs + $resourcePath = "/keys/{set}/{kid}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($kid !== null) { + $resourcePath = str_replace( + "{" . "kid" . "}", + $this->apiClient->getSerializer()->toPathValue($kid), + $resourcePath + ); + } + // path params + if ($set !== null) { + $resourcePath = str_replace( + "{" . "set" . "}", + $this->apiClient->getSerializer()->toPathValue($set), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'PUT', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\JsonWebKey', + '/keys/{set}/{kid}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\JsonWebKey', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\JsonWebKey', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation updateJsonWebKeySet + * + * Update a JSON Web Key Set + * + * Client for Hydra + * + * @param string $set The set (required) + * @param \Hydra\SDK\Model\JsonWebKeySet $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\JsonWebKeySet + */ + public function updateJsonWebKeySet($set, $body = null) + { + list($response) = $this->updateJsonWebKeySetWithHttpInfo($set, $body); + return $response; + } + + /** + * Operation updateJsonWebKeySetWithHttpInfo + * + * Update a JSON Web Key Set + * + * Client for Hydra + * + * @param string $set The set (required) + * @param \Hydra\SDK\Model\JsonWebKeySet $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\JsonWebKeySet, HTTP status code, HTTP response headers (array of strings) + */ + public function updateJsonWebKeySetWithHttpInfo($set, $body = null) + { + // verify the required parameter 'set' is set + if ($set === null) { + throw new \InvalidArgumentException('Missing the required parameter $set when calling updateJsonWebKeySet'); + } + // parse inputs + $resourcePath = "/keys/{set}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($set !== null) { + $resourcePath = str_replace( + "{" . "set" . "}", + $this->apiClient->getSerializer()->toPathValue($set), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'PUT', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\JsonWebKeySet', + '/keys/{set}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\JsonWebKeySet', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\JsonWebKeySet', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } +} diff --git a/sdk/php/swagger/lib/Api/OAuth2Api.php b/sdk/php/swagger/lib/Api/OAuth2Api.php new file mode 100644 index 00000000000..a6b826d7cc9 --- /dev/null +++ b/sdk/php/swagger/lib/Api/OAuth2Api.php @@ -0,0 +1,1507 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Api; + +use \Hydra\SDK\ApiClient; +use \Hydra\SDK\ApiException; +use \Hydra\SDK\Configuration; +use \Hydra\SDK\ObjectSerializer; + +/** + * OAuth2Api Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class OAuth2Api +{ + /** + * API Client + * + * @var \Hydra\SDK\ApiClient instance of the ApiClient + */ + protected $apiClient; + + /** + * Constructor + * + * @param \Hydra\SDK\ApiClient|null $apiClient The api client to use + */ + public function __construct(\Hydra\SDK\ApiClient $apiClient = null) + { + if ($apiClient === null) { + $apiClient = new ApiClient(); + } + + $this->apiClient = $apiClient; + } + + /** + * Get API client + * + * @return \Hydra\SDK\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * + * @param \Hydra\SDK\ApiClient $apiClient set the API client + * + * @return OAuth2Api + */ + public function setApiClient(\Hydra\SDK\ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * Operation acceptOAuth2ConsentRequest + * + * Accept a consent request + * + * Client for Hydra + * + * @param string $id (required) + * @param \Hydra\SDK\Model\ConsentRequestAcceptance $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function acceptOAuth2ConsentRequest($id, $body) + { + list($response) = $this->acceptOAuth2ConsentRequestWithHttpInfo($id, $body); + return $response; + } + + /** + * Operation acceptOAuth2ConsentRequestWithHttpInfo + * + * Accept a consent request + * + * Client for Hydra + * + * @param string $id (required) + * @param \Hydra\SDK\Model\ConsentRequestAcceptance $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function acceptOAuth2ConsentRequestWithHttpInfo($id, $body) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling acceptOAuth2ConsentRequest'); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException('Missing the required parameter $body when calling acceptOAuth2ConsentRequest'); + } + // parse inputs + $resourcePath = "/oauth2/consent/requests/{id}/accept"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'PATCH', + $queryParams, + $httpBody, + $headerParams, + null, + '/oauth2/consent/requests/{id}/accept' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation createOAuth2Client + * + * Create an OAuth 2.0 client + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\OAuth2Client $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\OAuth2Client + */ + public function createOAuth2Client($body) + { + list($response) = $this->createOAuth2ClientWithHttpInfo($body); + return $response; + } + + /** + * Operation createOAuth2ClientWithHttpInfo + * + * Create an OAuth 2.0 client + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\OAuth2Client $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\OAuth2Client, HTTP status code, HTTP response headers (array of strings) + */ + public function createOAuth2ClientWithHttpInfo($body) + { + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException('Missing the required parameter $body when calling createOAuth2Client'); + } + // parse inputs + $resourcePath = "/clients"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\OAuth2Client', + '/clients' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\OAuth2Client', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\OAuth2Client', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation deleteOAuth2Client + * + * Deletes an OAuth 2.0 Client + * + * Client for Hydra + * + * @param string $id The id of the OAuth 2.0 Client. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function deleteOAuth2Client($id) + { + list($response) = $this->deleteOAuth2ClientWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteOAuth2ClientWithHttpInfo + * + * Deletes an OAuth 2.0 Client + * + * Client for Hydra + * + * @param string $id The id of the OAuth 2.0 Client. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOAuth2ClientWithHttpInfo($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteOAuth2Client'); + } + // parse inputs + $resourcePath = "/clients/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, + $headerParams, + null, + '/clients/{id}' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getOAuth2Client + * + * Retrieve an OAuth 2.0 Client. + * + * Client for Hydra + * + * @param string $id The id of the OAuth 2.0 Client. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\OAuth2Client + */ + public function getOAuth2Client($id) + { + list($response) = $this->getOAuth2ClientWithHttpInfo($id); + return $response; + } + + /** + * Operation getOAuth2ClientWithHttpInfo + * + * Retrieve an OAuth 2.0 Client. + * + * Client for Hydra + * + * @param string $id The id of the OAuth 2.0 Client. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\OAuth2Client, HTTP status code, HTTP response headers (array of strings) + */ + public function getOAuth2ClientWithHttpInfo($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling getOAuth2Client'); + } + // parse inputs + $resourcePath = "/clients/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\OAuth2Client', + '/clients/{id}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\OAuth2Client', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\OAuth2Client', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getOAuth2ConsentRequest + * + * Receive consent request information + * + * Client for Hydra + * + * @param string $id The id of the OAuth 2.0 Consent Request. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\OAuth2ConsentRequest + */ + public function getOAuth2ConsentRequest($id) + { + list($response) = $this->getOAuth2ConsentRequestWithHttpInfo($id); + return $response; + } + + /** + * Operation getOAuth2ConsentRequestWithHttpInfo + * + * Receive consent request information + * + * Client for Hydra + * + * @param string $id The id of the OAuth 2.0 Consent Request. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\OAuth2ConsentRequest, HTTP status code, HTTP response headers (array of strings) + */ + public function getOAuth2ConsentRequestWithHttpInfo($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling getOAuth2ConsentRequest'); + } + // parse inputs + $resourcePath = "/oauth2/consent/requests/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\OAuth2ConsentRequest', + '/oauth2/consent/requests/{id}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\OAuth2ConsentRequest', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\OAuth2ConsentRequest', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getWellKnown + * + * Server well known configuration + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\WellKnown + */ + public function getWellKnown() + { + list($response) = $this->getWellKnownWithHttpInfo(); + return $response; + } + + /** + * Operation getWellKnownWithHttpInfo + * + * Server well known configuration + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\WellKnown, HTTP status code, HTTP response headers (array of strings) + */ + public function getWellKnownWithHttpInfo() + { + // parse inputs + $resourcePath = "/.well-known/openid-configuration"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/x-www-form-urlencoded']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\WellKnown', + '/.well-known/openid-configuration' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\WellKnown', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\WellKnown', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation introspectOAuth2Token + * + * Introspect OAuth2 tokens + * + * Client for Hydra + * + * @param string $token 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 [RFC6749], Section 5.1. This endpoint DOES NOT accept refresh tokens for validation. (required) + * @param string $scope 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) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\OAuth2TokenIntrospection + */ + public function introspectOAuth2Token($token, $scope = null) + { + list($response) = $this->introspectOAuth2TokenWithHttpInfo($token, $scope); + return $response; + } + + /** + * Operation introspectOAuth2TokenWithHttpInfo + * + * Introspect OAuth2 tokens + * + * Client for Hydra + * + * @param string $token 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 [RFC6749], Section 5.1. This endpoint DOES NOT accept refresh tokens for validation. (required) + * @param string $scope 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) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\OAuth2TokenIntrospection, HTTP status code, HTTP response headers (array of strings) + */ + public function introspectOAuth2TokenWithHttpInfo($token, $scope = null) + { + // verify the required parameter 'token' is set + if ($token === null) { + throw new \InvalidArgumentException('Missing the required parameter $token when calling introspectOAuth2Token'); + } + // parse inputs + $resourcePath = "/oauth2/introspect"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + + // form params + if ($token !== null) { + $formParams['token'] = $this->apiClient->getSerializer()->toFormValue($token); + } + // form params + if ($scope !== null) { + $formParams['scope'] = $this->apiClient->getSerializer()->toFormValue($scope); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires HTTP basic authentication + if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) { + $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword()); + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\OAuth2TokenIntrospection', + '/oauth2/introspect' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\OAuth2TokenIntrospection', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\OAuth2TokenIntrospection', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation listOAuth2Clients + * + * List OAuth 2.0 Clients + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\OAuth2Client[] + */ + public function listOAuth2Clients() + { + list($response) = $this->listOAuth2ClientsWithHttpInfo(); + return $response; + } + + /** + * Operation listOAuth2ClientsWithHttpInfo + * + * List OAuth 2.0 Clients + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\OAuth2Client[], HTTP status code, HTTP response headers (array of strings) + */ + public function listOAuth2ClientsWithHttpInfo() + { + // parse inputs + $resourcePath = "/clients"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\OAuth2Client[]', + '/clients' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\OAuth2Client[]', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\OAuth2Client[]', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation oauthAuth + * + * The OAuth 2.0 authorize endpoint + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function oauthAuth() + { + list($response) = $this->oauthAuthWithHttpInfo(); + return $response; + } + + /** + * Operation oauthAuthWithHttpInfo + * + * The OAuth 2.0 authorize endpoint + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function oauthAuthWithHttpInfo() + { + // parse inputs + $resourcePath = "/oauth2/auth"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + null, + '/oauth2/auth' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation oauthToken + * + * The OAuth 2.0 token endpoint + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\InlineResponse2001 + */ + public function oauthToken() + { + list($response) = $this->oauthTokenWithHttpInfo(); + return $response; + } + + /** + * Operation oauthTokenWithHttpInfo + * + * The OAuth 2.0 token endpoint + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\InlineResponse2001, HTTP status code, HTTP response headers (array of strings) + */ + public function oauthTokenWithHttpInfo() + { + // parse inputs + $resourcePath = "/oauth2/token"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires HTTP basic authentication + if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) { + $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword()); + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\InlineResponse2001', + '/oauth2/token' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\InlineResponse2001', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse2001', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation rejectOAuth2ConsentRequest + * + * Reject a consent request + * + * Client for Hydra + * + * @param string $id (required) + * @param \Hydra\SDK\Model\ConsentRequestRejection $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function rejectOAuth2ConsentRequest($id, $body) + { + list($response) = $this->rejectOAuth2ConsentRequestWithHttpInfo($id, $body); + return $response; + } + + /** + * Operation rejectOAuth2ConsentRequestWithHttpInfo + * + * Reject a consent request + * + * Client for Hydra + * + * @param string $id (required) + * @param \Hydra\SDK\Model\ConsentRequestRejection $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function rejectOAuth2ConsentRequestWithHttpInfo($id, $body) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling rejectOAuth2ConsentRequest'); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException('Missing the required parameter $body when calling rejectOAuth2ConsentRequest'); + } + // parse inputs + $resourcePath = "/oauth2/consent/requests/{id}/reject"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'PATCH', + $queryParams, + $httpBody, + $headerParams, + null, + '/oauth2/consent/requests/{id}/reject' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation revokeOAuth2Token + * + * Revoke OAuth2 tokens + * + * Client for Hydra + * + * @param string $token (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function revokeOAuth2Token($token) + { + list($response) = $this->revokeOAuth2TokenWithHttpInfo($token); + return $response; + } + + /** + * Operation revokeOAuth2TokenWithHttpInfo + * + * Revoke OAuth2 tokens + * + * Client for Hydra + * + * @param string $token (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function revokeOAuth2TokenWithHttpInfo($token) + { + // verify the required parameter 'token' is set + if ($token === null) { + throw new \InvalidArgumentException('Missing the required parameter $token when calling revokeOAuth2Token'); + } + // parse inputs + $resourcePath = "/oauth2/revoke"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + + // form params + if ($token !== null) { + $formParams['token'] = $this->apiClient->getSerializer()->toFormValue($token); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires HTTP basic authentication + if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) { + $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword()); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/oauth2/revoke' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation updateOAuth2Client + * + * Update an OAuth 2.0 Client + * + * Client for Hydra + * + * @param string $id (required) + * @param \Hydra\SDK\Model\OAuth2Client $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\OAuth2Client + */ + public function updateOAuth2Client($id, $body) + { + list($response) = $this->updateOAuth2ClientWithHttpInfo($id, $body); + return $response; + } + + /** + * Operation updateOAuth2ClientWithHttpInfo + * + * Update an OAuth 2.0 Client + * + * Client for Hydra + * + * @param string $id (required) + * @param \Hydra\SDK\Model\OAuth2Client $body (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\OAuth2Client, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOAuth2ClientWithHttpInfo($id, $body) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling updateOAuth2Client'); + } + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException('Missing the required parameter $body when calling updateOAuth2Client'); + } + // parse inputs + $resourcePath = "/clients/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'PUT', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\OAuth2Client', + '/clients/{id}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\OAuth2Client', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\OAuth2Client', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation userinfo + * + * OpenID Connect Userinfo + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\SwaggeruserinfoResponsePayload + */ + public function userinfo() + { + list($response) = $this->userinfoWithHttpInfo(); + return $response; + } + + /** + * Operation userinfoWithHttpInfo + * + * OpenID Connect Userinfo + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\SwaggeruserinfoResponsePayload, HTTP status code, HTTP response headers (array of strings) + */ + public function userinfoWithHttpInfo() + { + // parse inputs + $resourcePath = "/userinfo"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/x-www-form-urlencoded']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\SwaggeruserinfoResponsePayload', + '/userinfo' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\SwaggeruserinfoResponsePayload', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\SwaggeruserinfoResponsePayload', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation wellKnown + * + * Get list of well known JSON Web Keys + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\JsonWebKeySet + */ + public function wellKnown() + { + list($response) = $this->wellKnownWithHttpInfo(); + return $response; + } + + /** + * Operation wellKnownWithHttpInfo + * + * Get list of well known JSON Web Keys + * + * Client for Hydra + * + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\JsonWebKeySet, HTTP status code, HTTP response headers (array of strings) + */ + public function wellKnownWithHttpInfo() + { + // parse inputs + $resourcePath = "/.well-known/jwks.json"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\JsonWebKeySet', + '/.well-known/jwks.json' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\JsonWebKeySet', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\JsonWebKeySet', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } +} diff --git a/sdk/php/swagger/lib/Api/PolicyApi.php b/sdk/php/swagger/lib/Api/PolicyApi.php new file mode 100644 index 00000000000..3977383cb5e --- /dev/null +++ b/sdk/php/swagger/lib/Api/PolicyApi.php @@ -0,0 +1,593 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Api; + +use \Hydra\SDK\ApiClient; +use \Hydra\SDK\ApiException; +use \Hydra\SDK\Configuration; +use \Hydra\SDK\ObjectSerializer; + +/** + * PolicyApi Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class PolicyApi +{ + /** + * API Client + * + * @var \Hydra\SDK\ApiClient instance of the ApiClient + */ + protected $apiClient; + + /** + * Constructor + * + * @param \Hydra\SDK\ApiClient|null $apiClient The api client to use + */ + public function __construct(\Hydra\SDK\ApiClient $apiClient = null) + { + if ($apiClient === null) { + $apiClient = new ApiClient(); + } + + $this->apiClient = $apiClient; + } + + /** + * Get API client + * + * @return \Hydra\SDK\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * + * @param \Hydra\SDK\ApiClient $apiClient set the API client + * + * @return PolicyApi + */ + public function setApiClient(\Hydra\SDK\ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * Operation createPolicy + * + * Create an Access Control Policy + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\Policy $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\Policy + */ + public function createPolicy($body = null) + { + list($response) = $this->createPolicyWithHttpInfo($body); + return $response; + } + + /** + * Operation createPolicyWithHttpInfo + * + * Create an Access Control Policy + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\Policy $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\Policy, HTTP status code, HTTP response headers (array of strings) + */ + public function createPolicyWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/policies"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\Policy', + '/policies' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\Policy', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\Policy', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation deletePolicy + * + * Delete an Access Control Policy + * + * Client for Hydra + * + * @param string $id The id of the policy. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function deletePolicy($id) + { + list($response) = $this->deletePolicyWithHttpInfo($id); + return $response; + } + + /** + * Operation deletePolicyWithHttpInfo + * + * Delete an Access Control Policy + * + * Client for Hydra + * + * @param string $id The id of the policy. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePolicyWithHttpInfo($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling deletePolicy'); + } + // parse inputs + $resourcePath = "/policies/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, + $headerParams, + null, + '/policies/{id}' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getPolicy + * + * Get an Access Control Policy + * + * Client for Hydra + * + * @param string $id The id of the policy. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\Policy + */ + public function getPolicy($id) + { + list($response) = $this->getPolicyWithHttpInfo($id); + return $response; + } + + /** + * Operation getPolicyWithHttpInfo + * + * Get an Access Control Policy + * + * Client for Hydra + * + * @param string $id The id of the policy. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\Policy, HTTP status code, HTTP response headers (array of strings) + */ + public function getPolicyWithHttpInfo($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling getPolicy'); + } + // parse inputs + $resourcePath = "/policies/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\Policy', + '/policies/{id}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\Policy', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\Policy', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation listPolicies + * + * List Access Control Policies + * + * Client for Hydra + * + * @param int $offset The offset from where to start looking. (optional) + * @param int $limit The maximum amount of policies returned. (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\Policy[] + */ + public function listPolicies($offset = null, $limit = null) + { + list($response) = $this->listPoliciesWithHttpInfo($offset, $limit); + return $response; + } + + /** + * Operation listPoliciesWithHttpInfo + * + * List Access Control Policies + * + * Client for Hydra + * + * @param int $offset The offset from where to start looking. (optional) + * @param int $limit The maximum amount of policies returned. (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\Policy[], HTTP status code, HTTP response headers (array of strings) + */ + public function listPoliciesWithHttpInfo($offset = null, $limit = null) + { + // parse inputs + $resourcePath = "/policies"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // query params + if ($offset !== null) { + $queryParams['offset'] = $this->apiClient->getSerializer()->toQueryValue($offset); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\Policy[]', + '/policies' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\Policy[]', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\Policy[]', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation updatePolicy + * + * Update an Access Control Polic + * + * Client for Hydra + * + * @param string $id The id of the policy. (required) + * @param \Hydra\SDK\Model\Policy $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\Policy + */ + public function updatePolicy($id, $body = null) + { + list($response) = $this->updatePolicyWithHttpInfo($id, $body); + return $response; + } + + /** + * Operation updatePolicyWithHttpInfo + * + * Update an Access Control Polic + * + * Client for Hydra + * + * @param string $id The id of the policy. (required) + * @param \Hydra\SDK\Model\Policy $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\Policy, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePolicyWithHttpInfo($id, $body = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling updatePolicy'); + } + // parse inputs + $resourcePath = "/policies/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'PUT', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\Policy', + '/policies/{id}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\Policy', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\Policy', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } +} diff --git a/sdk/php/swagger/lib/Api/WardenApi.php b/sdk/php/swagger/lib/Api/WardenApi.php new file mode 100644 index 00000000000..a60c81848d0 --- /dev/null +++ b/sdk/php/swagger/lib/Api/WardenApi.php @@ -0,0 +1,890 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Api; + +use \Hydra\SDK\ApiClient; +use \Hydra\SDK\ApiException; +use \Hydra\SDK\Configuration; +use \Hydra\SDK\ObjectSerializer; + +/** + * WardenApi Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class WardenApi +{ + /** + * API Client + * + * @var \Hydra\SDK\ApiClient instance of the ApiClient + */ + protected $apiClient; + + /** + * Constructor + * + * @param \Hydra\SDK\ApiClient|null $apiClient The api client to use + */ + public function __construct(\Hydra\SDK\ApiClient $apiClient = null) + { + if ($apiClient === null) { + $apiClient = new ApiClient(); + } + + $this->apiClient = $apiClient; + } + + /** + * Get API client + * + * @return \Hydra\SDK\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * + * @param \Hydra\SDK\ApiClient $apiClient set the API client + * + * @return WardenApi + */ + public function setApiClient(\Hydra\SDK\ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * Operation addMembersToGroup + * + * Add members to a group + * + * Client for Hydra + * + * @param string $id The id of the group to modify. (required) + * @param \Hydra\SDK\Model\GroupMembers $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function addMembersToGroup($id, $body = null) + { + list($response) = $this->addMembersToGroupWithHttpInfo($id, $body); + return $response; + } + + /** + * Operation addMembersToGroupWithHttpInfo + * + * Add members to a group + * + * Client for Hydra + * + * @param string $id The id of the group to modify. (required) + * @param \Hydra\SDK\Model\GroupMembers $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function addMembersToGroupWithHttpInfo($id, $body = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling addMembersToGroup'); + } + // parse inputs + $resourcePath = "/warden/groups/{id}/members"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + null, + '/warden/groups/{id}/members' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation createGroup + * + * Create a group + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\Group $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\Group + */ + public function createGroup($body = null) + { + list($response) = $this->createGroupWithHttpInfo($body); + return $response; + } + + /** + * Operation createGroupWithHttpInfo + * + * Create a group + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\Group $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\Group, HTTP status code, HTTP response headers (array of strings) + */ + public function createGroupWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/warden/groups"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\Group', + '/warden/groups' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\Group', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\Group', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation deleteGroup + * + * Delete a group by id + * + * Client for Hydra + * + * @param string $id The id of the group to look up. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function deleteGroup($id) + { + list($response) = $this->deleteGroupWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteGroupWithHttpInfo + * + * Delete a group by id + * + * Client for Hydra + * + * @param string $id The id of the group to look up. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteGroupWithHttpInfo($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling deleteGroup'); + } + // parse inputs + $resourcePath = "/warden/groups/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, + $headerParams, + null, + '/warden/groups/{id}' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation doesWardenAllowAccessRequest + * + * Check if an access request is valid (without providing an access token) + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\WardenAccessRequest $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\WardenAccessRequestResponse + */ + public function doesWardenAllowAccessRequest($body = null) + { + list($response) = $this->doesWardenAllowAccessRequestWithHttpInfo($body); + return $response; + } + + /** + * Operation doesWardenAllowAccessRequestWithHttpInfo + * + * Check if an access request is valid (without providing an access token) + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\WardenAccessRequest $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\WardenAccessRequestResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function doesWardenAllowAccessRequestWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/warden/allowed"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\WardenAccessRequestResponse', + '/warden/allowed' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\WardenAccessRequestResponse', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\WardenAccessRequestResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation doesWardenAllowTokenAccessRequest + * + * Check if an access request is valid (providing an access token) + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\WardenTokenAccessRequest $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\WardenTokenAccessRequestResponse + */ + public function doesWardenAllowTokenAccessRequest($body = null) + { + list($response) = $this->doesWardenAllowTokenAccessRequestWithHttpInfo($body); + return $response; + } + + /** + * Operation doesWardenAllowTokenAccessRequestWithHttpInfo + * + * Check if an access request is valid (providing an access token) + * + * Client for Hydra + * + * @param \Hydra\SDK\Model\WardenTokenAccessRequest $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\WardenTokenAccessRequestResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function doesWardenAllowTokenAccessRequestWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/warden/token/allowed"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\WardenTokenAccessRequestResponse', + '/warden/token/allowed' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\WardenTokenAccessRequestResponse', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\WardenTokenAccessRequestResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation getGroup + * + * Get a group by id + * + * Client for Hydra + * + * @param string $id The id of the group to look up. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\Group + */ + public function getGroup($id) + { + list($response) = $this->getGroupWithHttpInfo($id); + return $response; + } + + /** + * Operation getGroupWithHttpInfo + * + * Get a group by id + * + * Client for Hydra + * + * @param string $id The id of the group to look up. (required) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\Group, HTTP status code, HTTP response headers (array of strings) + */ + public function getGroupWithHttpInfo($id) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling getGroup'); + } + // parse inputs + $resourcePath = "/warden/groups/{id}"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\Group', + '/warden/groups/{id}' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\Group', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\Group', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation listGroups + * + * List groups + * + * Client for Hydra + * + * @param string $member The id of the member to look up. (optional) + * @param int $limit The maximum amount of policies returned. (optional) + * @param int $offset The offset from where to start looking. (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return \Hydra\SDK\Model\Group[] + */ + public function listGroups($member = null, $limit = null, $offset = null) + { + list($response) = $this->listGroupsWithHttpInfo($member, $limit, $offset); + return $response; + } + + /** + * Operation listGroupsWithHttpInfo + * + * List groups + * + * Client for Hydra + * + * @param string $member The id of the member to look up. (optional) + * @param int $limit The maximum amount of policies returned. (optional) + * @param int $offset The offset from where to start looking. (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of \Hydra\SDK\Model\Group[], HTTP status code, HTTP response headers (array of strings) + */ + public function listGroupsWithHttpInfo($member = null, $limit = null, $offset = null) + { + // parse inputs + $resourcePath = "/warden/groups"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // query params + if ($member !== null) { + $queryParams['member'] = $this->apiClient->getSerializer()->toQueryValue($member); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = $this->apiClient->getSerializer()->toQueryValue($offset); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Hydra\SDK\Model\Group[]', + '/warden/groups' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Hydra\SDK\Model\Group[]', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\Group[]', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation removeMembersFromGroup + * + * Remove members from a group + * + * Client for Hydra + * + * @param string $id The id of the group to modify. (required) + * @param \Hydra\SDK\Model\GroupMembers $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return void + */ + public function removeMembersFromGroup($id, $body = null) + { + list($response) = $this->removeMembersFromGroupWithHttpInfo($id, $body); + return $response; + } + + /** + * Operation removeMembersFromGroupWithHttpInfo + * + * Remove members from a group + * + * Client for Hydra + * + * @param string $id The id of the group to modify. (required) + * @param \Hydra\SDK\Model\GroupMembers $body (optional) + * @throws \Hydra\SDK\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeMembersFromGroupWithHttpInfo($id, $body = null) + { + // verify the required parameter 'id' is set + if ($id === null) { + throw new \InvalidArgumentException('Missing the required parameter $id when calling removeMembersFromGroup'); + } + // parse inputs + $resourcePath = "/warden/groups/{id}/members"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + // path params + if ($id !== null) { + $resourcePath = str_replace( + "{" . "id" . "}", + $this->apiClient->getSerializer()->toPathValue($id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, + $headerParams, + null, + '/warden/groups/{id}/members' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 401: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 403: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Hydra\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } +} diff --git a/sdk/php/swagger/lib/ApiClient.php b/sdk/php/swagger/lib/ApiClient.php new file mode 100644 index 00000000000..bc41775b387 --- /dev/null +++ b/sdk/php/swagger/lib/ApiClient.php @@ -0,0 +1,371 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK; + +/** + * ApiClient Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ApiClient +{ + public static $PATCH = "PATCH"; + public static $POST = "POST"; + public static $GET = "GET"; + public static $HEAD = "HEAD"; + public static $OPTIONS = "OPTIONS"; + public static $PUT = "PUT"; + public static $DELETE = "DELETE"; + + /** + * Configuration + * + * @var Configuration + */ + protected $config; + + /** + * Object Serializer + * + * @var ObjectSerializer + */ + protected $serializer; + + /** + * Constructor of the class + * + * @param Configuration $config config for this ApiClient + */ + public function __construct(\Hydra\SDK\Configuration $config = null) + { + if ($config === null) { + $config = Configuration::getDefaultConfiguration(); + } + + $this->config = $config; + $this->serializer = new ObjectSerializer(); + } + + /** + * Get the config + * + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Get the serializer + * + * @return ObjectSerializer + */ + public function getSerializer() + { + return $this->serializer; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->config->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->config->getApiKey($apiKeyIdentifier); + + if (!isset($apiKey)) { + return null; + } + + if (isset($prefix)) { + $keyWithPrefix = $prefix." ".$apiKey; + } else { + $keyWithPrefix = $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Make the HTTP call (Sync) + * + * @param string $resourcePath path to method endpoint + * @param string $method method to call + * @param array $queryParams parameters to be place in query URL + * @param array $postData parameters to be placed in POST body + * @param array $headerParams parameters to be place in request header + * @param string $responseType expected response type of the endpoint + * @param string $endpointPath path to method endpoint before expanding parameters + * + * @throws \Hydra\SDK\ApiException on a non 2xx response + * @return mixed + */ + public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) + { + $headers = []; + + // construct the http header + $headerParams = array_merge( + (array)$this->config->getDefaultHeaders(), + (array)$headerParams + ); + + foreach ($headerParams as $key => $val) { + $headers[] = "$key: $val"; + } + + // form data + if ($postData and in_array('Content-Type: application/x-www-form-urlencoded', $headers, true)) { + $postData = http_build_query($postData); + } elseif ((is_object($postData) or is_array($postData)) and !in_array('Content-Type: multipart/form-data', $headers, true)) { // json model + $postData = json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($postData)); + } + + $url = $this->config->getHost() . $resourcePath; + + $curl = curl_init(); + // set timeout, if needed + if ($this->config->getCurlTimeout() !== 0) { + curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); + } + // set connect timeout, if needed + if ($this->config->getCurlConnectTimeout() != 0) { + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout()); + } + + // return the result on success, rather than just true + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + + // disable SSL verification, if needed + if ($this->config->getSSLVerification() === false) { + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); + } + + if ($this->config->getCurlProxyHost()) { + curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost()); + } + + if ($this->config->getCurlProxyPort()) { + curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort()); + } + + if ($this->config->getCurlProxyType()) { + curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType()); + } + + if ($this->config->getCurlProxyUser()) { + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword()); + } + + if (!empty($queryParams)) { + $url = ($url . '?' . http_build_query($queryParams)); + } + + if ($this->config->getAllowEncoding()) { + curl_setopt($curl, CURLOPT_ENCODING, ''); + } + + if ($method === self::$POST) { + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } elseif ($method === self::$HEAD) { + curl_setopt($curl, CURLOPT_NOBODY, true); + } elseif ($method === self::$OPTIONS) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "OPTIONS"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } elseif ($method === self::$PATCH) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } elseif ($method === self::$PUT) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } elseif ($method === self::$DELETE) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } elseif ($method !== self::$GET) { + throw new ApiException('Method ' . $method . ' is not recognized.'); + } + curl_setopt($curl, CURLOPT_URL, $url); + + // Set user agent + curl_setopt($curl, CURLOPT_USERAGENT, $this->config->getUserAgent()); + + // debugging for curl + if ($this->config->getDebug()) { + error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); + + curl_setopt($curl, CURLOPT_VERBOSE, 1); + curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); + } else { + curl_setopt($curl, CURLOPT_VERBOSE, 0); + } + + // obtain the HTTP response headers + curl_setopt($curl, CURLOPT_HEADER, 1); + + // Make the request + $response = curl_exec($curl); + $http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); + $http_header = $this->httpParseHeaders(substr($response, 0, $http_header_size)); + $http_body = substr($response, $http_header_size); + $response_info = curl_getinfo($curl); + + // debug HTTP response body + if ($this->config->getDebug()) { + error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); + } + + // Handle the response + if ($response_info['http_code'] === 0) { + $curl_error_message = curl_error($curl); + + // curl_exec can sometimes fail but still return a blank message from curl_error(). + if (!empty($curl_error_message)) { + $error_message = "API call to $url failed: $curl_error_message"; + } else { + $error_message = "API call to $url failed, but for an unknown reason. " . + "This could happen if you are disconnected from the network."; + } + + $exception = new ApiException($error_message, 0, null, null); + $exception->setResponseObject($response_info); + throw $exception; + } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { + // return raw body if response is a file + if ($responseType === '\SplFileObject' || $responseType === 'string') { + return [$http_body, $response_info['http_code'], $http_header]; + } + + $data = json_decode($http_body); + if (json_last_error() > 0) { // if response is a string + $data = $http_body; + } + } else { + $data = json_decode($http_body); + if (json_last_error() > 0) { // if response is a string + $data = $http_body; + } + + throw new ApiException( + "[".$response_info['http_code']."] Error connecting to the API ($url)", + $response_info['http_code'], + $http_header, + $data + ); + } + return [$data, $response_info['http_code'], $http_header]; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + public function selectHeaderAccept($accept) + { + if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $content_type Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + public function selectHeaderContentType($content_type) + { + if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $content_type)) { + return 'application/json'; + } else { + return implode(',', $content_type); + } + } + + /** + * Return an array of HTTP response headers + * + * @param string $raw_headers A string of raw HTTP response headers + * + * @return string[] Array of HTTP response heaers + */ + protected function httpParseHeaders($raw_headers) + { + // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 + $headers = []; + $key = ''; + + foreach (explode("\n", $raw_headers) as $h) { + $h = explode(':', $h, 2); + + if (isset($h[1])) { + if (!isset($headers[$h[0]])) { + $headers[$h[0]] = trim($h[1]); + } elseif (is_array($headers[$h[0]])) { + $headers[$h[0]] = array_merge($headers[$h[0]], [trim($h[1])]); + } else { + $headers[$h[0]] = array_merge([$headers[$h[0]]], [trim($h[1])]); + } + + $key = $h[0]; + } else { + if (substr($h[0], 0, 1) === "\t") { + $headers[$key] .= "\r\n\t".trim($h[0]); + } elseif (!$key) { + $headers[0] = trim($h[0]); + } + trim($h[0]); + } + } + + return $headers; + } +} diff --git a/sdk/php/swagger/lib/ApiException.php b/sdk/php/swagger/lib/ApiException.php new file mode 100644 index 00000000000..c540a184c82 --- /dev/null +++ b/sdk/php/swagger/lib/ApiException.php @@ -0,0 +1,121 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK; + +use \Exception; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ApiException extends Exception +{ + + /** + * The HTTP body of the server response either as Json or string. + * + * @var mixed + */ + protected $responseBody; + + /** + * The HTTP header of the server response. + * + * @var string[] + */ + protected $responseHeaders; + + /** + * The deserialized response object + * + * @var $responseObject; + */ + protected $responseObject; + + /** + * Constructor + * + * @param string $message Error message + * @param int $code HTTP status code + * @param string[] $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string + */ + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) + { + parent::__construct($message, $code); + $this->responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[] HTTP response headers + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return mixed HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deseralized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deseralized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/sdk/php/swagger/lib/Configuration.php b/sdk/php/swagger/lib/Configuration.php new file mode 100644 index 00000000000..477071b1420 --- /dev/null +++ b/sdk/php/swagger/lib/Configuration.php @@ -0,0 +1,735 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK; + +/** + * Configuration Class Doc Comment + * PHP version 5 + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Configuration +{ + private static $defaultConfiguration; + + /** + * Associate array to store API key(s) + * + * @var string[] + */ + protected $apiKeys = []; + + /** + * Associate array to store API prefix (e.g. Bearer) + * + * @var string[] + */ + protected $apiKeyPrefixes = []; + + /** + * Access token for OAuth + * + * @var string + */ + protected $accessToken = ''; + + /** + * Username for HTTP basic authentication + * + * @var string + */ + protected $username = ''; + + /** + * Password for HTTP basic authentication + * + * @var string + */ + protected $password = ''; + + /** + * The default header(s) + * + * @var array + */ + protected $defaultHeaders = []; + + /** + * The host + * + * @var string + */ + protected $host = 'http://localhost'; + + /** + * Timeout (second) of the HTTP request, by default set to 0, no timeout + * + * @var string + */ + protected $curlTimeout = 0; + + /** + * Timeout (second) of the HTTP connection, by default set to 0, no timeout + * + * @var string + */ + protected $curlConnectTimeout = 0; + + /** + * User agent of the HTTP request, set to "PHP-Swagger" by default + * + * @var string + */ + protected $userAgent = 'Swagger-Codegen/1.0.0/php'; + + /** + * Debug switch (default set to false) + * + * @var bool + */ + protected $debug = false; + + /** + * Debug file location (log to STDOUT by default) + * + * @var string + */ + protected $debugFile = 'php://output'; + + /** + * Debug file location (log to STDOUT by default) + * + * @var string + */ + protected $tempFolderPath; + + /** + * Indicates if SSL verification should be enabled or disabled. + * + * This is useful if the host uses a self-signed SSL certificate. + * + * @var boolean True if the certificate should be validated, false otherwise. + */ + protected $sslVerification = true; + + /** + * Curl proxy host + * + * @var string + */ + protected $proxyHost; + + /** + * Curl proxy port + * + * @var integer + */ + protected $proxyPort; + + /** + * Curl proxy type, e.g. CURLPROXY_HTTP or CURLPROXY_SOCKS5 + * + * @see https://secure.php.net/manual/en/function.curl-setopt.php + * @var integer + */ + protected $proxyType; + + /** + * Curl proxy username + * + * @var string + */ + protected $proxyUser; + + /** + * Curl proxy password + * + * @var string + */ + protected $proxyPassword; + + /** + * Allow Curl encoding header + * + * @var bool + */ + protected $allowEncoding = false; + + /** + * Constructor + */ + public function __construct() + { + $this->tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Adds a default header + * + * @param string $headerName header name (e.g. Token) + * @param string $headerValue header value (e.g. 1z8wp3) + * + * @throws \InvalidArgumentException + * @return $this + */ + public function addDefaultHeader($headerName, $headerValue) + { + if (!is_string($headerName)) { + throw new \InvalidArgumentException('Header name must be a string.'); + } + + $this->defaultHeaders[$headerName] = $headerValue; + return $this; + } + + /** + * Gets the default header + * + * @return array An array of default header(s) + */ + public function getDefaultHeaders() + { + return $this->defaultHeaders; + } + + /** + * Deletes a default header + * + * @param string $headerName the header to delete + * + * @return $this + */ + public function deleteDefaultHeader($headerName) + { + unset($this->defaultHeaders[$headerName]); + return $this; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets the HTTP timeout value + * + * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setCurlTimeout($seconds) + { + if (!is_numeric($seconds) || $seconds < 0) { + throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.'); + } + + $this->curlTimeout = $seconds; + return $this; + } + + /** + * Gets the HTTP timeout value + * + * @return string HTTP timeout value + */ + public function getCurlTimeout() + { + return $this->curlTimeout; + } + + /** + * Sets the HTTP connect timeout value + * + * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setCurlConnectTimeout($seconds) + { + if (!is_numeric($seconds) || $seconds < 0) { + throw new \InvalidArgumentException('Connect timeout value must be numeric and a non-negative number.'); + } + + $this->curlConnectTimeout = $seconds; + return $this; + } + + /** + * Set whether to accept encoding + * @param bool $allowEncoding + * + * @return $this + */ + public function setAllowEncoding($allowEncoding) + { + $this->allowEncoding = $allowEncoding; + return $this; + } + + /** + * Gets the HTTP connect timeout value + * + * @return string HTTP connect timeout value + */ + public function getCurlConnectTimeout() + { + return $this->curlConnectTimeout; + } + + /** + * Get whether to allow encoding + * + * @return bool + */ + public function getAllowEncoding() + { + return $this->allowEncoding; + } + + /** + * Sets the HTTP Proxy Host + * + * @param string $proxyHost HTTP Proxy URL + * + * @return $this + */ + public function setCurlProxyHost($proxyHost) + { + $this->proxyHost = $proxyHost; + return $this; + } + + /** + * Gets the HTTP Proxy Host + * + * @return string + */ + public function getCurlProxyHost() + { + return $this->proxyHost; + } + + /** + * Sets the HTTP Proxy Port + * + * @param integer $proxyPort HTTP Proxy Port + * + * @return $this + */ + public function setCurlProxyPort($proxyPort) + { + $this->proxyPort = $proxyPort; + return $this; + } + + /** + * Gets the HTTP Proxy Port + * + * @return integer + */ + public function getCurlProxyPort() + { + return $this->proxyPort; + } + + /** + * Sets the HTTP Proxy Type + * + * @param integer $proxyType HTTP Proxy Type + * + * @return $this + */ + public function setCurlProxyType($proxyType) + { + $this->proxyType = $proxyType; + return $this; + } + + /** + * Gets the HTTP Proxy Type + * + * @return integer + */ + public function getCurlProxyType() + { + return $this->proxyType; + } + + /** + * Sets the HTTP Proxy User + * + * @param string $proxyUser HTTP Proxy User + * + * @return $this + */ + public function setCurlProxyUser($proxyUser) + { + $this->proxyUser = $proxyUser; + return $this; + } + + /** + * Gets the HTTP Proxy User + * + * @return string + */ + public function getCurlProxyUser() + { + return $this->proxyUser; + } + + /** + * Sets the HTTP Proxy Password + * + * @param string $proxyPassword HTTP Proxy Password + * + * @return $this + */ + public function setCurlProxyPassword($proxyPassword) + { + $this->proxyPassword = $proxyPassword; + return $this; + } + + /** + * Gets the HTTP Proxy Password + * + * @return string + */ + public function getCurlProxyPassword() + { + return $this->proxyPassword; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Sets if SSL verification should be enabled or disabled + * + * @param boolean $sslVerification True if the certificate should be validated, false otherwise + * + * @return $this + */ + public function setSSLVerification($sslVerification) + { + $this->sslVerification = $sslVerification; + return $this; + } + + /** + * Gets if SSL verification should be enabled or disabled + * + * @return boolean True if the certificate should be validated, false otherwise + */ + public function getSSLVerification() + { + return $this->sslVerification; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the detault configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (Hydra\SDK) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' OpenAPI Spec Version: Latest' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } +} diff --git a/sdk/php/swagger/lib/Model/ConsentRequest.php b/sdk/php/swagger/lib/Model/ConsentRequest.php new file mode 100644 index 00000000000..146e0e2ddc4 --- /dev/null +++ b/sdk/php/swagger/lib/Model/ConsentRequest.php @@ -0,0 +1,350 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * ConsentRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ConsentRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'ConsentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'client_id' => 'string', + 'expires_at' => '\DateTime', + 'id' => 'string', + 'redirect_url' => 'string', + 'requested_scopes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'client_id' => null, + 'expires_at' => 'date-time', + 'id' => null, + 'redirect_url' => null, + 'requested_scopes' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'client_id' => 'clientId', + 'expires_at' => 'expiresAt', + 'id' => 'id', + 'redirect_url' => 'redirectUrl', + 'requested_scopes' => 'requestedScopes' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'client_id' => 'setClientId', + 'expires_at' => 'setExpiresAt', + 'id' => 'setId', + 'redirect_url' => 'setRedirectUrl', + 'requested_scopes' => 'setRequestedScopes' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'client_id' => 'getClientId', + 'expires_at' => 'getExpiresAt', + 'id' => 'getId', + 'redirect_url' => 'getRedirectUrl', + 'requested_scopes' => 'getRequestedScopes' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['client_id'] = isset($data['client_id']) ? $data['client_id'] : null; + $this->container['expires_at'] = isset($data['expires_at']) ? $data['expires_at'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; + $this->container['requested_scopes'] = isset($data['requested_scopes']) ? $data['requested_scopes'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets client_id + * @return string + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * @param string $client_id ClientID is the client id that initiated the OAuth2 request. + * @return $this + */ + public function setClientId($client_id) + { + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets expires_at + * @return \DateTime + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * @param \DateTime $expires_at ExpiresAt is the time where the access request will expire. + * @return $this + */ + public function setExpiresAt($expires_at) + { + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id ID is the id of this consent request. + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets redirect_url + * @return string + */ + public function getRedirectUrl() + { + return $this->container['redirect_url']; + } + + /** + * Sets redirect_url + * @param string $redirect_url Redirect URL is the URL where the user agent should be redirected to after the consent has been accepted or rejected. + * @return $this + */ + public function setRedirectUrl($redirect_url) + { + $this->container['redirect_url'] = $redirect_url; + + return $this; + } + + /** + * Gets requested_scopes + * @return string[] + */ + public function getRequestedScopes() + { + return $this->container['requested_scopes']; + } + + /** + * Sets requested_scopes + * @param string[] $requested_scopes RequestedScopes represents a list of scopes that have been requested by the OAuth2 request initiator. + * @return $this + */ + public function setRequestedScopes($requested_scopes) + { + $this->container['requested_scopes'] = $requested_scopes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/ConsentRequestAcceptance.php b/sdk/php/swagger/lib/Model/ConsentRequestAcceptance.php new file mode 100644 index 00000000000..38327108155 --- /dev/null +++ b/sdk/php/swagger/lib/Model/ConsentRequestAcceptance.php @@ -0,0 +1,323 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * ConsentRequestAcceptance Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ConsentRequestAcceptance implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'consentRequestAcceptance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'access_token_extra' => 'map[string,object]', + 'grant_scopes' => 'string[]', + 'id_token_extra' => 'map[string,object]', + 'subject' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'access_token_extra' => null, + 'grant_scopes' => null, + 'id_token_extra' => null, + 'subject' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'access_token_extra' => 'accessTokenExtra', + 'grant_scopes' => 'grantScopes', + 'id_token_extra' => 'idTokenExtra', + 'subject' => 'subject' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'access_token_extra' => 'setAccessTokenExtra', + 'grant_scopes' => 'setGrantScopes', + 'id_token_extra' => 'setIdTokenExtra', + 'subject' => 'setSubject' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'access_token_extra' => 'getAccessTokenExtra', + 'grant_scopes' => 'getGrantScopes', + 'id_token_extra' => 'getIdTokenExtra', + 'subject' => 'getSubject' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['access_token_extra'] = isset($data['access_token_extra']) ? $data['access_token_extra'] : null; + $this->container['grant_scopes'] = isset($data['grant_scopes']) ? $data['grant_scopes'] : null; + $this->container['id_token_extra'] = isset($data['id_token_extra']) ? $data['id_token_extra'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets access_token_extra + * @return map[string,object] + */ + public function getAccessTokenExtra() + { + return $this->container['access_token_extra']; + } + + /** + * Sets access_token_extra + * @param map[string,object] $access_token_extra AccessTokenExtra represents arbitrary data that will be added to the access token and that will be returned on introspection and warden requests. + * @return $this + */ + public function setAccessTokenExtra($access_token_extra) + { + $this->container['access_token_extra'] = $access_token_extra; + + return $this; + } + + /** + * Gets grant_scopes + * @return string[] + */ + public function getGrantScopes() + { + return $this->container['grant_scopes']; + } + + /** + * Sets grant_scopes + * @param string[] $grant_scopes A list of scopes that the user agreed to grant. It should be a subset of requestedScopes from the consent request. + * @return $this + */ + public function setGrantScopes($grant_scopes) + { + $this->container['grant_scopes'] = $grant_scopes; + + return $this; + } + + /** + * Gets id_token_extra + * @return map[string,object] + */ + public function getIdTokenExtra() + { + return $this->container['id_token_extra']; + } + + /** + * Sets id_token_extra + * @param map[string,object] $id_token_extra IDTokenExtra represents arbitrary data that will be added to the ID token. The ID token will only be issued if the user agrees to it and if the client requested an ID token. + * @return $this + */ + public function setIdTokenExtra($id_token_extra) + { + $this->container['id_token_extra'] = $id_token_extra; + + return $this; + } + + /** + * Gets subject + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * @param string $subject Subject represents a unique identifier of the user (or service, or legal entity, ...) that accepted the OAuth2 request. + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/ConsentRequestManager.php b/sdk/php/swagger/lib/Model/ConsentRequestManager.php new file mode 100644 index 00000000000..85125384e17 --- /dev/null +++ b/sdk/php/swagger/lib/Model/ConsentRequestManager.php @@ -0,0 +1,220 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * ConsentRequestManager Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ConsentRequestManager implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'ConsentRequestManager'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/ConsentRequestRejection.php b/sdk/php/swagger/lib/Model/ConsentRequestRejection.php new file mode 100644 index 00000000000..7a0e04e19c1 --- /dev/null +++ b/sdk/php/swagger/lib/Model/ConsentRequestRejection.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * ConsentRequestRejection Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ConsentRequestRejection implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'consentRequestRejection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'reason' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'reason' => 'reason' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'reason' => 'setReason' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'reason' => 'getReason' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets reason + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * @param string $reason Reason represents the reason why the user rejected the consent request. + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/Context.php b/sdk/php/swagger/lib/Model/Context.php new file mode 100644 index 00000000000..cf8aa9e244a --- /dev/null +++ b/sdk/php/swagger/lib/Model/Context.php @@ -0,0 +1,405 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * Context Class Doc Comment + * + * @category Class + * @description Context contains an access token's session data + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Context implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'Context'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'access_token_extra' => 'map[string,object]', + 'client_id' => 'string', + 'expires_at' => '\DateTime', + 'granted_scopes' => 'string[]', + 'issued_at' => '\DateTime', + 'issuer' => 'string', + 'subject' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'access_token_extra' => null, + 'client_id' => null, + 'expires_at' => 'date-time', + 'granted_scopes' => null, + 'issued_at' => 'date-time', + 'issuer' => null, + 'subject' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'access_token_extra' => 'accessTokenExtra', + 'client_id' => 'clientId', + 'expires_at' => 'expiresAt', + 'granted_scopes' => 'grantedScopes', + 'issued_at' => 'issuedAt', + 'issuer' => 'issuer', + 'subject' => 'subject' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'access_token_extra' => 'setAccessTokenExtra', + 'client_id' => 'setClientId', + 'expires_at' => 'setExpiresAt', + 'granted_scopes' => 'setGrantedScopes', + 'issued_at' => 'setIssuedAt', + 'issuer' => 'setIssuer', + 'subject' => 'setSubject' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'access_token_extra' => 'getAccessTokenExtra', + 'client_id' => 'getClientId', + 'expires_at' => 'getExpiresAt', + 'granted_scopes' => 'getGrantedScopes', + 'issued_at' => 'getIssuedAt', + 'issuer' => 'getIssuer', + 'subject' => 'getSubject' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['access_token_extra'] = isset($data['access_token_extra']) ? $data['access_token_extra'] : null; + $this->container['client_id'] = isset($data['client_id']) ? $data['client_id'] : null; + $this->container['expires_at'] = isset($data['expires_at']) ? $data['expires_at'] : null; + $this->container['granted_scopes'] = isset($data['granted_scopes']) ? $data['granted_scopes'] : null; + $this->container['issued_at'] = isset($data['issued_at']) ? $data['issued_at'] : null; + $this->container['issuer'] = isset($data['issuer']) ? $data['issuer'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets access_token_extra + * @return map[string,object] + */ + public function getAccessTokenExtra() + { + return $this->container['access_token_extra']; + } + + /** + * Sets access_token_extra + * @param map[string,object] $access_token_extra Extra represents arbitrary session data. + * @return $this + */ + public function setAccessTokenExtra($access_token_extra) + { + $this->container['access_token_extra'] = $access_token_extra; + + return $this; + } + + /** + * Gets client_id + * @return string + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * @param string $client_id ClientID is id of the client the token was issued for.. + * @return $this + */ + public function setClientId($client_id) + { + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets expires_at + * @return \DateTime + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * @param \DateTime $expires_at ExpiresAt is the expiry timestamp. + * @return $this + */ + public function setExpiresAt($expires_at) + { + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets granted_scopes + * @return string[] + */ + public function getGrantedScopes() + { + return $this->container['granted_scopes']; + } + + /** + * Sets granted_scopes + * @param string[] $granted_scopes GrantedScopes is a list of scopes that the subject authorized when asked for consent. + * @return $this + */ + public function setGrantedScopes($granted_scopes) + { + $this->container['granted_scopes'] = $granted_scopes; + + return $this; + } + + /** + * Gets issued_at + * @return \DateTime + */ + public function getIssuedAt() + { + return $this->container['issued_at']; + } + + /** + * Sets issued_at + * @param \DateTime $issued_at IssuedAt is the token creation time stamp. + * @return $this + */ + public function setIssuedAt($issued_at) + { + $this->container['issued_at'] = $issued_at; + + return $this; + } + + /** + * Gets issuer + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * @param string $issuer Issuer is the id of the issuer, typically an hydra instance. + * @return $this + */ + public function setIssuer($issuer) + { + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets subject + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * @param string $subject Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/Firewall.php b/sdk/php/swagger/lib/Model/Firewall.php new file mode 100644 index 00000000000..fb4730cdb1f --- /dev/null +++ b/sdk/php/swagger/lib/Model/Firewall.php @@ -0,0 +1,220 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * Firewall Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Firewall implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'Firewall'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/Group.php b/sdk/php/swagger/lib/Model/Group.php new file mode 100644 index 00000000000..7ba535bf976 --- /dev/null +++ b/sdk/php/swagger/lib/Model/Group.php @@ -0,0 +1,270 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * Group Class Doc Comment + * + * @category Class + * @description Group represents a warden group + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Group implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'group'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'string', + 'members' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, + 'members' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'members' => 'members' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'members' => 'setMembers' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'members' => 'getMembers' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['members'] = isset($data['members']) ? $data['members'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id ID is the groups id. + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets members + * @return string[] + */ + public function getMembers() + { + return $this->container['members']; + } + + /** + * Sets members + * @param string[] $members Members is who belongs to the group. + * @return $this + */ + public function setMembers($members) + { + $this->container['members'] = $members; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/GroupMembers.php b/sdk/php/swagger/lib/Model/GroupMembers.php new file mode 100644 index 00000000000..635ffb9a626 --- /dev/null +++ b/sdk/php/swagger/lib/Model/GroupMembers.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * GroupMembers Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class GroupMembers implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'groupMembers'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'members' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'members' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'members' => 'members' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'members' => 'setMembers' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'members' => 'getMembers' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['members'] = isset($data['members']) ? $data['members'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets members + * @return string[] + */ + public function getMembers() + { + return $this->container['members']; + } + + /** + * Sets members + * @param string[] $members + * @return $this + */ + public function setMembers($members) + { + $this->container['members'] = $members; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/Handler.php b/sdk/php/swagger/lib/Model/Handler.php new file mode 100644 index 00000000000..c858f677dd8 --- /dev/null +++ b/sdk/php/swagger/lib/Model/Handler.php @@ -0,0 +1,350 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * Handler Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Handler implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'Handler'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'generators' => 'map[string,\Hydra\SDK\Model\KeyGenerator]', + 'h' => '\Hydra\SDK\Model\Writer', + 'manager' => '\Hydra\SDK\Model\Manager', + 'resource_prefix' => 'string', + 'w' => '\Hydra\SDK\Model\Firewall' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'generators' => null, + 'h' => null, + 'manager' => null, + 'resource_prefix' => null, + 'w' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'generators' => 'Generators', + 'h' => 'H', + 'manager' => 'Manager', + 'resource_prefix' => 'ResourcePrefix', + 'w' => 'W' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'generators' => 'setGenerators', + 'h' => 'setH', + 'manager' => 'setManager', + 'resource_prefix' => 'setResourcePrefix', + 'w' => 'setW' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'generators' => 'getGenerators', + 'h' => 'getH', + 'manager' => 'getManager', + 'resource_prefix' => 'getResourcePrefix', + 'w' => 'getW' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['generators'] = isset($data['generators']) ? $data['generators'] : null; + $this->container['h'] = isset($data['h']) ? $data['h'] : null; + $this->container['manager'] = isset($data['manager']) ? $data['manager'] : null; + $this->container['resource_prefix'] = isset($data['resource_prefix']) ? $data['resource_prefix'] : null; + $this->container['w'] = isset($data['w']) ? $data['w'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets generators + * @return map[string,\Hydra\SDK\Model\KeyGenerator] + */ + public function getGenerators() + { + return $this->container['generators']; + } + + /** + * Sets generators + * @param map[string,\Hydra\SDK\Model\KeyGenerator] $generators + * @return $this + */ + public function setGenerators($generators) + { + $this->container['generators'] = $generators; + + return $this; + } + + /** + * Gets h + * @return \Hydra\SDK\Model\Writer + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * @param \Hydra\SDK\Model\Writer $h + * @return $this + */ + public function setH($h) + { + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets manager + * @return \Hydra\SDK\Model\Manager + */ + public function getManager() + { + return $this->container['manager']; + } + + /** + * Sets manager + * @param \Hydra\SDK\Model\Manager $manager + * @return $this + */ + public function setManager($manager) + { + $this->container['manager'] = $manager; + + return $this; + } + + /** + * Gets resource_prefix + * @return string + */ + public function getResourcePrefix() + { + return $this->container['resource_prefix']; + } + + /** + * Sets resource_prefix + * @param string $resource_prefix + * @return $this + */ + public function setResourcePrefix($resource_prefix) + { + $this->container['resource_prefix'] = $resource_prefix; + + return $this; + } + + /** + * Gets w + * @return \Hydra\SDK\Model\Firewall + */ + public function getW() + { + return $this->container['w']; + } + + /** + * Sets w + * @param \Hydra\SDK\Model\Firewall $w + * @return $this + */ + public function setW($w) + { + $this->container['w'] = $w; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/InlineResponse200.php b/sdk/php/swagger/lib/Model/InlineResponse200.php new file mode 100644 index 00000000000..61e42ad5c6d --- /dev/null +++ b/sdk/php/swagger/lib/Model/InlineResponse200.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * InlineResponse200 Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class InlineResponse200 implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'inline_response_200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'status' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets status + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * @param string $status Status always contains \"ok\" + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/InlineResponse2001.php b/sdk/php/swagger/lib/Model/InlineResponse2001.php new file mode 100644 index 00000000000..9cdc72138c3 --- /dev/null +++ b/sdk/php/swagger/lib/Model/InlineResponse2001.php @@ -0,0 +1,377 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * InlineResponse2001 Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class InlineResponse2001 implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'inline_response_200_1'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'access_token' => 'string', + 'expires_in' => 'int', + 'id_token' => 'int', + 'refresh_token' => 'string', + 'scope' => 'int', + 'token_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'access_token' => null, + 'expires_in' => 'int64', + 'id_token' => 'int64', + 'refresh_token' => null, + 'scope' => 'int64', + 'token_type' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'access_token' => 'access_token', + 'expires_in' => 'expires_in', + 'id_token' => 'id_token', + 'refresh_token' => 'refresh_token', + 'scope' => 'scope', + 'token_type' => 'token_type' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'access_token' => 'setAccessToken', + 'expires_in' => 'setExpiresIn', + 'id_token' => 'setIdToken', + 'refresh_token' => 'setRefreshToken', + 'scope' => 'setScope', + 'token_type' => 'setTokenType' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'access_token' => 'getAccessToken', + 'expires_in' => 'getExpiresIn', + 'id_token' => 'getIdToken', + 'refresh_token' => 'getRefreshToken', + 'scope' => 'getScope', + 'token_type' => 'getTokenType' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['access_token'] = isset($data['access_token']) ? $data['access_token'] : null; + $this->container['expires_in'] = isset($data['expires_in']) ? $data['expires_in'] : null; + $this->container['id_token'] = isset($data['id_token']) ? $data['id_token'] : null; + $this->container['refresh_token'] = isset($data['refresh_token']) ? $data['refresh_token'] : null; + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + $this->container['token_type'] = isset($data['token_type']) ? $data['token_type'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets access_token + * @return string + */ + public function getAccessToken() + { + return $this->container['access_token']; + } + + /** + * Sets access_token + * @param string $access_token The access token issued by the authorization server. + * @return $this + */ + public function setAccessToken($access_token) + { + $this->container['access_token'] = $access_token; + + return $this; + } + + /** + * Gets expires_in + * @return int + */ + public function getExpiresIn() + { + return $this->container['expires_in']; + } + + /** + * Sets expires_in + * @param int $expires_in 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. + * @return $this + */ + public function setExpiresIn($expires_in) + { + $this->container['expires_in'] = $expires_in; + + return $this; + } + + /** + * Gets id_token + * @return int + */ + public function getIdToken() + { + return $this->container['id_token']; + } + + /** + * Sets id_token + * @param int $id_token To retrieve a refresh token request the id_token scope. + * @return $this + */ + public function setIdToken($id_token) + { + $this->container['id_token'] = $id_token; + + return $this; + } + + /** + * Gets refresh_token + * @return string + */ + public function getRefreshToken() + { + return $this->container['refresh_token']; + } + + /** + * Sets refresh_token + * @param string $refresh_token The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request. + * @return $this + */ + public function setRefreshToken($refresh_token) + { + $this->container['refresh_token'] = $refresh_token; + + return $this; + } + + /** + * Gets scope + * @return int + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * @param int $scope The scope of the access token + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + /** + * Gets token_type + * @return string + */ + public function getTokenType() + { + return $this->container['token_type']; + } + + /** + * Sets token_type + * @param string $token_type The type of the token issued + * @return $this + */ + public function setTokenType($token_type) + { + $this->container['token_type'] = $token_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/InlineResponse401.php b/sdk/php/swagger/lib/Model/InlineResponse401.php new file mode 100644 index 00000000000..83a8b870266 --- /dev/null +++ b/sdk/php/swagger/lib/Model/InlineResponse401.php @@ -0,0 +1,377 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * InlineResponse401 Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class InlineResponse401 implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'inline_response_401'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'code' => 'int', + 'details' => 'map[string,object][]', + 'message' => 'string', + 'reason' => 'string', + 'request' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'code' => 'int64', + 'details' => null, + 'message' => null, + 'reason' => null, + 'request' => null, + 'status' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'details' => 'details', + 'message' => 'message', + 'reason' => 'reason', + 'request' => 'request', + 'status' => 'status' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'details' => 'setDetails', + 'message' => 'setMessage', + 'reason' => 'setReason', + 'request' => 'setRequest', + 'status' => 'setStatus' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'details' => 'getDetails', + 'message' => 'getMessage', + 'reason' => 'getReason', + 'request' => 'getRequest', + 'status' => 'getStatus' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['details'] = isset($data['details']) ? $data['details'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['request'] = isset($data['request']) ? $data['request'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets code + * @return int + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * @param int $code + * @return $this + */ + public function setCode($code) + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets details + * @return map[string,object][] + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * @param map[string,object][] $details + * @return $this + */ + public function setDetails($details) + { + $this->container['details'] = $details; + + return $this; + } + + /** + * Gets message + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * @param string $message + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets reason + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * @param string $reason + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets request + * @return string + */ + public function getRequest() + { + return $this->container['request']; + } + + /** + * Sets request + * @param string $request + * @return $this + */ + public function setRequest($request) + { + $this->container['request'] = $request; + + return $this; + } + + /** + * Gets status + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * @param string $status + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/JoseWebKeySetRequest.php b/sdk/php/swagger/lib/Model/JoseWebKeySetRequest.php new file mode 100644 index 00000000000..d65d7c31ece --- /dev/null +++ b/sdk/php/swagger/lib/Model/JoseWebKeySetRequest.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * JoseWebKeySetRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class JoseWebKeySetRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'joseWebKeySetRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'keys' => '\Hydra\SDK\Model\RawMessage[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'keys' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'keys' => 'keys' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'keys' => 'setKeys' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'keys' => 'getKeys' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['keys'] = isset($data['keys']) ? $data['keys'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets keys + * @return \Hydra\SDK\Model\RawMessage[] + */ + public function getKeys() + { + return $this->container['keys']; + } + + /** + * Sets keys + * @param \Hydra\SDK\Model\RawMessage[] $keys + * @return $this + */ + public function setKeys($keys) + { + $this->container['keys'] = $keys; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/JsonWebKey.php b/sdk/php/swagger/lib/Model/JsonWebKey.php new file mode 100644 index 00000000000..81b8580ee7d --- /dev/null +++ b/sdk/php/swagger/lib/Model/JsonWebKey.php @@ -0,0 +1,674 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * JsonWebKey Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class JsonWebKey implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'jsonWebKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'alg' => 'string', + 'crv' => 'string', + 'd' => 'string', + 'dp' => 'string', + 'dq' => 'string', + 'e' => 'string', + 'k' => 'string', + 'kid' => 'string', + 'kty' => 'string', + 'n' => 'string', + 'p' => 'string', + 'q' => 'string', + 'qi' => 'string', + 'use' => 'string', + 'x' => 'string', + 'x5c' => 'string[]', + 'y' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'alg' => null, + 'crv' => null, + 'd' => null, + 'dp' => null, + 'dq' => null, + 'e' => null, + 'k' => null, + 'kid' => null, + 'kty' => null, + 'n' => null, + 'p' => null, + 'q' => null, + 'qi' => null, + 'use' => null, + 'x' => null, + 'x5c' => null, + 'y' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'alg' => 'alg', + 'crv' => 'crv', + 'd' => 'd', + 'dp' => 'dp', + 'dq' => 'dq', + 'e' => 'e', + 'k' => 'k', + 'kid' => 'kid', + 'kty' => 'kty', + 'n' => 'n', + 'p' => 'p', + 'q' => 'q', + 'qi' => 'qi', + 'use' => 'use', + 'x' => 'x', + 'x5c' => 'x5c', + 'y' => 'y' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'alg' => 'setAlg', + 'crv' => 'setCrv', + 'd' => 'setD', + 'dp' => 'setDp', + 'dq' => 'setDq', + 'e' => 'setE', + 'k' => 'setK', + 'kid' => 'setKid', + 'kty' => 'setKty', + 'n' => 'setN', + 'p' => 'setP', + 'q' => 'setQ', + 'qi' => 'setQi', + 'use' => 'setUse', + 'x' => 'setX', + 'x5c' => 'setX5c', + 'y' => 'setY' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'alg' => 'getAlg', + 'crv' => 'getCrv', + 'd' => 'getD', + 'dp' => 'getDp', + 'dq' => 'getDq', + 'e' => 'getE', + 'k' => 'getK', + 'kid' => 'getKid', + 'kty' => 'getKty', + 'n' => 'getN', + 'p' => 'getP', + 'q' => 'getQ', + 'qi' => 'getQi', + 'use' => 'getUse', + 'x' => 'getX', + 'x5c' => 'getX5c', + 'y' => 'getY' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['alg'] = isset($data['alg']) ? $data['alg'] : null; + $this->container['crv'] = isset($data['crv']) ? $data['crv'] : null; + $this->container['d'] = isset($data['d']) ? $data['d'] : null; + $this->container['dp'] = isset($data['dp']) ? $data['dp'] : null; + $this->container['dq'] = isset($data['dq']) ? $data['dq'] : null; + $this->container['e'] = isset($data['e']) ? $data['e'] : null; + $this->container['k'] = isset($data['k']) ? $data['k'] : null; + $this->container['kid'] = isset($data['kid']) ? $data['kid'] : null; + $this->container['kty'] = isset($data['kty']) ? $data['kty'] : null; + $this->container['n'] = isset($data['n']) ? $data['n'] : null; + $this->container['p'] = isset($data['p']) ? $data['p'] : null; + $this->container['q'] = isset($data['q']) ? $data['q'] : null; + $this->container['qi'] = isset($data['qi']) ? $data['qi'] : null; + $this->container['use'] = isset($data['use']) ? $data['use'] : null; + $this->container['x'] = isset($data['x']) ? $data['x'] : null; + $this->container['x5c'] = isset($data['x5c']) ? $data['x5c'] : null; + $this->container['y'] = isset($data['y']) ? $data['y'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets alg + * @return string + */ + public function getAlg() + { + return $this->container['alg']; + } + + /** + * Sets alg + * @param string $alg 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. + * @return $this + */ + public function setAlg($alg) + { + $this->container['alg'] = $alg; + + return $this; + } + + /** + * Gets crv + * @return string + */ + public function getCrv() + { + return $this->container['crv']; + } + + /** + * Sets crv + * @param string $crv + * @return $this + */ + public function setCrv($crv) + { + $this->container['crv'] = $crv; + + return $this; + } + + /** + * Gets d + * @return string + */ + public function getD() + { + return $this->container['d']; + } + + /** + * Sets d + * @param string $d + * @return $this + */ + public function setD($d) + { + $this->container['d'] = $d; + + return $this; + } + + /** + * Gets dp + * @return string + */ + public function getDp() + { + return $this->container['dp']; + } + + /** + * Sets dp + * @param string $dp + * @return $this + */ + public function setDp($dp) + { + $this->container['dp'] = $dp; + + return $this; + } + + /** + * Gets dq + * @return string + */ + public function getDq() + { + return $this->container['dq']; + } + + /** + * Sets dq + * @param string $dq + * @return $this + */ + public function setDq($dq) + { + $this->container['dq'] = $dq; + + return $this; + } + + /** + * Gets e + * @return string + */ + public function getE() + { + return $this->container['e']; + } + + /** + * Sets e + * @param string $e + * @return $this + */ + public function setE($e) + { + $this->container['e'] = $e; + + return $this; + } + + /** + * Gets k + * @return string + */ + public function getK() + { + return $this->container['k']; + } + + /** + * Sets k + * @param string $k + * @return $this + */ + public function setK($k) + { + $this->container['k'] = $k; + + return $this; + } + + /** + * Gets kid + * @return string + */ + public function getKid() + { + return $this->container['kid']; + } + + /** + * Sets kid + * @param string $kid 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. + * @return $this + */ + public function setKid($kid) + { + $this->container['kid'] = $kid; + + return $this; + } + + /** + * Gets kty + * @return string + */ + public function getKty() + { + return $this->container['kty']; + } + + /** + * Sets kty + * @param string $kty 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. + * @return $this + */ + public function setKty($kty) + { + $this->container['kty'] = $kty; + + return $this; + } + + /** + * Gets n + * @return string + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * @param string $n + * @return $this + */ + public function setN($n) + { + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets p + * @return string + */ + public function getP() + { + return $this->container['p']; + } + + /** + * Sets p + * @param string $p + * @return $this + */ + public function setP($p) + { + $this->container['p'] = $p; + + return $this; + } + + /** + * Gets q + * @return string + */ + public function getQ() + { + return $this->container['q']; + } + + /** + * Sets q + * @param string $q + * @return $this + */ + public function setQ($q) + { + $this->container['q'] = $q; + + return $this; + } + + /** + * Gets qi + * @return string + */ + public function getQi() + { + return $this->container['qi']; + } + + /** + * Sets qi + * @param string $qi + * @return $this + */ + public function setQi($qi) + { + $this->container['qi'] = $qi; + + return $this; + } + + /** + * Gets use + * @return string + */ + public function getUse() + { + return $this->container['use']; + } + + /** + * Sets use + * @param string $use The \"use\" (public key use) parameter identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly \"sig\" (signature) or \"enc\" (encryption). + * @return $this + */ + public function setUse($use) + { + $this->container['use'] = $use; + + return $this; + } + + /** + * Gets x + * @return string + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * @param string $x + * @return $this + */ + public function setX($x) + { + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets x5c + * @return string[] + */ + public function getX5c() + { + return $this->container['x5c']; + } + + /** + * Sets x5c + * @param string[] $x5c 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. + * @return $this + */ + public function setX5c($x5c) + { + $this->container['x5c'] = $x5c; + + return $this; + } + + /** + * Gets y + * @return string + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * @param string $y + * @return $this + */ + public function setY($y) + { + $this->container['y'] = $y; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/JsonWebKeySet.php b/sdk/php/swagger/lib/Model/JsonWebKeySet.php new file mode 100644 index 00000000000..7b3fb8747e1 --- /dev/null +++ b/sdk/php/swagger/lib/Model/JsonWebKeySet.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * JsonWebKeySet Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class JsonWebKeySet implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'jsonWebKeySet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'keys' => '\Hydra\SDK\Model\JsonWebKey[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'keys' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'keys' => 'keys' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'keys' => 'setKeys' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'keys' => 'getKeys' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['keys'] = isset($data['keys']) ? $data['keys'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets keys + * @return \Hydra\SDK\Model\JsonWebKey[] + */ + public function getKeys() + { + return $this->container['keys']; + } + + /** + * Sets keys + * @param \Hydra\SDK\Model\JsonWebKey[] $keys The value of the \"keys\" parameter is an array of 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. + * @return $this + */ + public function setKeys($keys) + { + $this->container['keys'] = $keys; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/JsonWebKeySetGeneratorRequest.php b/sdk/php/swagger/lib/Model/JsonWebKeySetGeneratorRequest.php new file mode 100644 index 00000000000..87fa8cf3bc7 --- /dev/null +++ b/sdk/php/swagger/lib/Model/JsonWebKeySetGeneratorRequest.php @@ -0,0 +1,281 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * JsonWebKeySetGeneratorRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class JsonWebKeySetGeneratorRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'jsonWebKeySetGeneratorRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'alg' => 'string', + 'kid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'alg' => null, + 'kid' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'alg' => 'alg', + 'kid' => 'kid' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'alg' => 'setAlg', + 'kid' => 'setKid' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'alg' => 'getAlg', + 'kid' => 'getKid' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['alg'] = isset($data['alg']) ? $data['alg'] : null; + $this->container['kid'] = isset($data['kid']) ? $data['kid'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['alg'] === null) { + $invalid_properties[] = "'alg' can't be null"; + } + if ($this->container['kid'] === null) { + $invalid_properties[] = "'kid' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['alg'] === null) { + return false; + } + if ($this->container['kid'] === null) { + return false; + } + return true; + } + + + /** + * Gets alg + * @return string + */ + public function getAlg() + { + return $this->container['alg']; + } + + /** + * Sets alg + * @param string $alg The algorithm to be used for creating the key. Supports \"RS256\", \"ES512\", \"HS512\", and \"HS256\" + * @return $this + */ + public function setAlg($alg) + { + $this->container['alg'] = $alg; + + return $this; + } + + /** + * Gets kid + * @return string + */ + public function getKid() + { + return $this->container['kid']; + } + + /** + * Sets kid + * @param string $kid The kid of the key to be created + * @return $this + */ + public function setKid($kid) + { + $this->container['kid'] = $kid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/KeyGenerator.php b/sdk/php/swagger/lib/Model/KeyGenerator.php new file mode 100644 index 00000000000..02263e71135 --- /dev/null +++ b/sdk/php/swagger/lib/Model/KeyGenerator.php @@ -0,0 +1,220 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * KeyGenerator Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class KeyGenerator implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'KeyGenerator'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/Manager.php b/sdk/php/swagger/lib/Model/Manager.php new file mode 100644 index 00000000000..5027cf83fa9 --- /dev/null +++ b/sdk/php/swagger/lib/Model/Manager.php @@ -0,0 +1,220 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * Manager Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Manager implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'Manager'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/OAuth2Client.php b/sdk/php/swagger/lib/Model/OAuth2Client.php new file mode 100644 index 00000000000..b99508afe30 --- /dev/null +++ b/sdk/php/swagger/lib/Model/OAuth2Client.php @@ -0,0 +1,605 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * OAuth2Client Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class OAuth2Client implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'oAuth2Client'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'client_name' => 'string', + 'client_secret' => 'string', + 'client_uri' => 'string', + 'contacts' => 'string[]', + 'grant_types' => 'string[]', + 'id' => 'string', + 'logo_uri' => 'string', + 'owner' => 'string', + 'policy_uri' => 'string', + 'public' => 'bool', + 'redirect_uris' => 'string[]', + 'response_types' => 'string[]', + 'scope' => 'string', + 'tos_uri' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'client_name' => null, + 'client_secret' => null, + 'client_uri' => null, + 'contacts' => null, + 'grant_types' => null, + 'id' => null, + 'logo_uri' => null, + 'owner' => null, + 'policy_uri' => null, + 'public' => null, + 'redirect_uris' => null, + 'response_types' => null, + 'scope' => null, + 'tos_uri' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'client_name' => 'client_name', + 'client_secret' => 'client_secret', + 'client_uri' => 'client_uri', + 'contacts' => 'contacts', + 'grant_types' => 'grant_types', + 'id' => 'id', + 'logo_uri' => 'logo_uri', + 'owner' => 'owner', + 'policy_uri' => 'policy_uri', + 'public' => 'public', + 'redirect_uris' => 'redirect_uris', + 'response_types' => 'response_types', + 'scope' => 'scope', + 'tos_uri' => 'tos_uri' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'client_name' => 'setClientName', + 'client_secret' => 'setClientSecret', + 'client_uri' => 'setClientUri', + 'contacts' => 'setContacts', + 'grant_types' => 'setGrantTypes', + 'id' => 'setId', + 'logo_uri' => 'setLogoUri', + 'owner' => 'setOwner', + 'policy_uri' => 'setPolicyUri', + 'public' => 'setPublic', + 'redirect_uris' => 'setRedirectUris', + 'response_types' => 'setResponseTypes', + 'scope' => 'setScope', + 'tos_uri' => 'setTosUri' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'client_name' => 'getClientName', + 'client_secret' => 'getClientSecret', + 'client_uri' => 'getClientUri', + 'contacts' => 'getContacts', + 'grant_types' => 'getGrantTypes', + 'id' => 'getId', + 'logo_uri' => 'getLogoUri', + 'owner' => 'getOwner', + 'policy_uri' => 'getPolicyUri', + 'public' => 'getPublic', + 'redirect_uris' => 'getRedirectUris', + 'response_types' => 'getResponseTypes', + 'scope' => 'getScope', + 'tos_uri' => 'getTosUri' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['client_name'] = isset($data['client_name']) ? $data['client_name'] : null; + $this->container['client_secret'] = isset($data['client_secret']) ? $data['client_secret'] : null; + $this->container['client_uri'] = isset($data['client_uri']) ? $data['client_uri'] : null; + $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null; + $this->container['grant_types'] = isset($data['grant_types']) ? $data['grant_types'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['logo_uri'] = isset($data['logo_uri']) ? $data['logo_uri'] : null; + $this->container['owner'] = isset($data['owner']) ? $data['owner'] : null; + $this->container['policy_uri'] = isset($data['policy_uri']) ? $data['policy_uri'] : null; + $this->container['public'] = isset($data['public']) ? $data['public'] : null; + $this->container['redirect_uris'] = isset($data['redirect_uris']) ? $data['redirect_uris'] : null; + $this->container['response_types'] = isset($data['response_types']) ? $data['response_types'] : null; + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + $this->container['tos_uri'] = isset($data['tos_uri']) ? $data['tos_uri'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if (!is_null($this->container['scope']) && !preg_match("/([a-zA-Z0-9\\.\\*]+\\s?)+/", $this->container['scope'])) { + $invalid_properties[] = "invalid value for 'scope', must be conform to the pattern /([a-zA-Z0-9\\.\\*]+\\s?)+/."; + } + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if (!preg_match("/([a-zA-Z0-9\\.\\*]+\\s?)+/", $this->container['scope'])) { + return false; + } + return true; + } + + + /** + * Gets client_name + * @return string + */ + public function getClientName() + { + return $this->container['client_name']; + } + + /** + * Sets client_name + * @param string $client_name Name is the human-readable string name of the client to be presented to the end-user during authorization. + * @return $this + */ + public function setClientName($client_name) + { + $this->container['client_name'] = $client_name; + + return $this; + } + + /** + * Gets client_secret + * @return string + */ + public function getClientSecret() + { + return $this->container['client_secret']; + } + + /** + * Sets client_secret + * @param string $client_secret Secret is the client's secret. The secret will be included in the create request as cleartext, and then never again. The secret is stored using BCrypt so it is impossible to recover it. Tell your users that they need to write the secret down as it will not be made available again. + * @return $this + */ + public function setClientSecret($client_secret) + { + $this->container['client_secret'] = $client_secret; + + return $this; + } + + /** + * Gets client_uri + * @return string + */ + public function getClientUri() + { + return $this->container['client_uri']; + } + + /** + * Sets client_uri + * @param string $client_uri ClientURI is an 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. + * @return $this + */ + public function setClientUri($client_uri) + { + $this->container['client_uri'] = $client_uri; + + return $this; + } + + /** + * Gets contacts + * @return string[] + */ + public function getContacts() + { + return $this->container['contacts']; + } + + /** + * Sets contacts + * @param string[] $contacts Contacts is a array of strings representing ways to contact people responsible for this client, typically email addresses. + * @return $this + */ + public function setContacts($contacts) + { + $this->container['contacts'] = $contacts; + + return $this; + } + + /** + * Gets grant_types + * @return string[] + */ + public function getGrantTypes() + { + return $this->container['grant_types']; + } + + /** + * Sets grant_types + * @param string[] $grant_types GrantTypes is an array of grant types the client is allowed to use. + * @return $this + */ + public function setGrantTypes($grant_types) + { + $this->container['grant_types'] = $grant_types; + + return $this; + } + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id ID is the id for this client. + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets logo_uri + * @return string + */ + public function getLogoUri() + { + return $this->container['logo_uri']; + } + + /** + * Sets logo_uri + * @param string $logo_uri LogoURI is an URL string that references a logo for the client. + * @return $this + */ + public function setLogoUri($logo_uri) + { + $this->container['logo_uri'] = $logo_uri; + + return $this; + } + + /** + * Gets owner + * @return string + */ + public function getOwner() + { + return $this->container['owner']; + } + + /** + * Sets owner + * @param string $owner Owner is a string identifying the owner of the OAuth 2.0 Client. + * @return $this + */ + public function setOwner($owner) + { + $this->container['owner'] = $owner; + + return $this; + } + + /** + * Gets policy_uri + * @return string + */ + public function getPolicyUri() + { + return $this->container['policy_uri']; + } + + /** + * Sets policy_uri + * @param string $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. + * @return $this + */ + public function setPolicyUri($policy_uri) + { + $this->container['policy_uri'] = $policy_uri; + + return $this; + } + + /** + * Gets public + * @return bool + */ + public function getPublic() + { + return $this->container['public']; + } + + /** + * Sets public + * @param bool $public Public is a boolean that identifies this client as public, meaning that it does not have a secret. It will disable the client_credentials grant type for this client if set. + * @return $this + */ + public function setPublic($public) + { + $this->container['public'] = $public; + + return $this; + } + + /** + * Gets redirect_uris + * @return string[] + */ + public function getRedirectUris() + { + return $this->container['redirect_uris']; + } + + /** + * Sets redirect_uris + * @param string[] $redirect_uris RedirectURIs is an array of allowed redirect urls for the client, for example http://mydomain/oauth/callback . + * @return $this + */ + public function setRedirectUris($redirect_uris) + { + $this->container['redirect_uris'] = $redirect_uris; + + return $this; + } + + /** + * Gets response_types + * @return string[] + */ + public function getResponseTypes() + { + return $this->container['response_types']; + } + + /** + * Sets response_types + * @param string[] $response_types ResponseTypes is an array of the OAuth 2.0 response type strings that the client can use at the authorization endpoint. + * @return $this + */ + public function setResponseTypes($response_types) + { + $this->container['response_types'] = $response_types; + + return $this; + } + + /** + * Gets scope + * @return string + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * @param string $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. + * @return $this + */ + public function setScope($scope) + { + + if (!is_null($scope) && (!preg_match("/([a-zA-Z0-9\\.\\*]+\\s?)+/", $scope))) { + throw new \InvalidArgumentException("invalid value for $scope when calling OAuth2Client., must conform to the pattern /([a-zA-Z0-9\\.\\*]+\\s?)+/."); + } + + $this->container['scope'] = $scope; + + return $this; + } + + /** + * Gets tos_uri + * @return string + */ + public function getTosUri() + { + return $this->container['tos_uri']; + } + + /** + * Sets tos_uri + * @param string $tos_uri TermsOfServiceURI is a URL string that points to a human-readable terms of service document for the client that describes a contractual relationship between the end-user and the client that the end-user accepts when authorizing the client. + * @return $this + */ + public function setTosUri($tos_uri) + { + $this->container['tos_uri'] = $tos_uri; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/OAuth2ConsentRequest.php b/sdk/php/swagger/lib/Model/OAuth2ConsentRequest.php new file mode 100644 index 00000000000..e7c2b60c851 --- /dev/null +++ b/sdk/php/swagger/lib/Model/OAuth2ConsentRequest.php @@ -0,0 +1,350 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * OAuth2ConsentRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class OAuth2ConsentRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'oAuth2ConsentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'client_id' => 'string', + 'expires_at' => 'string', + 'id' => 'string', + 'redirect_url' => 'string', + 'requested_scopes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'client_id' => null, + 'expires_at' => null, + 'id' => null, + 'redirect_url' => null, + 'requested_scopes' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'client_id' => 'clientId', + 'expires_at' => 'expiresAt', + 'id' => 'id', + 'redirect_url' => 'redirectUrl', + 'requested_scopes' => 'requestedScopes' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'client_id' => 'setClientId', + 'expires_at' => 'setExpiresAt', + 'id' => 'setId', + 'redirect_url' => 'setRedirectUrl', + 'requested_scopes' => 'setRequestedScopes' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'client_id' => 'getClientId', + 'expires_at' => 'getExpiresAt', + 'id' => 'getId', + 'redirect_url' => 'getRedirectUrl', + 'requested_scopes' => 'getRequestedScopes' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['client_id'] = isset($data['client_id']) ? $data['client_id'] : null; + $this->container['expires_at'] = isset($data['expires_at']) ? $data['expires_at'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; + $this->container['requested_scopes'] = isset($data['requested_scopes']) ? $data['requested_scopes'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets client_id + * @return string + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * @param string $client_id ClientID is the client id that initiated the OAuth2 request. + * @return $this + */ + public function setClientId($client_id) + { + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets expires_at + * @return string + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * @param string $expires_at ExpiresAt is the time where the access request will expire. + * @return $this + */ + public function setExpiresAt($expires_at) + { + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id ID is the id of this consent request. + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets redirect_url + * @return string + */ + public function getRedirectUrl() + { + return $this->container['redirect_url']; + } + + /** + * Sets redirect_url + * @param string $redirect_url Redirect URL is the URL where the user agent should be redirected to after the consent has been accepted or rejected. + * @return $this + */ + public function setRedirectUrl($redirect_url) + { + $this->container['redirect_url'] = $redirect_url; + + return $this; + } + + /** + * Gets requested_scopes + * @return string[] + */ + public function getRequestedScopes() + { + return $this->container['requested_scopes']; + } + + /** + * Sets requested_scopes + * @param string[] $requested_scopes RequestedScopes represents a list of scopes that have been requested by the OAuth2 request initiator. + * @return $this + */ + public function setRequestedScopes($requested_scopes) + { + $this->container['requested_scopes'] = $requested_scopes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/OAuth2TokenIntrospection.php b/sdk/php/swagger/lib/Model/OAuth2TokenIntrospection.php new file mode 100644 index 00000000000..96ecc038c64 --- /dev/null +++ b/sdk/php/swagger/lib/Model/OAuth2TokenIntrospection.php @@ -0,0 +1,512 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * OAuth2TokenIntrospection Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class OAuth2TokenIntrospection implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'oAuth2TokenIntrospection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'active' => 'bool', + 'aud' => 'string', + 'client_id' => 'string', + 'exp' => 'int', + 'ext' => 'map[string,object]', + 'iat' => 'int', + 'iss' => 'string', + 'nbf' => 'int', + 'scope' => 'string', + 'sub' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'active' => null, + 'aud' => null, + 'client_id' => null, + 'exp' => 'int64', + 'ext' => null, + 'iat' => 'int64', + 'iss' => null, + 'nbf' => 'int64', + 'scope' => null, + 'sub' => null, + 'username' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'aud' => 'aud', + 'client_id' => 'client_id', + 'exp' => 'exp', + 'ext' => 'ext', + 'iat' => 'iat', + 'iss' => 'iss', + 'nbf' => 'nbf', + 'scope' => 'scope', + 'sub' => 'sub', + 'username' => 'username' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'aud' => 'setAud', + 'client_id' => 'setClientId', + 'exp' => 'setExp', + 'ext' => 'setExt', + 'iat' => 'setIat', + 'iss' => 'setIss', + 'nbf' => 'setNbf', + 'scope' => 'setScope', + 'sub' => 'setSub', + 'username' => 'setUsername' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'aud' => 'getAud', + 'client_id' => 'getClientId', + 'exp' => 'getExp', + 'ext' => 'getExt', + 'iat' => 'getIat', + 'iss' => 'getIss', + 'nbf' => 'getNbf', + 'scope' => 'getScope', + 'sub' => 'getSub', + 'username' => 'getUsername' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + $this->container['aud'] = isset($data['aud']) ? $data['aud'] : null; + $this->container['client_id'] = isset($data['client_id']) ? $data['client_id'] : null; + $this->container['exp'] = isset($data['exp']) ? $data['exp'] : null; + $this->container['ext'] = isset($data['ext']) ? $data['ext'] : null; + $this->container['iat'] = isset($data['iat']) ? $data['iat'] : null; + $this->container['iss'] = isset($data['iss']) ? $data['iss'] : null; + $this->container['nbf'] = isset($data['nbf']) ? $data['nbf'] : null; + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + $this->container['sub'] = isset($data['sub']) ? $data['sub'] : null; + $this->container['username'] = isset($data['username']) ? $data['username'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets active + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * @param bool $active 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). + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets aud + * @return string + */ + public function getAud() + { + return $this->container['aud']; + } + + /** + * Sets aud + * @param string $aud ClientID is a service-specific string identifier or list of string identifiers representing the intended audience for this token. + * @return $this + */ + public function setAud($aud) + { + $this->container['aud'] = $aud; + + return $this; + } + + /** + * Gets client_id + * @return string + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * @param string $client_id ClientID is aclient identifier for the OAuth 2.0 client that requested this token. + * @return $this + */ + public function setClientId($client_id) + { + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets exp + * @return int + */ + public function getExp() + { + return $this->container['exp']; + } + + /** + * Sets exp + * @param int $exp Expires at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire. + * @return $this + */ + public function setExp($exp) + { + $this->container['exp'] = $exp; + + return $this; + } + + /** + * Gets ext + * @return map[string,object] + */ + public function getExt() + { + return $this->container['ext']; + } + + /** + * Sets ext + * @param map[string,object] $ext Extra is arbitrary data set by the session. + * @return $this + */ + public function setExt($ext) + { + $this->container['ext'] = $ext; + + return $this; + } + + /** + * Gets iat + * @return int + */ + public function getIat() + { + return $this->container['iat']; + } + + /** + * Sets iat + * @param int $iat Issued at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued. + * @return $this + */ + public function setIat($iat) + { + $this->container['iat'] = $iat; + + return $this; + } + + /** + * Gets iss + * @return string + */ + public function getIss() + { + return $this->container['iss']; + } + + /** + * Sets iss + * @param string $iss Issuer is a string representing the issuer of this token + * @return $this + */ + public function setIss($iss) + { + $this->container['iss'] = $iss; + + return $this; + } + + /** + * Gets nbf + * @return int + */ + public function getNbf() + { + return $this->container['nbf']; + } + + /** + * Sets nbf + * @param int $nbf 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. + * @return $this + */ + public function setNbf($nbf) + { + $this->container['nbf'] = $nbf; + + return $this; + } + + /** + * Gets scope + * @return string + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * @param string $scope Scope is a JSON string containing a space-separated list of scopes associated with this token. + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + /** + * Gets sub + * @return string + */ + public function getSub() + { + return $this->container['sub']; + } + + /** + * Sets sub + * @param string $sub Subject of the token, as defined in JWT [RFC7519]. Usually a machine-readable identifier of the resource owner who authorized this token. + * @return $this + */ + public function setSub($sub) + { + $this->container['sub'] = $sub; + + return $this; + } + + /** + * Gets username + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * @param string $username Username is a human-readable identifier for the resource owner who authorized this token. + * @return $this + */ + public function setUsername($username) + { + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/Policy.php b/sdk/php/swagger/lib/Model/Policy.php new file mode 100644 index 00000000000..dc2f2ba08c4 --- /dev/null +++ b/sdk/php/swagger/lib/Model/Policy.php @@ -0,0 +1,404 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * Policy Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Policy implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'policy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'actions' => 'string[]', + 'conditions' => 'map[string,\Hydra\SDK\Model\PolicyConditions]', + 'description' => 'string', + 'effect' => 'string', + 'id' => 'string', + 'resources' => 'string[]', + 'subjects' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'actions' => null, + 'conditions' => null, + 'description' => null, + 'effect' => null, + 'id' => null, + 'resources' => null, + 'subjects' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'actions' => 'actions', + 'conditions' => 'conditions', + 'description' => 'description', + 'effect' => 'effect', + 'id' => 'id', + 'resources' => 'resources', + 'subjects' => 'subjects' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'actions' => 'setActions', + 'conditions' => 'setConditions', + 'description' => 'setDescription', + 'effect' => 'setEffect', + 'id' => 'setId', + 'resources' => 'setResources', + 'subjects' => 'setSubjects' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'actions' => 'getActions', + 'conditions' => 'getConditions', + 'description' => 'getDescription', + 'effect' => 'getEffect', + 'id' => 'getId', + 'resources' => 'getResources', + 'subjects' => 'getSubjects' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['actions'] = isset($data['actions']) ? $data['actions'] : null; + $this->container['conditions'] = isset($data['conditions']) ? $data['conditions'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['effect'] = isset($data['effect']) ? $data['effect'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['resources'] = isset($data['resources']) ? $data['resources'] : null; + $this->container['subjects'] = isset($data['subjects']) ? $data['subjects'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets actions + * @return string[] + */ + public function getActions() + { + return $this->container['actions']; + } + + /** + * Sets actions + * @param string[] $actions Actions impacted by the policy. + * @return $this + */ + public function setActions($actions) + { + $this->container['actions'] = $actions; + + return $this; + } + + /** + * Gets conditions + * @return map[string,\Hydra\SDK\Model\PolicyConditions] + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * @param map[string,\Hydra\SDK\Model\PolicyConditions] $conditions Conditions under which the policy is active. + * @return $this + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets description + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * @param string $description Description of the policy. + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets effect + * @return string + */ + public function getEffect() + { + return $this->container['effect']; + } + + /** + * Sets effect + * @param string $effect Effect of the policy + * @return $this + */ + public function setEffect($effect) + { + $this->container['effect'] = $effect; + + return $this; + } + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id ID of the policy. + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets resources + * @return string[] + */ + public function getResources() + { + return $this->container['resources']; + } + + /** + * Sets resources + * @param string[] $resources Resources impacted by the policy. + * @return $this + */ + public function setResources($resources) + { + $this->container['resources'] = $resources; + + return $this; + } + + /** + * Gets subjects + * @return string[] + */ + public function getSubjects() + { + return $this->container['subjects']; + } + + /** + * Sets subjects + * @param string[] $subjects Subjects impacted by the policy. + * @return $this + */ + public function setSubjects($subjects) + { + $this->container['subjects'] = $subjects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/PolicyConditions.php b/sdk/php/swagger/lib/Model/PolicyConditions.php new file mode 100644 index 00000000000..99ec9459c3f --- /dev/null +++ b/sdk/php/swagger/lib/Model/PolicyConditions.php @@ -0,0 +1,269 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * PolicyConditions Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class PolicyConditions implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'policy_conditions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'options' => 'map[string,object]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'options' => null, + 'type' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'options' => 'options', + 'type' => 'type' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'options' => 'setOptions', + 'type' => 'setType' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'options' => 'getOptions', + 'type' => 'getType' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['options'] = isset($data['options']) ? $data['options'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets options + * @return map[string,object] + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * @param map[string,object] $options + * @return $this + */ + public function setOptions($options) + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets type + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * @param string $type + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/RawMessage.php b/sdk/php/swagger/lib/Model/RawMessage.php new file mode 100644 index 00000000000..54ce525e494 --- /dev/null +++ b/sdk/php/swagger/lib/Model/RawMessage.php @@ -0,0 +1,224 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * RawMessage Class Doc Comment + * + * @category Class + * @description It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class RawMessage implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'RawMessage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = parent::listInvalidProperties(); + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + if (!parent::valid()) { + return false; + } + + return true; + } + + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerAcceptConsentRequest.php b/sdk/php/swagger/lib/Model/SwaggerAcceptConsentRequest.php new file mode 100644 index 00000000000..aef1e788966 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerAcceptConsentRequest.php @@ -0,0 +1,281 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerAcceptConsentRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerAcceptConsentRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerAcceptConsentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\ConsentRequestAcceptance', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null, + 'id' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body', + 'id' => 'id' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody', + 'id' => 'setId' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody', + 'id' => 'getId' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['body'] === null) { + $invalid_properties[] = "'body' can't be null"; + } + if ($this->container['id'] === null) { + $invalid_properties[] = "'id' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['body'] === null) { + return false; + } + if ($this->container['id'] === null) { + return false; + } + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\ConsentRequestAcceptance + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\ConsentRequestAcceptance $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id in: path + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerCreatePolicyParameters.php b/sdk/php/swagger/lib/Model/SwaggerCreatePolicyParameters.php new file mode 100644 index 00000000000..e04d3c53b56 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerCreatePolicyParameters.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerCreatePolicyParameters Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerCreatePolicyParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerCreatePolicyParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\Policy' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\Policy + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\Policy $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerDoesWardenAllowAccessRequestParameters.php b/sdk/php/swagger/lib/Model/SwaggerDoesWardenAllowAccessRequestParameters.php new file mode 100644 index 00000000000..441f2453da6 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerDoesWardenAllowAccessRequestParameters.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerDoesWardenAllowAccessRequestParameters Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerDoesWardenAllowAccessRequestParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerDoesWardenAllowAccessRequestParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\WardenAccessRequest' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\WardenAccessRequest + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\WardenAccessRequest $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerDoesWardenAllowTokenAccessRequestParameters.php b/sdk/php/swagger/lib/Model/SwaggerDoesWardenAllowTokenAccessRequestParameters.php new file mode 100644 index 00000000000..eaedb07cb8a --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerDoesWardenAllowTokenAccessRequestParameters.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerDoesWardenAllowTokenAccessRequestParameters Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerDoesWardenAllowTokenAccessRequestParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerDoesWardenAllowTokenAccessRequestParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\WardenTokenAccessRequest' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\WardenTokenAccessRequest + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\WardenTokenAccessRequest $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerGetPolicyParameters.php b/sdk/php/swagger/lib/Model/SwaggerGetPolicyParameters.php new file mode 100644 index 00000000000..e1e6c93b745 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerGetPolicyParameters.php @@ -0,0 +1,242 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerGetPolicyParameters Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerGetPolicyParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerGetPolicyParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id The id of the policy. in: path + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerJsonWebKeyQuery.php b/sdk/php/swagger/lib/Model/SwaggerJsonWebKeyQuery.php new file mode 100644 index 00000000000..2fb689c9fb5 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerJsonWebKeyQuery.php @@ -0,0 +1,281 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerJsonWebKeyQuery Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerJsonWebKeyQuery implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerJsonWebKeyQuery'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'kid' => 'string', + 'set' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'kid' => null, + 'set' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'kid' => 'kid', + 'set' => 'set' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'kid' => 'setKid', + 'set' => 'setSet' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'kid' => 'getKid', + 'set' => 'getSet' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['kid'] = isset($data['kid']) ? $data['kid'] : null; + $this->container['set'] = isset($data['set']) ? $data['set'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['kid'] === null) { + $invalid_properties[] = "'kid' can't be null"; + } + if ($this->container['set'] === null) { + $invalid_properties[] = "'set' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['kid'] === null) { + return false; + } + if ($this->container['set'] === null) { + return false; + } + return true; + } + + + /** + * Gets kid + * @return string + */ + public function getKid() + { + return $this->container['kid']; + } + + /** + * Sets kid + * @param string $kid The kid of the desired key in: path + * @return $this + */ + public function setKid($kid) + { + $this->container['kid'] = $kid; + + return $this; + } + + /** + * Gets set + * @return string + */ + public function getSet() + { + return $this->container['set']; + } + + /** + * Sets set + * @param string $set The set in: path + * @return $this + */ + public function setSet($set) + { + $this->container['set'] = $set; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerJwkCreateSet.php b/sdk/php/swagger/lib/Model/SwaggerJwkCreateSet.php new file mode 100644 index 00000000000..4ecefa6f024 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerJwkCreateSet.php @@ -0,0 +1,275 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerJwkCreateSet Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerJwkCreateSet implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerJwkCreateSet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\JsonWebKeySetGeneratorRequest', + 'set' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null, + 'set' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body', + 'set' => 'set' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody', + 'set' => 'setSet' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody', + 'set' => 'getSet' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['set'] = isset($data['set']) ? $data['set'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['set'] === null) { + $invalid_properties[] = "'set' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['set'] === null) { + return false; + } + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\JsonWebKeySetGeneratorRequest + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\JsonWebKeySetGeneratorRequest $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets set + * @return string + */ + public function getSet() + { + return $this->container['set']; + } + + /** + * Sets set + * @param string $set The set in: path + * @return $this + */ + public function setSet($set) + { + $this->container['set'] = $set; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerJwkSetQuery.php b/sdk/php/swagger/lib/Model/SwaggerJwkSetQuery.php new file mode 100644 index 00000000000..5c8348f7a79 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerJwkSetQuery.php @@ -0,0 +1,248 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerJwkSetQuery Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerJwkSetQuery implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerJwkSetQuery'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'set' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'set' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'set' => 'set' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'set' => 'setSet' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'set' => 'getSet' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['set'] = isset($data['set']) ? $data['set'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['set'] === null) { + $invalid_properties[] = "'set' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['set'] === null) { + return false; + } + return true; + } + + + /** + * Gets set + * @return string + */ + public function getSet() + { + return $this->container['set']; + } + + /** + * Sets set + * @param string $set The set in: path + * @return $this + */ + public function setSet($set) + { + $this->container['set'] = $set; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerJwkUpdateSet.php b/sdk/php/swagger/lib/Model/SwaggerJwkUpdateSet.php new file mode 100644 index 00000000000..84599858315 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerJwkUpdateSet.php @@ -0,0 +1,275 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerJwkUpdateSet Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerJwkUpdateSet implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerJwkUpdateSet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\JsonWebKeySet', + 'set' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null, + 'set' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body', + 'set' => 'set' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody', + 'set' => 'setSet' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody', + 'set' => 'getSet' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['set'] = isset($data['set']) ? $data['set'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['set'] === null) { + $invalid_properties[] = "'set' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['set'] === null) { + return false; + } + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\JsonWebKeySet + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\JsonWebKeySet $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets set + * @return string + */ + public function getSet() + { + return $this->container['set']; + } + + /** + * Sets set + * @param string $set The set in: path + * @return $this + */ + public function setSet($set) + { + $this->container['set'] = $set; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerJwkUpdateSetKey.php b/sdk/php/swagger/lib/Model/SwaggerJwkUpdateSetKey.php new file mode 100644 index 00000000000..abd87ab209f --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerJwkUpdateSetKey.php @@ -0,0 +1,308 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerJwkUpdateSetKey Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerJwkUpdateSetKey implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerJwkUpdateSetKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\JsonWebKey', + 'kid' => 'string', + 'set' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null, + 'kid' => null, + 'set' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body', + 'kid' => 'kid', + 'set' => 'set' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody', + 'kid' => 'setKid', + 'set' => 'setSet' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody', + 'kid' => 'getKid', + 'set' => 'getSet' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['kid'] = isset($data['kid']) ? $data['kid'] : null; + $this->container['set'] = isset($data['set']) ? $data['set'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['kid'] === null) { + $invalid_properties[] = "'kid' can't be null"; + } + if ($this->container['set'] === null) { + $invalid_properties[] = "'set' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['kid'] === null) { + return false; + } + if ($this->container['set'] === null) { + return false; + } + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\JsonWebKey + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\JsonWebKey $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets kid + * @return string + */ + public function getKid() + { + return $this->container['kid']; + } + + /** + * Sets kid + * @param string $kid The kid of the desired key in: path + * @return $this + */ + public function setKid($kid) + { + $this->container['kid'] = $kid; + + return $this; + } + + /** + * Gets set + * @return string + */ + public function getSet() + { + return $this->container['set']; + } + + /** + * Sets set + * @param string $set The set in: path + * @return $this + */ + public function setSet($set) + { + $this->container['set'] = $set; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerListPolicyParameters.php b/sdk/php/swagger/lib/Model/SwaggerListPolicyParameters.php new file mode 100644 index 00000000000..ba569761d63 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerListPolicyParameters.php @@ -0,0 +1,269 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerListPolicyParameters Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerListPolicyParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerListPolicyParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'limit' => 'int', + 'offset' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'limit' => 'int64', + 'offset' => 'int64' + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'limit' => 'limit', + 'offset' => 'offset' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'limit' => 'setLimit', + 'offset' => 'setOffset' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'limit' => 'getLimit', + 'offset' => 'getOffset' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['limit'] = isset($data['limit']) ? $data['limit'] : null; + $this->container['offset'] = isset($data['offset']) ? $data['offset'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets limit + * @return int + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * @param int $limit The maximum amount of policies returned. in: query + * @return $this + */ + public function setLimit($limit) + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets offset + * @return int + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * @param int $offset The offset from where to start looking. in: query + * @return $this + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerListPolicyResponse.php b/sdk/php/swagger/lib/Model/SwaggerListPolicyResponse.php new file mode 100644 index 00000000000..54b91e50a5b --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerListPolicyResponse.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerListPolicyResponse Class Doc Comment + * + * @category Class + * @description A policy + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerListPolicyResponse implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerListPolicyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\Policy[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\Policy[] + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\Policy[] $body in: body type: array + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerOAuthConsentRequest.php b/sdk/php/swagger/lib/Model/SwaggerOAuthConsentRequest.php new file mode 100644 index 00000000000..822d47b441a --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerOAuthConsentRequest.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerOAuthConsentRequest Class Doc Comment + * + * @category Class + * @description The consent request response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerOAuthConsentRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerOAuthConsentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\OAuth2ConsentRequest' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\OAuth2ConsentRequest + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\OAuth2ConsentRequest $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerOAuthConsentRequestPayload.php b/sdk/php/swagger/lib/Model/SwaggerOAuthConsentRequestPayload.php new file mode 100644 index 00000000000..1548f0d58e0 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerOAuthConsentRequestPayload.php @@ -0,0 +1,248 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerOAuthConsentRequestPayload Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerOAuthConsentRequestPayload implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerOAuthConsentRequestPayload'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['id'] === null) { + $invalid_properties[] = "'id' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id The id of the OAuth 2.0 Consent Request. + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerOAuthIntrospectionRequest.php b/sdk/php/swagger/lib/Model/SwaggerOAuthIntrospectionRequest.php new file mode 100644 index 00000000000..d305935ef43 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerOAuthIntrospectionRequest.php @@ -0,0 +1,275 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerOAuthIntrospectionRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerOAuthIntrospectionRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerOAuthIntrospectionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'scope' => 'string', + 'token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'scope' => null, + 'token' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'scope' => 'scope', + 'token' => 'token' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'scope' => 'setScope', + 'token' => 'setToken' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'scope' => 'getScope', + 'token' => 'getToken' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['token'] === null) { + $invalid_properties[] = "'token' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['token'] === null) { + return false; + } + return true; + } + + + /** + * Gets scope + * @return string + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * @param string $scope 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. in: formData + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + /** + * Gets token + * @return string + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * @param string $token 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 [RFC6749], Section 5.1. This endpoint DOES NOT accept refresh tokens for validation. + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerOAuthIntrospectionResponse.php b/sdk/php/swagger/lib/Model/SwaggerOAuthIntrospectionResponse.php new file mode 100644 index 00000000000..6abf68b0421 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerOAuthIntrospectionResponse.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerOAuthIntrospectionResponse Class Doc Comment + * + * @category Class + * @description The token introspection response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerOAuthIntrospectionResponse implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerOAuthIntrospectionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\OAuth2TokenIntrospection' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\OAuth2TokenIntrospection + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\OAuth2TokenIntrospection $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerOAuthTokenResponse.php b/sdk/php/swagger/lib/Model/SwaggerOAuthTokenResponse.php new file mode 100644 index 00000000000..e944d7fe804 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerOAuthTokenResponse.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerOAuthTokenResponse Class Doc Comment + * + * @category Class + * @description The token response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerOAuthTokenResponse implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerOAuthTokenResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\SwaggerOAuthTokenResponseBody' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\SwaggerOAuthTokenResponseBody + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\SwaggerOAuthTokenResponseBody $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerOAuthTokenResponseBody.php b/sdk/php/swagger/lib/Model/SwaggerOAuthTokenResponseBody.php new file mode 100644 index 00000000000..b95ed4c94ae --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerOAuthTokenResponseBody.php @@ -0,0 +1,378 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerOAuthTokenResponseBody Class Doc Comment + * + * @category Class + * @description in: body + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerOAuthTokenResponseBody implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerOAuthTokenResponse_Body'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'access_token' => 'string', + 'expires_in' => 'int', + 'id_token' => 'int', + 'refresh_token' => 'string', + 'scope' => 'int', + 'token_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'access_token' => null, + 'expires_in' => 'int64', + 'id_token' => 'int64', + 'refresh_token' => null, + 'scope' => 'int64', + 'token_type' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'access_token' => 'access_token', + 'expires_in' => 'expires_in', + 'id_token' => 'id_token', + 'refresh_token' => 'refresh_token', + 'scope' => 'scope', + 'token_type' => 'token_type' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'access_token' => 'setAccessToken', + 'expires_in' => 'setExpiresIn', + 'id_token' => 'setIdToken', + 'refresh_token' => 'setRefreshToken', + 'scope' => 'setScope', + 'token_type' => 'setTokenType' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'access_token' => 'getAccessToken', + 'expires_in' => 'getExpiresIn', + 'id_token' => 'getIdToken', + 'refresh_token' => 'getRefreshToken', + 'scope' => 'getScope', + 'token_type' => 'getTokenType' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['access_token'] = isset($data['access_token']) ? $data['access_token'] : null; + $this->container['expires_in'] = isset($data['expires_in']) ? $data['expires_in'] : null; + $this->container['id_token'] = isset($data['id_token']) ? $data['id_token'] : null; + $this->container['refresh_token'] = isset($data['refresh_token']) ? $data['refresh_token'] : null; + $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; + $this->container['token_type'] = isset($data['token_type']) ? $data['token_type'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets access_token + * @return string + */ + public function getAccessToken() + { + return $this->container['access_token']; + } + + /** + * Sets access_token + * @param string $access_token The access token issued by the authorization server. + * @return $this + */ + public function setAccessToken($access_token) + { + $this->container['access_token'] = $access_token; + + return $this; + } + + /** + * Gets expires_in + * @return int + */ + public function getExpiresIn() + { + return $this->container['expires_in']; + } + + /** + * Sets expires_in + * @param int $expires_in 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. + * @return $this + */ + public function setExpiresIn($expires_in) + { + $this->container['expires_in'] = $expires_in; + + return $this; + } + + /** + * Gets id_token + * @return int + */ + public function getIdToken() + { + return $this->container['id_token']; + } + + /** + * Sets id_token + * @param int $id_token To retrieve a refresh token request the id_token scope. + * @return $this + */ + public function setIdToken($id_token) + { + $this->container['id_token'] = $id_token; + + return $this; + } + + /** + * Gets refresh_token + * @return string + */ + public function getRefreshToken() + { + return $this->container['refresh_token']; + } + + /** + * Sets refresh_token + * @param string $refresh_token The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request. + * @return $this + */ + public function setRefreshToken($refresh_token) + { + $this->container['refresh_token'] = $refresh_token; + + return $this; + } + + /** + * Gets scope + * @return int + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * @param int $scope The scope of the access token + * @return $this + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + + /** + * Gets token_type + * @return string + */ + public function getTokenType() + { + return $this->container['token_type']; + } + + /** + * Sets token_type + * @param string $token_type The type of the token issued + * @return $this + */ + public function setTokenType($token_type) + { + $this->container['token_type'] = $token_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerRejectConsentRequest.php b/sdk/php/swagger/lib/Model/SwaggerRejectConsentRequest.php new file mode 100644 index 00000000000..b1b66a27b62 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerRejectConsentRequest.php @@ -0,0 +1,281 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerRejectConsentRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerRejectConsentRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerRejectConsentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\ConsentRequestRejection', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null, + 'id' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body', + 'id' => 'id' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody', + 'id' => 'setId' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody', + 'id' => 'getId' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['body'] === null) { + $invalid_properties[] = "'body' can't be null"; + } + if ($this->container['id'] === null) { + $invalid_properties[] = "'id' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['body'] === null) { + return false; + } + if ($this->container['id'] === null) { + return false; + } + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\ConsentRequestRejection + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\ConsentRequestRejection $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id in: path + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerRevokeOAuth2TokenParameters.php b/sdk/php/swagger/lib/Model/SwaggerRevokeOAuth2TokenParameters.php new file mode 100644 index 00000000000..89b499400bb --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerRevokeOAuth2TokenParameters.php @@ -0,0 +1,248 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerRevokeOAuth2TokenParameters Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerRevokeOAuth2TokenParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerRevokeOAuth2TokenParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'token' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'token' => 'token' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'token' => 'setToken' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'token' => 'getToken' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['token'] === null) { + $invalid_properties[] = "'token' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['token'] === null) { + return false; + } + return true; + } + + + /** + * Gets token + * @return string + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * @param string $token in: formData + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerUpdatePolicyParameters.php b/sdk/php/swagger/lib/Model/SwaggerUpdatePolicyParameters.php new file mode 100644 index 00000000000..f93d1bd9aa3 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerUpdatePolicyParameters.php @@ -0,0 +1,269 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerUpdatePolicyParameters Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerUpdatePolicyParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerUpdatePolicyParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\Policy', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null, + 'id' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body', + 'id' => 'id' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody', + 'id' => 'setId' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody', + 'id' => 'getId' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\Policy + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\Policy $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets id + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * @param string $id The id of the policy. in: path + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerWardenAccessRequestResponseParameters.php b/sdk/php/swagger/lib/Model/SwaggerWardenAccessRequestResponseParameters.php new file mode 100644 index 00000000000..9d96f8b72c6 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerWardenAccessRequestResponseParameters.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerWardenAccessRequestResponseParameters Class Doc Comment + * + * @category Class + * @description The warden access request response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerWardenAccessRequestResponseParameters implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerWardenAccessRequestResponseParameters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\WardenAccessRequestResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\WardenAccessRequestResponse + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\WardenAccessRequestResponse $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggerWardenTokenAccessRequestResponse.php b/sdk/php/swagger/lib/Model/SwaggerWardenTokenAccessRequestResponse.php new file mode 100644 index 00000000000..a93d86604d2 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggerWardenTokenAccessRequestResponse.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggerWardenTokenAccessRequestResponse Class Doc Comment + * + * @category Class + * @description The warden access request (with token) response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggerWardenTokenAccessRequestResponse implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggerWardenTokenAccessRequestResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\WardenTokenAccessRequestResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\WardenTokenAccessRequestResponse + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\WardenTokenAccessRequestResponse $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggeruserinfoResponse.php b/sdk/php/swagger/lib/Model/SwaggeruserinfoResponse.php new file mode 100644 index 00000000000..2a7a9a6aac7 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggeruserinfoResponse.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggeruserinfoResponse Class Doc Comment + * + * @category Class + * @description The userinfo response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggeruserinfoResponse implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggeruserinfoResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'body' => '\Hydra\SDK\Model\SwaggeruserinfoResponsePayload' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'body' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'Body' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets body + * @return \Hydra\SDK\Model\SwaggeruserinfoResponsePayload + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * @param \Hydra\SDK\Model\SwaggeruserinfoResponsePayload $body + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/SwaggeruserinfoResponsePayload.php b/sdk/php/swagger/lib/Model/SwaggeruserinfoResponsePayload.php new file mode 100644 index 00000000000..413b8e73ac2 --- /dev/null +++ b/sdk/php/swagger/lib/Model/SwaggeruserinfoResponsePayload.php @@ -0,0 +1,728 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * SwaggeruserinfoResponsePayload Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SwaggeruserinfoResponsePayload implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'swaggeruserinfoResponsePayload'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'birthdate' => 'string', + 'email' => 'string', + 'email_verified' => 'bool', + 'family_name' => 'string', + 'gender' => 'string', + 'given_name' => 'string', + 'locale' => 'string', + 'middle_name' => 'string', + 'name' => 'string', + 'nickname' => 'string', + 'phone_number' => 'string', + 'phone_number_verified' => 'bool', + 'picture' => 'string', + 'preferred_username' => 'string', + 'profile' => 'string', + 'sub' => 'string', + 'updated_at' => 'int', + 'website' => 'string', + 'zoneinfo' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'birthdate' => null, + 'email' => null, + 'email_verified' => null, + 'family_name' => null, + 'gender' => null, + 'given_name' => null, + 'locale' => null, + 'middle_name' => null, + 'name' => null, + 'nickname' => null, + 'phone_number' => null, + 'phone_number_verified' => null, + 'picture' => null, + 'preferred_username' => null, + 'profile' => null, + 'sub' => null, + 'updated_at' => 'int64', + 'website' => null, + 'zoneinfo' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'birthdate' => 'birthdate', + 'email' => 'email', + 'email_verified' => 'email_verified', + 'family_name' => 'family_name', + 'gender' => 'gender', + 'given_name' => 'given_name', + 'locale' => 'locale', + 'middle_name' => 'middle_name', + 'name' => 'name', + 'nickname' => 'nickname', + 'phone_number' => 'phone_number', + 'phone_number_verified' => 'phone_number_verified', + 'picture' => 'picture', + 'preferred_username' => 'preferred_username', + 'profile' => 'profile', + 'sub' => 'sub', + 'updated_at' => 'updated_at', + 'website' => 'website', + 'zoneinfo' => 'zoneinfo' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'birthdate' => 'setBirthdate', + 'email' => 'setEmail', + 'email_verified' => 'setEmailVerified', + 'family_name' => 'setFamilyName', + 'gender' => 'setGender', + 'given_name' => 'setGivenName', + 'locale' => 'setLocale', + 'middle_name' => 'setMiddleName', + 'name' => 'setName', + 'nickname' => 'setNickname', + 'phone_number' => 'setPhoneNumber', + 'phone_number_verified' => 'setPhoneNumberVerified', + 'picture' => 'setPicture', + 'preferred_username' => 'setPreferredUsername', + 'profile' => 'setProfile', + 'sub' => 'setSub', + 'updated_at' => 'setUpdatedAt', + 'website' => 'setWebsite', + 'zoneinfo' => 'setZoneinfo' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'birthdate' => 'getBirthdate', + 'email' => 'getEmail', + 'email_verified' => 'getEmailVerified', + 'family_name' => 'getFamilyName', + 'gender' => 'getGender', + 'given_name' => 'getGivenName', + 'locale' => 'getLocale', + 'middle_name' => 'getMiddleName', + 'name' => 'getName', + 'nickname' => 'getNickname', + 'phone_number' => 'getPhoneNumber', + 'phone_number_verified' => 'getPhoneNumberVerified', + 'picture' => 'getPicture', + 'preferred_username' => 'getPreferredUsername', + 'profile' => 'getProfile', + 'sub' => 'getSub', + 'updated_at' => 'getUpdatedAt', + 'website' => 'getWebsite', + 'zoneinfo' => 'getZoneinfo' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['birthdate'] = isset($data['birthdate']) ? $data['birthdate'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['email_verified'] = isset($data['email_verified']) ? $data['email_verified'] : null; + $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; + $this->container['gender'] = isset($data['gender']) ? $data['gender'] : null; + $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; + $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null; + $this->container['middle_name'] = isset($data['middle_name']) ? $data['middle_name'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['nickname'] = isset($data['nickname']) ? $data['nickname'] : null; + $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null; + $this->container['phone_number_verified'] = isset($data['phone_number_verified']) ? $data['phone_number_verified'] : null; + $this->container['picture'] = isset($data['picture']) ? $data['picture'] : null; + $this->container['preferred_username'] = isset($data['preferred_username']) ? $data['preferred_username'] : null; + $this->container['profile'] = isset($data['profile']) ? $data['profile'] : null; + $this->container['sub'] = isset($data['sub']) ? $data['sub'] : null; + $this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null; + $this->container['website'] = isset($data['website']) ? $data['website'] : null; + $this->container['zoneinfo'] = isset($data['zoneinfo']) ? $data['zoneinfo'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets birthdate + * @return string + */ + public function getBirthdate() + { + return $this->container['birthdate']; + } + + /** + * Sets birthdate + * @param string $birthdate 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. + * @return $this + */ + public function setBirthdate($birthdate) + { + $this->container['birthdate'] = $birthdate; + + return $this; + } + + /** + * Gets email + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * @param string $email End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7. + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets email_verified + * @return bool + */ + public function getEmailVerified() + { + return $this->container['email_verified']; + } + + /** + * Sets email_verified + * @param bool $email_verified True if the End-User's e-mail address has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this e-mail address was controlled by the End-User at the time the verification was performed. The means by which an e-mail address is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. + * @return $this + */ + public function setEmailVerified($email_verified) + { + $this->container['email_verified'] = $email_verified; + + return $this; + } + + /** + * Gets family_name + * @return string + */ + public function getFamilyName() + { + return $this->container['family_name']; + } + + /** + * Sets family_name + * @param string $family_name Surname(s) or last name(s) of the End-User. Note that in some cultures, people can have multiple family names or no family name; all can be present, with the names being separated by space characters. + * @return $this + */ + public function setFamilyName($family_name) + { + $this->container['family_name'] = $family_name; + + return $this; + } + + /** + * Gets gender + * @return string + */ + public function getGender() + { + return $this->container['gender']; + } + + /** + * Sets gender + * @param string $gender End-User's gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable. + * @return $this + */ + public function setGender($gender) + { + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets given_name + * @return string + */ + public function getGivenName() + { + return $this->container['given_name']; + } + + /** + * Sets given_name + * @param string $given_name Given name(s) or first name(s) of the End-User. Note that in some cultures, people can have multiple given names; all can be present, with the names being separated by space characters. + * @return $this + */ + public function setGivenName($given_name) + { + $this->container['given_name'] = $given_name; + + return $this; + } + + /** + * Gets locale + * @return string + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * @param string $locale End-User's locale, represented as a BCP47 [RFC5646] language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. For example, en-US or fr-CA. As a compatibility note, some implementations have used an underscore as the separator rather than a dash, for example, en_US; Relying Parties MAY choose to accept this locale syntax as well. + * @return $this + */ + public function setLocale($locale) + { + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets middle_name + * @return string + */ + public function getMiddleName() + { + return $this->container['middle_name']; + } + + /** + * Sets middle_name + * @param string $middle_name Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used. + * @return $this + */ + public function setMiddleName($middle_name) + { + $this->container['middle_name'] = $middle_name; + + return $this; + } + + /** + * Gets name + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * @param string $name End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences. + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets nickname + * @return string + */ + public function getNickname() + { + return $this->container['nickname']; + } + + /** + * Sets nickname + * @param string $nickname Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael. + * @return $this + */ + public function setNickname($nickname) + { + $this->container['nickname'] = $nickname; + + return $this; + } + + /** + * Gets phone_number + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * @param string $phone_number End-User's preferred telephone number. E.164 [E.164] is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400. If the phone number contains an extension, it is RECOMMENDED that the extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678. + * @return $this + */ + public function setPhoneNumber($phone_number) + { + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets phone_number_verified + * @return bool + */ + public function getPhoneNumberVerified() + { + return $this->container['phone_number_verified']; + } + + /** + * Sets phone_number_verified + * @param bool $phone_number_verified True if the End-User's phone number has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this phone number was controlled by the End-User at the time the verification was performed. The means by which a phone number is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. When true, the phone_number Claim MUST be in E.164 format and any extensions MUST be represented in RFC 3966 format. + * @return $this + */ + public function setPhoneNumberVerified($phone_number_verified) + { + $this->container['phone_number_verified'] = $phone_number_verified; + + return $this; + } + + /** + * Gets picture + * @return string + */ + public function getPicture() + { + return $this->container['picture']; + } + + /** + * Sets picture + * @param string $picture URL of the End-User's profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image. Note that this URL SHOULD specifically reference a profile photo of the End-User suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User. + * @return $this + */ + public function setPicture($picture) + { + $this->container['picture'] = $picture; + + return $this; + } + + /** + * Gets preferred_username + * @return string + */ + public function getPreferredUsername() + { + return $this->container['preferred_username']; + } + + /** + * Sets preferred_username + * @param string $preferred_username Non-unique shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe. This value MAY be any valid JSON string including special characters such as @, /, or whitespace. + * @return $this + */ + public function setPreferredUsername($preferred_username) + { + $this->container['preferred_username'] = $preferred_username; + + return $this; + } + + /** + * Gets profile + * @return string + */ + public function getProfile() + { + return $this->container['profile']; + } + + /** + * Sets profile + * @param string $profile URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User. + * @return $this + */ + public function setProfile($profile) + { + $this->container['profile'] = $profile; + + return $this; + } + + /** + * Gets sub + * @return string + */ + public function getSub() + { + return $this->container['sub']; + } + + /** + * Sets sub + * @param string $sub Subject - Identifier for the End-User at the Issuer. + * @return $this + */ + public function setSub($sub) + { + $this->container['sub'] = $sub; + + return $this; + } + + /** + * Gets updated_at + * @return int + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * @param int $updated_at Time the End-User's information was last updated. Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time. + * @return $this + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets website + * @return string + */ + public function getWebsite() + { + return $this->container['website']; + } + + /** + * Sets website + * @param string $website URL of the End-User's Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with. + * @return $this + */ + public function setWebsite($website) + { + $this->container['website'] = $website; + + return $this; + } + + /** + * Gets zoneinfo + * @return string + */ + public function getZoneinfo() + { + return $this->container['zoneinfo']; + } + + /** + * Sets zoneinfo + * @param string $zoneinfo String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone. For example, Europe/Paris or America/Los_Angeles. + * @return $this + */ + public function setZoneinfo($zoneinfo) + { + $this->container['zoneinfo'] = $zoneinfo; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/TokenAllowedRequest.php b/sdk/php/swagger/lib/Model/TokenAllowedRequest.php new file mode 100644 index 00000000000..61cb11e7a45 --- /dev/null +++ b/sdk/php/swagger/lib/Model/TokenAllowedRequest.php @@ -0,0 +1,296 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * TokenAllowedRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class TokenAllowedRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'tokenAllowedRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'action' => 'string', + 'context' => 'map[string,object]', + 'resource' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'action' => null, + 'context' => null, + 'resource' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'context' => 'context', + 'resource' => 'resource' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'context' => 'setContext', + 'resource' => 'setResource' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'context' => 'getContext', + 'resource' => 'getResource' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['context'] = isset($data['context']) ? $data['context'] : null; + $this->container['resource'] = isset($data['resource']) ? $data['resource'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets action + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * @param string $action Action is the action that is requested on the resource. + * @return $this + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets context + * @return map[string,object] + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * @param map[string,object] $context Context is the request's environmental context. + * @return $this + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets resource + * @return string + */ + public function getResource() + { + return $this->container['resource']; + } + + /** + * Sets resource + * @param string $resource Resource is the resource that access is requested to. + * @return $this + */ + public function setResource($resource) + { + $this->container['resource'] = $resource; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/WardenAccessRequest.php b/sdk/php/swagger/lib/Model/WardenAccessRequest.php new file mode 100644 index 00000000000..9f3dbf93773 --- /dev/null +++ b/sdk/php/swagger/lib/Model/WardenAccessRequest.php @@ -0,0 +1,323 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * WardenAccessRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class WardenAccessRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'wardenAccessRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'action' => 'string', + 'context' => 'map[string,object]', + 'resource' => 'string', + 'subject' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'action' => null, + 'context' => null, + 'resource' => null, + 'subject' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'context' => 'context', + 'resource' => 'resource', + 'subject' => 'subject' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'context' => 'setContext', + 'resource' => 'setResource', + 'subject' => 'setSubject' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'context' => 'getContext', + 'resource' => 'getResource', + 'subject' => 'getSubject' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['context'] = isset($data['context']) ? $data['context'] : null; + $this->container['resource'] = isset($data['resource']) ? $data['resource'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets action + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * @param string $action Action is the action that is requested on the resource. + * @return $this + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets context + * @return map[string,object] + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * @param map[string,object] $context Context is the request's environmental context. + * @return $this + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets resource + * @return string + */ + public function getResource() + { + return $this->container['resource']; + } + + /** + * Sets resource + * @param string $resource Resource is the resource that access is requested to. + * @return $this + */ + public function setResource($resource) + { + $this->container['resource'] = $resource; + + return $this; + } + + /** + * Gets subject + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * @param string $subject Subejct is the subject that is requesting access. + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/WardenAccessRequestResponse.php b/sdk/php/swagger/lib/Model/WardenAccessRequestResponse.php new file mode 100644 index 00000000000..7dd5a1d87cd --- /dev/null +++ b/sdk/php/swagger/lib/Model/WardenAccessRequestResponse.php @@ -0,0 +1,243 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * WardenAccessRequestResponse Class Doc Comment + * + * @category Class + * @description The warden access request response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class WardenAccessRequestResponse implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'wardenAccessRequestResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'allowed' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'allowed' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'allowed' => 'allowed' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['allowed'] = isset($data['allowed']) ? $data['allowed'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets allowed + * @return bool + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * @param bool $allowed Allowed is true if the request is allowed and false otherwise. + * @return $this + */ + public function setAllowed($allowed) + { + $this->container['allowed'] = $allowed; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/WardenTokenAccessRequest.php b/sdk/php/swagger/lib/Model/WardenTokenAccessRequest.php new file mode 100644 index 00000000000..5903e8761b1 --- /dev/null +++ b/sdk/php/swagger/lib/Model/WardenTokenAccessRequest.php @@ -0,0 +1,350 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * WardenTokenAccessRequest Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class WardenTokenAccessRequest implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'wardenTokenAccessRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'action' => 'string', + 'context' => 'map[string,object]', + 'resource' => 'string', + 'scopes' => 'string[]', + 'token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'action' => null, + 'context' => null, + 'resource' => null, + 'scopes' => null, + 'token' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'context' => 'context', + 'resource' => 'resource', + 'scopes' => 'scopes', + 'token' => 'token' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'context' => 'setContext', + 'resource' => 'setResource', + 'scopes' => 'setScopes', + 'token' => 'setToken' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'context' => 'getContext', + 'resource' => 'getResource', + 'scopes' => 'getScopes', + 'token' => 'getToken' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = isset($data['action']) ? $data['action'] : null; + $this->container['context'] = isset($data['context']) ? $data['context'] : null; + $this->container['resource'] = isset($data['resource']) ? $data['resource'] : null; + $this->container['scopes'] = isset($data['scopes']) ? $data['scopes'] : null; + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets action + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * @param string $action Action is the action that is requested on the resource. + * @return $this + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets context + * @return map[string,object] + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * @param map[string,object] $context Context is the request's environmental context. + * @return $this + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets resource + * @return string + */ + public function getResource() + { + return $this->container['resource']; + } + + /** + * Sets resource + * @param string $resource Resource is the resource that access is requested to. + * @return $this + */ + public function setResource($resource) + { + $this->container['resource'] = $resource; + + return $this; + } + + /** + * Gets scopes + * @return string[] + */ + public function getScopes() + { + return $this->container['scopes']; + } + + /** + * Sets scopes + * @param string[] $scopes Scopes is an array of scopes that are requried. + * @return $this + */ + public function setScopes($scopes) + { + $this->container['scopes'] = $scopes; + + return $this; + } + + /** + * Gets token + * @return string + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * @param string $token Token is the token to introspect. + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/WardenTokenAccessRequestResponse.php b/sdk/php/swagger/lib/Model/WardenTokenAccessRequestResponse.php new file mode 100644 index 00000000000..c1392908695 --- /dev/null +++ b/sdk/php/swagger/lib/Model/WardenTokenAccessRequestResponse.php @@ -0,0 +1,432 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * WardenTokenAccessRequestResponse Class Doc Comment + * + * @category Class + * @description The warden access request (with token) response + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class WardenTokenAccessRequestResponse implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'wardenTokenAccessRequestResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'access_token_extra' => 'map[string,object]', + 'allowed' => 'bool', + 'client_id' => 'string', + 'expires_at' => 'string', + 'granted_scopes' => 'string[]', + 'issued_at' => 'string', + 'issuer' => 'string', + 'subject' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'access_token_extra' => null, + 'allowed' => null, + 'client_id' => null, + 'expires_at' => null, + 'granted_scopes' => null, + 'issued_at' => null, + 'issuer' => null, + 'subject' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'access_token_extra' => 'accessTokenExtra', + 'allowed' => 'allowed', + 'client_id' => 'clientId', + 'expires_at' => 'expiresAt', + 'granted_scopes' => 'grantedScopes', + 'issued_at' => 'issuedAt', + 'issuer' => 'issuer', + 'subject' => 'subject' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'access_token_extra' => 'setAccessTokenExtra', + 'allowed' => 'setAllowed', + 'client_id' => 'setClientId', + 'expires_at' => 'setExpiresAt', + 'granted_scopes' => 'setGrantedScopes', + 'issued_at' => 'setIssuedAt', + 'issuer' => 'setIssuer', + 'subject' => 'setSubject' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'access_token_extra' => 'getAccessTokenExtra', + 'allowed' => 'getAllowed', + 'client_id' => 'getClientId', + 'expires_at' => 'getExpiresAt', + 'granted_scopes' => 'getGrantedScopes', + 'issued_at' => 'getIssuedAt', + 'issuer' => 'getIssuer', + 'subject' => 'getSubject' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['access_token_extra'] = isset($data['access_token_extra']) ? $data['access_token_extra'] : null; + $this->container['allowed'] = isset($data['allowed']) ? $data['allowed'] : null; + $this->container['client_id'] = isset($data['client_id']) ? $data['client_id'] : null; + $this->container['expires_at'] = isset($data['expires_at']) ? $data['expires_at'] : null; + $this->container['granted_scopes'] = isset($data['granted_scopes']) ? $data['granted_scopes'] : null; + $this->container['issued_at'] = isset($data['issued_at']) ? $data['issued_at'] : null; + $this->container['issuer'] = isset($data['issuer']) ? $data['issuer'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets access_token_extra + * @return map[string,object] + */ + public function getAccessTokenExtra() + { + return $this->container['access_token_extra']; + } + + /** + * Sets access_token_extra + * @param map[string,object] $access_token_extra Extra represents arbitrary session data. + * @return $this + */ + public function setAccessTokenExtra($access_token_extra) + { + $this->container['access_token_extra'] = $access_token_extra; + + return $this; + } + + /** + * Gets allowed + * @return bool + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * @param bool $allowed Allowed is true if the request is allowed and false otherwise. + * @return $this + */ + public function setAllowed($allowed) + { + $this->container['allowed'] = $allowed; + + return $this; + } + + /** + * Gets client_id + * @return string + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * @param string $client_id ClientID is the id of the OAuth2 client that requested the token. + * @return $this + */ + public function setClientId($client_id) + { + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets expires_at + * @return string + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * @param string $expires_at ExpiresAt is the expiry timestamp. + * @return $this + */ + public function setExpiresAt($expires_at) + { + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets granted_scopes + * @return string[] + */ + public function getGrantedScopes() + { + return $this->container['granted_scopes']; + } + + /** + * Sets granted_scopes + * @param string[] $granted_scopes GrantedScopes is a list of scopes that the subject authorized when asked for consent. + * @return $this + */ + public function setGrantedScopes($granted_scopes) + { + $this->container['granted_scopes'] = $granted_scopes; + + return $this; + } + + /** + * Gets issued_at + * @return string + */ + public function getIssuedAt() + { + return $this->container['issued_at']; + } + + /** + * Sets issued_at + * @param string $issued_at IssuedAt is the token creation time stamp. + * @return $this + */ + public function setIssuedAt($issued_at) + { + $this->container['issued_at'] = $issued_at; + + return $this; + } + + /** + * Gets issuer + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * @param string $issuer Issuer is the id of the issuer, typically an hydra instance. + * @return $this + */ + public function setIssuer($issuer) + { + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets subject + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * @param string $subject Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/WellKnown.php b/sdk/php/swagger/lib/Model/WellKnown.php new file mode 100644 index 00000000000..bc88a12fc8e --- /dev/null +++ b/sdk/php/swagger/lib/Model/WellKnown.php @@ -0,0 +1,554 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * WellKnown Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class WellKnown implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'wellKnown'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + 'authorization_endpoint' => 'string', + 'claims_supported' => 'string[]', + 'id_token_signing_alg_values_supported' => 'string[]', + 'issuer' => 'string', + 'jwks_uri' => 'string', + 'response_types_supported' => 'string[]', + 'scopes_supported' => 'string[]', + 'subject_types_supported' => 'string[]', + 'token_endpoint' => 'string', + 'token_endpoint_auth_methods_supported' => 'string[]', + 'userinfo_endpoint' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'authorization_endpoint' => null, + 'claims_supported' => null, + 'id_token_signing_alg_values_supported' => null, + 'issuer' => null, + 'jwks_uri' => null, + 'response_types_supported' => null, + 'scopes_supported' => null, + 'subject_types_supported' => null, + 'token_endpoint' => null, + 'token_endpoint_auth_methods_supported' => null, + 'userinfo_endpoint' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'authorization_endpoint' => 'authorization_endpoint', + 'claims_supported' => 'claims_supported', + 'id_token_signing_alg_values_supported' => 'id_token_signing_alg_values_supported', + 'issuer' => 'issuer', + 'jwks_uri' => 'jwks_uri', + 'response_types_supported' => 'response_types_supported', + 'scopes_supported' => 'scopes_supported', + 'subject_types_supported' => 'subject_types_supported', + 'token_endpoint' => 'token_endpoint', + 'token_endpoint_auth_methods_supported' => 'token_endpoint_auth_methods_supported', + 'userinfo_endpoint' => 'userinfo_endpoint' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'authorization_endpoint' => 'setAuthorizationEndpoint', + 'claims_supported' => 'setClaimsSupported', + 'id_token_signing_alg_values_supported' => 'setIdTokenSigningAlgValuesSupported', + 'issuer' => 'setIssuer', + 'jwks_uri' => 'setJwksUri', + 'response_types_supported' => 'setResponseTypesSupported', + 'scopes_supported' => 'setScopesSupported', + 'subject_types_supported' => 'setSubjectTypesSupported', + 'token_endpoint' => 'setTokenEndpoint', + 'token_endpoint_auth_methods_supported' => 'setTokenEndpointAuthMethodsSupported', + 'userinfo_endpoint' => 'setUserinfoEndpoint' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'authorization_endpoint' => 'getAuthorizationEndpoint', + 'claims_supported' => 'getClaimsSupported', + 'id_token_signing_alg_values_supported' => 'getIdTokenSigningAlgValuesSupported', + 'issuer' => 'getIssuer', + 'jwks_uri' => 'getJwksUri', + 'response_types_supported' => 'getResponseTypesSupported', + 'scopes_supported' => 'getScopesSupported', + 'subject_types_supported' => 'getSubjectTypesSupported', + 'token_endpoint' => 'getTokenEndpoint', + 'token_endpoint_auth_methods_supported' => 'getTokenEndpointAuthMethodsSupported', + 'userinfo_endpoint' => 'getUserinfoEndpoint' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['authorization_endpoint'] = isset($data['authorization_endpoint']) ? $data['authorization_endpoint'] : null; + $this->container['claims_supported'] = isset($data['claims_supported']) ? $data['claims_supported'] : null; + $this->container['id_token_signing_alg_values_supported'] = isset($data['id_token_signing_alg_values_supported']) ? $data['id_token_signing_alg_values_supported'] : null; + $this->container['issuer'] = isset($data['issuer']) ? $data['issuer'] : null; + $this->container['jwks_uri'] = isset($data['jwks_uri']) ? $data['jwks_uri'] : null; + $this->container['response_types_supported'] = isset($data['response_types_supported']) ? $data['response_types_supported'] : null; + $this->container['scopes_supported'] = isset($data['scopes_supported']) ? $data['scopes_supported'] : null; + $this->container['subject_types_supported'] = isset($data['subject_types_supported']) ? $data['subject_types_supported'] : null; + $this->container['token_endpoint'] = isset($data['token_endpoint']) ? $data['token_endpoint'] : null; + $this->container['token_endpoint_auth_methods_supported'] = isset($data['token_endpoint_auth_methods_supported']) ? $data['token_endpoint_auth_methods_supported'] : null; + $this->container['userinfo_endpoint'] = isset($data['userinfo_endpoint']) ? $data['userinfo_endpoint'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + if ($this->container['authorization_endpoint'] === null) { + $invalid_properties[] = "'authorization_endpoint' can't be null"; + } + if ($this->container['id_token_signing_alg_values_supported'] === null) { + $invalid_properties[] = "'id_token_signing_alg_values_supported' can't be null"; + } + if ($this->container['issuer'] === null) { + $invalid_properties[] = "'issuer' can't be null"; + } + if ($this->container['jwks_uri'] === null) { + $invalid_properties[] = "'jwks_uri' can't be null"; + } + if ($this->container['response_types_supported'] === null) { + $invalid_properties[] = "'response_types_supported' can't be null"; + } + if ($this->container['subject_types_supported'] === null) { + $invalid_properties[] = "'subject_types_supported' can't be null"; + } + if ($this->container['token_endpoint'] === null) { + $invalid_properties[] = "'token_endpoint' can't be null"; + } + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['authorization_endpoint'] === null) { + return false; + } + if ($this->container['id_token_signing_alg_values_supported'] === null) { + return false; + } + if ($this->container['issuer'] === null) { + return false; + } + if ($this->container['jwks_uri'] === null) { + return false; + } + if ($this->container['response_types_supported'] === null) { + return false; + } + if ($this->container['subject_types_supported'] === null) { + return false; + } + if ($this->container['token_endpoint'] === null) { + return false; + } + return true; + } + + + /** + * Gets authorization_endpoint + * @return string + */ + public function getAuthorizationEndpoint() + { + return $this->container['authorization_endpoint']; + } + + /** + * Sets authorization_endpoint + * @param string $authorization_endpoint URL of the OP's OAuth 2.0 Authorization Endpoint + * @return $this + */ + public function setAuthorizationEndpoint($authorization_endpoint) + { + $this->container['authorization_endpoint'] = $authorization_endpoint; + + return $this; + } + + /** + * Gets claims_supported + * @return string[] + */ + public function getClaimsSupported() + { + return $this->container['claims_supported']; + } + + /** + * Sets claims_supported + * @param string[] $claims_supported 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. + * @return $this + */ + public function setClaimsSupported($claims_supported) + { + $this->container['claims_supported'] = $claims_supported; + + return $this; + } + + /** + * Gets id_token_signing_alg_values_supported + * @return string[] + */ + public function getIdTokenSigningAlgValuesSupported() + { + return $this->container['id_token_signing_alg_values_supported']; + } + + /** + * Sets id_token_signing_alg_values_supported + * @param string[] $id_token_signing_alg_values_supported JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for the ID Token to encode the Claims in a JWT. + * @return $this + */ + public function setIdTokenSigningAlgValuesSupported($id_token_signing_alg_values_supported) + { + $this->container['id_token_signing_alg_values_supported'] = $id_token_signing_alg_values_supported; + + return $this; + } + + /** + * Gets issuer + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * @param string $issuer URL using the https scheme with no query or fragment component that the OP asserts as its Issuer Identifier. If Issuer 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 Issuer. + * @return $this + */ + public function setIssuer($issuer) + { + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets jwks_uri + * @return string + */ + public function getJwksUri() + { + return $this->container['jwks_uri']; + } + + /** + * Sets jwks_uri + * @param string $jwks_uri 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. + * @return $this + */ + public function setJwksUri($jwks_uri) + { + $this->container['jwks_uri'] = $jwks_uri; + + return $this; + } + + /** + * Gets response_types_supported + * @return string[] + */ + public function getResponseTypesSupported() + { + return $this->container['response_types_supported']; + } + + /** + * Sets response_types_supported + * @param string[] $response_types_supported 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. + * @return $this + */ + public function setResponseTypesSupported($response_types_supported) + { + $this->container['response_types_supported'] = $response_types_supported; + + return $this; + } + + /** + * Gets scopes_supported + * @return string[] + */ + public function getScopesSupported() + { + return $this->container['scopes_supported']; + } + + /** + * Sets scopes_supported + * @param string[] $scopes_supported SON 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 + * @return $this + */ + public function setScopesSupported($scopes_supported) + { + $this->container['scopes_supported'] = $scopes_supported; + + return $this; + } + + /** + * Gets subject_types_supported + * @return string[] + */ + public function getSubjectTypesSupported() + { + return $this->container['subject_types_supported']; + } + + /** + * Sets subject_types_supported + * @param string[] $subject_types_supported JSON array containing a list of the Subject Identifier types that this OP supports. Valid types include pairwise and public. + * @return $this + */ + public function setSubjectTypesSupported($subject_types_supported) + { + $this->container['subject_types_supported'] = $subject_types_supported; + + return $this; + } + + /** + * Gets token_endpoint + * @return string + */ + public function getTokenEndpoint() + { + return $this->container['token_endpoint']; + } + + /** + * Sets token_endpoint + * @param string $token_endpoint URL of the OP's OAuth 2.0 Token Endpoint + * @return $this + */ + public function setTokenEndpoint($token_endpoint) + { + $this->container['token_endpoint'] = $token_endpoint; + + return $this; + } + + /** + * Gets token_endpoint_auth_methods_supported + * @return string[] + */ + public function getTokenEndpointAuthMethodsSupported() + { + return $this->container['token_endpoint_auth_methods_supported']; + } + + /** + * Sets token_endpoint_auth_methods_supported + * @param string[] $token_endpoint_auth_methods_supported 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 + * @return $this + */ + public function setTokenEndpointAuthMethodsSupported($token_endpoint_auth_methods_supported) + { + $this->container['token_endpoint_auth_methods_supported'] = $token_endpoint_auth_methods_supported; + + return $this; + } + + /** + * Gets userinfo_endpoint + * @return string + */ + public function getUserinfoEndpoint() + { + return $this->container['userinfo_endpoint']; + } + + /** + * Sets userinfo_endpoint + * @param string $userinfo_endpoint URL of the OP's UserInfo Endpoint. + * @return $this + */ + public function setUserinfoEndpoint($userinfo_endpoint) + { + $this->container['userinfo_endpoint'] = $userinfo_endpoint; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/Writer.php b/sdk/php/swagger/lib/Model/Writer.php new file mode 100644 index 00000000000..a69cb81b05a --- /dev/null +++ b/sdk/php/swagger/lib/Model/Writer.php @@ -0,0 +1,221 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK\Model; + +use \ArrayAccess; + +/** + * Writer Class Doc Comment + * + * @category Class + * @description Writer is a helper to write arbitrary data to a ResponseWriter + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class Writer implements ArrayAccess +{ + const DISCRIMINATOR = null; + + /** + * The original name of the model. + * @var string + */ + protected static $swaggerModelName = 'Writer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Hydra\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/ObjectSerializer.php b/sdk/php/swagger/lib/ObjectSerializer.php new file mode 100644 index 00000000000..9e5e03a5e10 --- /dev/null +++ b/sdk/php/swagger/lib/ObjectSerializer.php @@ -0,0 +1,312 @@ +/docs/api.swagger.yaml - for example: 0.9.13: https://github.com/ory/hydra/blob/v0.9.13/docs/api.swagger.yaml 0.8.1: https://github.com/ory/hydra/blob/v0.8.1/docs/api.swagger.yaml + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace Hydra\SDK; + +/** + * ObjectSerializer Class Doc Comment + * + * @category Class + * @package Hydra\SDK + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ObjectSerializer +{ + /** + * Serialize data + * + * @param mixed $data the data to serialize + * @param string $type the SwaggerType of the data + * @param string $format the format of the Swagger type of the data + * + * @return string|object serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } elseif ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } elseif (is_object($data)) { + $values = []; + $formats = $data::swaggerFormats(); + foreach ($data::swaggerTypes() as $property => $swaggerType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public function toPathValue($value) + { + return rawurlencode($this->toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return $this->toString($object); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public function toHeaderValue($value) + { + return $this->toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return $this->toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(\DateTime::ATOM); + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $collectionFormat the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($collectionFormat) { + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'ssv': + return implode(' ', $collection); + + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null an single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + return new \DateTime($data); + } else { + return null; + } + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } elseif ($class === '\SplFileObject') { + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + $deserialized = new \SplFileObject($filename, "w"); + $byte_written = $deserialized->fwrite($data); + if (Configuration::getDefaultConfiguration()->getDebug()) { + error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); + } + + return $deserialized; + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Hydra\SDK\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + $instance = new $class(); + foreach ($instance::swaggerTypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +}