Skip to content

Commit

Permalink
autogen(docs): generate and format documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Apr 5, 2021
1 parent 540c89d commit 24f91ab
Show file tree
Hide file tree
Showing 2 changed files with 297 additions and 6 deletions.
297 changes: 292 additions & 5 deletions docs/docs/reference/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2737,6 +2737,239 @@ p JSON.parse(result)
</TabItem>
</Tabs>

<a id="opIdpatchOAuth2Client"></a>

### Patch an OAuth 2.0 Client

```
PATCH /clients/{id} HTTP/1.1
Content-Type: application/json
Accept: application/json

```

Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will
be updated and returned via the API. This is the only time you will be able to
retrieve the client secret, so write it down and keep it safe.

OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows.
Usually, OAuth 2.0 clients are generated for applications which want to consume
your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will
need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected
and only callable by first-party components.

#### Request body

```json
[
{
"from": "string",
"op": "\"replace\"",
"path": "\"/name\"",
"value": {}
}
]
```

<a id="patch-an-oauth-2.0-client-parameters"></a>

#### Parameters

| Parameter | In | Type | Required | Description |
| --------- | ---- | ----------------------------------- | -------- | ----------- |
| id | path | string | true | none |
| body | body | [patchRequest](#schemapatchrequest) | true | none |

#### Responses

<a id="patch-an-oauth-2.0-client-responses"></a>

##### Overview

| Status | Meaning | Description | Schema |
| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | oAuth2Client | [oAuth2Client](#schemaoauth2client) |
| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) |

##### Examples

###### 200 response

```json
{
"allowed_cors_origins": ["string"],
"audience": ["string"],
"backchannel_logout_session_required": true,
"backchannel_logout_uri": "string",
"client_id": "string",
"client_name": "string",
"client_secret": "string",
"client_secret_expires_at": 0,
"client_uri": "string",
"contacts": ["string"],
"created_at": "2019-08-24T14:15:22Z",
"frontchannel_logout_session_required": true,
"frontchannel_logout_uri": "string",
"grant_types": ["string"],
"jwks": {},
"jwks_uri": "string",
"logo_uri": "string",
"metadata": {},
"owner": "string",
"policy_uri": "string",
"post_logout_redirect_uris": ["string"],
"redirect_uris": ["string"],
"request_object_signing_alg": "string",
"request_uris": ["string"],
"response_types": ["string"],
"scope": "string",
"sector_identifier_uri": "string",
"subject_type": "string",
"token_endpoint_auth_method": "string",
"token_endpoint_auth_signing_alg": "string",
"tos_uri": "string",
"updated_at": "2019-08-24T14:15:22Z",
"userinfo_signed_response_alg": "string"
}
```

<aside class="success">This operation does not require authentication</aside>

#### Code samples

<Tabs groupId="code-samples" defaultValue="shell"
values={[{label: 'Shell', value: 'shell'}, {label: 'Go', value: 'go'}, {label: 'Node', value: 'node'},
{label: 'Java', value: 'java'}, {label: 'Python', value: 'python'}, {label: 'Ruby', value: 'ruby'}]}>
<TabItem value="shell">

```shell
curl -X PATCH /clients/{id} \
-H 'Content-Type: application/json' \ -H 'Accept: application/json'
```

</TabItem>
<TabItem value="go">

```go
package main

import (
"bytes"
"net/http"
)

func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}

var body []byte
// body = ...

req, err := http.NewRequest("PATCH", "/clients/{id}", bytes.NewBuffer(body))
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}
```

</TabItem>
<TabItem value="node">

```javascript
const fetch = require('node-fetch');
const input = '[
{
"from": "string",
"op": "\"replace\"",
"path": "\"/name\"",
"value": {}
}
]';
const headers = {
'Content-Type': 'application/json', 'Accept': 'application/json'
}

fetch('/clients/{id}', {
method: 'PATCH',
body: input,
headers
})
.then(r => r.json())
.then((body) => {
console.log(body)
})
```

</TabItem>
<TabItem value="java">

```java
// This sample needs improvement.
URL obj = new URL("/clients/{id}");

HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");

int responseCode = con.getResponseCode();

BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream())
);

String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();

System.out.println(response.toString());
```

</TabItem>
<TabItem value="python">

```python
import requests

headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}

r = requests.patch(
'/clients/{id}',
params={},
headers = headers)

print r.json()
```

</TabItem>
<TabItem value="ruby">

```ruby
require 'rest-client'
require 'json'

headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}

result = RestClient.patch '/clients/{id}',
params: {}, headers: headers

p JSON.parse(result)
```

</TabItem>
</Tabs>

<a id="opIdisInstanceAlive"></a>

### Check Alive Status
Expand Down Expand Up @@ -8005,6 +8238,7 @@ _NullTime implements sql.NullTime functionality._
}
],
"Interface": {
"ProtocolScheme": "string",
"Socket": "string",
"Types": [
{
Expand Down Expand Up @@ -8112,6 +8346,7 @@ _PluginConfigArgs plugin config args_

```json
{
"ProtocolScheme": "string",
"Socket": "string",
"Types": [
{
Expand All @@ -8127,10 +8362,11 @@ _PluginConfigInterface The interface between Docker and the plugin_

#### Properties

| Name | Type | Required | Restrictions | Description |
| ------ | --------------------------------------------------- | -------- | ------------ | ----------- |
| Socket | string | true | none | socket |
| Types | [[PluginInterfaceType](#schemaplugininterfacetype)] | true | none | types |
| Name | Type | Required | Restrictions | Description |
| -------------- | --------------------------------------------------- | -------- | ------------ | ----------------------------------------------------- |
| ProtocolScheme | string | false | none | Protocol to use for clients connecting to the plugin. |
| Socket | string | true | none | socket |
| Types | [[PluginInterfaceType](#schemaplugininterfacetype)] | true | none | types |

<a id="tocSpluginconfiglinux"></a>

Expand Down Expand Up @@ -8528,7 +8764,7 @@ _Volume volume_
| Name | string | true | none | Name of the volume. |
| Options | object | true | none | The driver specific options used when creating the volume. |
| » **additionalProperties** | string | false | none | none |
| Scope | string | true | none | The level at which the volume exists. Either `global` for cluster-wide,<br/>or `local` for machine level. |
| Scope | string | true | none | The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. |
| Status | object | false | none | Low-level details about the volume, provided by the volume driver.<br/>Details are returned as a map with key/value pairs:<br/>`{"key":"value","key2":"value2"}`.<br/><br/>The `Status` field is optional, and is omitted if the volume driver<br/>does not support this feature. |
| UsageData | [VolumeUsageData](#schemavolumeusagedata) | false | none | VolumeUsageData Usage details about the volume. This information is used by the<br/>`GET /system/df` endpoint, and omitted in other endpoints. |

Expand Down Expand Up @@ -9140,6 +9376,57 @@ _Contains optional information about the OpenID Connect request._
| login_hint | string | false | none | LoginHint hints about the login identifier the End-User might use to log in (if necessary).<br/>This hint can be used by an RP if it first asks the End-User for their e-mail address (or other identifier)<br/>and then wants to pass that value as a hint to the discovered authorization service. This value MAY also be a<br/>phone number in the format specified for the phone_number Claim. The use of this parameter is optional. |
| ui_locales | [string] | false | none | UILocales is the End-User'id preferred languages and scripts for the user interface, represented as a<br/>space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value<br/>"fr-CA fr en" represents a preference for French as spoken in Canada, then French (without a region designation),<br/>followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested<br/>locales are not supported by the OpenID Provider. |

<a id="tocSpatchdocument"></a>

#### patchDocument

<a id="schemapatchdocument"></a>

```json
{
"from": "string",
"op": "\"replace\"",
"path": "\"/name\"",
"value": {}
}
```

_A JSONPatch document as defined by RFC 6902_

#### Properties

| Name | Type | Required | Restrictions | Description |
| ----- | ------ | -------- | ------------ | ------------------------------------------ |
| from | string | false | none | A JSON-pointer |
| op | string | true | none | The operation to be performed |
| path | string | true | none | A JSON-pointer |
| value | object | false | none | The value to be used within the operations |

<a id="tocSpatchrequest"></a>

#### patchRequest

<a id="schemapatchrequest"></a>

```json
[
{
"from": "string",
"op": "\"replace\"",
"path": "\"/name\"",
"value": {}
}
]
```

_A JSONPatch request_

#### Properties

| Name | Type | Required | Restrictions | Description |
| ----------- | --------------------------------------- | -------- | ------------ | ------------------- |
| _anonymous_ | [[patchDocument](#schemapatchdocument)] | false | none | A JSONPatch request |

<a id="tocSrejectrequest"></a>

#### rejectRequest
Expand Down
6 changes: 5 additions & 1 deletion spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,10 @@
"Types"
],
"properties": {
"ProtocolScheme": {
"description": "Protocol to use for clients connecting to the plugin.",
"type": "string"
},
"Socket": {
"description": "socket",
"type": "string"
Expand Down Expand Up @@ -2495,7 +2499,7 @@
}
},
"Scope": {
"description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.",
"description": "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level.",
"type": "string"
},
"Status": {
Expand Down

0 comments on commit 24f91ab

Please sign in to comment.