Skip to content

Commit

Permalink
fix: v2 sdk naming
Browse files Browse the repository at this point in the history
  • Loading branch information
aarmam committed Nov 4, 2022
1 parent 229ee43 commit 1b307ba
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
4 changes: 2 additions & 2 deletions consent/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ func TestSDK(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, 0, len(csGot))

csGot, _, err = sdk.V0alpha2Api.AdminListOAuth2SubjectConsentSessions(ctx).Subject("subject3").LoginSessionId("fk-login-session-t1-3").Execute()
csGot, _, err = sdk.OAuth2Api.ListOAuth2ConsentSessions(ctx).Subject("subject3").LoginSessionId("fk-login-session-t1-3").Execute()
require.NoError(t, err)
assert.Equal(t, 1, len(csGot))
cs = csGot[0]
assert.Equal(t, makeID("challenge", network, "3"), cs.ConsentRequest.Challenge)

csGot, _, err = sdk.V0alpha2Api.AdminListOAuth2SubjectConsentSessions(ctx).Subject("subject3").LoginSessionId("fk-login-session-t1-X").Execute()
csGot, _, err = sdk.OAuth2Api.ListOAuth2ConsentSessions(ctx).Subject("subject3").LoginSessionId("fk-login-session-t1-X").Execute()
require.NoError(t, err)
assert.Equal(t, 0, len(csGot))

Expand Down
8 changes: 8 additions & 0 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,14 @@ paths:
schema:
type: string
style: form
- description: The login session id to list the consent sessions for.
explode: true
in: query
name: login_session_id
required: false
schema:
type: string
style: form
responses:
"200":
content:
Expand Down
20 changes: 15 additions & 5 deletions internal/httpclient/api_o_auth2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions internal/httpclient/docs/OAuth2Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ No authorization required

## ListOAuth2ConsentSessions

> []OAuth2ConsentSession ListOAuth2ConsentSessions(ctx).Subject(subject).PageSize(pageSize).PageToken(pageToken).Execute()
> []OAuth2ConsentSession ListOAuth2ConsentSessions(ctx).Subject(subject).PageSize(pageSize).PageToken(pageToken).LoginSessionId(loginSessionId).Execute()
List OAuth 2.0 Consent Sessions of a Subject

Expand All @@ -1005,10 +1005,11 @@ func main() {
subject := "subject_example" // string | The subject to list the consent sessions for.
pageSize := int64(789) // int64 | Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (optional) (default to 250)
pageToken := "pageToken_example" // string | Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (optional) (default to "1")
loginSessionId := "loginSessionId_example" // string | The login session id to list the consent sessions for. (optional)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OAuth2Api.ListOAuth2ConsentSessions(context.Background()).Subject(subject).PageSize(pageSize).PageToken(pageToken).Execute()
resp, r, err := apiClient.OAuth2Api.ListOAuth2ConsentSessions(context.Background()).Subject(subject).PageSize(pageSize).PageToken(pageToken).LoginSessionId(loginSessionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.ListOAuth2ConsentSessions``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -1032,6 +1033,7 @@ Name | Type | Description | Notes
**subject** | **string** | The subject to list the consent sessions for. |
**pageSize** | **int64** | Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). | [default to 250]
**pageToken** | **string** | Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). | [default to "1"]
**loginSessionId** | **string** | The login session id to list the consent sessions for. |

### Return type

Expand Down

0 comments on commit 1b307ba

Please sign in to comment.